Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp

Issue 2615153002: Remove ContextClient from NavigatorDoNotTrack (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp
diff --git a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp
index 083969be6795234d9814c0bf69f3f43fe5cdff5f..108b38a0aba91b398c596d471fdedc14020660cc 100644
--- a/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp
+++ b/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.cpp
@@ -36,12 +36,11 @@
namespace blink {
-NavigatorDoNotTrack::NavigatorDoNotTrack(LocalFrame* frame)
- : ContextClient(frame) {}
+NavigatorDoNotTrack::NavigatorDoNotTrack(Navigator& navigator)
+ : Supplement<Navigator>(navigator) {}
DEFINE_TRACE(NavigatorDoNotTrack) {
Supplement<Navigator>::trace(visitor);
- ContextClient::trace(visitor);
}
const char* NavigatorDoNotTrack::supplementName() {
@@ -52,7 +51,7 @@ NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator) {
NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(
Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorDoNotTrack(navigator.frame());
+ supplement = new NavigatorDoNotTrack(navigator);
provideTo(navigator, supplementName(), supplement);
}
return *supplement;
@@ -63,9 +62,10 @@ String NavigatorDoNotTrack::doNotTrack(Navigator& navigator) {
}
String NavigatorDoNotTrack::doNotTrack() {
- if (!frame() || !frame()->loader().client())
+ LocalFrame* frame = host()->frame();
+ if (!frame || !frame->loader().client())
return String();
- return frame()->loader().client()->doNotTrackValue();
+ return frame->loader().client()->doNotTrackValue();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698