mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1620322 - Part 9: Move ContentBlockingLog to antitracking to keep all related code together in the same place; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65822 --HG-- rename : dom/base/ContentBlockingLog.cpp => toolkit/components/antitracking/ContentBlockingLog.cpp rename : dom/base/ContentBlockingLog.h => toolkit/components/antitracking/ContentBlockingLog.h extra : moz-landing-system : lando
This commit is contained in:
parent
1195c302a4
commit
271a1e1e51
@ -48,11 +48,11 @@
|
||||
#include "nsContentListDeclarations.h"
|
||||
#include "nsExpirationTracker.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsWindowSizes.h"
|
||||
#include "ReferrerInfo.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/CallState.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/dom/ContentBlockingLog.h"
|
||||
#include "mozilla/dom/DispatcherTrait.h"
|
||||
#include "mozilla/dom/DocumentOrShadowRoot.h"
|
||||
#include "mozilla/dom/ViewportMetaData.h"
|
||||
|
@ -156,7 +156,6 @@ EXPORTS.mozilla.dom += [
|
||||
'ChromeNodeList.h',
|
||||
'ChromeUtils.h',
|
||||
'Comment.h',
|
||||
'ContentBlockingLog.h',
|
||||
'ContentFrameMessageManager.h',
|
||||
'ContentProcessMessageManager.h',
|
||||
'CustomElementRegistry.h',
|
||||
@ -280,7 +279,6 @@ UNIFIED_SOURCES += [
|
||||
'ChromeNodeList.cpp',
|
||||
'ChromeUtils.cpp',
|
||||
'Comment.cpp',
|
||||
'ContentBlockingLog.cpp',
|
||||
'ContentFrameMessageManager.cpp',
|
||||
'ContentIterator.cpp',
|
||||
'ContentProcessMessageManager.cpp',
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "mozilla/dom/WindowRootBinding.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWindowRoot.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef mozilla_dom_WindowGlobalParent_h
|
||||
#define mozilla_dom_WindowGlobalParent_h
|
||||
|
||||
#include "mozilla/ContentBlockingLog.h"
|
||||
#include "mozilla/ContentBlockingNotifier.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nsISupports.h"
|
||||
#include "mozilla/dom/WindowGlobalActor.h"
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
#include "mozilla/dom/ContentBlockingLog.h"
|
||||
|
||||
class nsIPrincipal;
|
||||
class nsIURI;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/SystemGroup.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mozilla/dom/Navigator.h"
|
||||
#include "mozilla/dom/ReportingHeader.h"
|
||||
#include "mozilla/dom/ReportDeliver.h"
|
||||
#include "mozilla/JSONWriter.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIURIMutator.h"
|
||||
#include "nsString.h"
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "mozilla/layers/SourceSurfaceVolatileData.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "nsMargin.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
@ -28,6 +28,7 @@
|
||||
#ifdef FUZZING
|
||||
# include "mozilla/StaticPrefs_fuzzing.h"
|
||||
#endif
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "mozilla/StaticPrefs_javascript.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
|
@ -30,8 +30,6 @@ static LazyLogModule gContentBlockingLog("ContentBlockingLog");
|
||||
|
||||
typedef Telemetry::OriginMetricID OriginMetricID;
|
||||
|
||||
namespace dom {
|
||||
|
||||
// sync with TelemetryOriginData.inc
|
||||
NS_NAMED_LITERAL_CSTRING(ContentBlockingLog::kDummyOriginHash, "PAGELOAD");
|
||||
|
||||
@ -293,5 +291,4 @@ void ContentBlockingLog::ReportOrigins() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
@ -4,8 +4,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_ContentBlockingLog_h
|
||||
#define mozilla_dom_ContentBlockingLog_h
|
||||
#ifndef mozilla_ContentBlockingLog_h
|
||||
#define mozilla_ContentBlockingLog_h
|
||||
|
||||
#include "mozilla/ContentBlockingNotifier.h"
|
||||
#include "mozilla/JSONWriter.h"
|
||||
@ -21,7 +21,6 @@
|
||||
class nsIPrincipal;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class ContentBlockingLog final {
|
||||
typedef ContentBlockingNotifier::StorageAccessGrantedReason
|
||||
@ -426,7 +425,6 @@ class ContentBlockingLog final {
|
||||
OriginDataTable mLog;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
@ -36,6 +36,7 @@ EXPORTS.mozilla = [
|
||||
'AntiTrackingUtils.h',
|
||||
'ContentBlocking.h',
|
||||
'ContentBlockingAllowList.h',
|
||||
'ContentBlockingLog.h',
|
||||
'ContentBlockingNotifier.h',
|
||||
'ContentBlockingUserInteraction.h',
|
||||
'StorageAccess.h',
|
||||
@ -48,6 +49,7 @@ UNIFIED_SOURCES += [
|
||||
'AntiTrackingUtils.cpp',
|
||||
'ContentBlocking.cpp',
|
||||
'ContentBlockingAllowList.cpp',
|
||||
'ContentBlockingLog.cpp',
|
||||
'ContentBlockingNotifier.cpp',
|
||||
'ContentBlockingUserInteraction.cpp',
|
||||
'SettingsChangeObserver.cpp',
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "core/TelemetryOrigin.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "mozilla/dom/ContentBlockingLog.h"
|
||||
#include "mozilla/ContentBlockingLog.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Unused.h"
|
||||
@ -48,7 +48,7 @@ TEST_F(TelemetryTestFixture, RecordOrigin) {
|
||||
Unused << mTelemetry->ClearOrigins();
|
||||
|
||||
Telemetry::RecordOrigin(OriginMetricID::TelemetryTest_Test1,
|
||||
mozilla::dom::ContentBlockingLog::kDummyOriginHash);
|
||||
mozilla::ContentBlockingLog::kDummyOriginHash);
|
||||
|
||||
JS::RootedValue originSnapshot(aCx);
|
||||
GetOriginSnapshot(aCx, &originSnapshot);
|
||||
@ -65,7 +65,7 @@ TEST_F(TelemetryTestFixture, RecordOrigin) {
|
||||
JS::RootedObject originsObj(aCx, &origins.toObject());
|
||||
JS::RootedValue count(aCx);
|
||||
ASSERT_TRUE(JS_GetProperty(
|
||||
aCx, originsObj, mozilla::dom::ContentBlockingLog::kDummyOriginHash.get(),
|
||||
aCx, originsObj, mozilla::ContentBlockingLog::kDummyOriginHash.get(),
|
||||
&count));
|
||||
ASSERT_TRUE(count.isInt32() && count.toInt32() == 1)
|
||||
<< "Must have recorded the origin exactly once.";
|
||||
|
Loading…
Reference in New Issue
Block a user