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

Unified Diff: third_party/WebKit/Source/core/page/FrameTree.cpp

Issue 2877893002: Make UseCounter take a LocaFrame instead of any Frame (Closed)
Patch Set: Fix compile Created 3 years, 7 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
Index: third_party/WebKit/Source/core/page/FrameTree.cpp
diff --git a/third_party/WebKit/Source/core/page/FrameTree.cpp b/third_party/WebKit/Source/core/page/FrameTree.cpp
index 945eaa4d7ff63a2c534e9dfa4121f9cd19ba98dc..9480da093754bb8bf1b0bd857573f8a1d615c4a1 100644
--- a/third_party/WebKit/Source/core/page/FrameTree.cpp
+++ b/third_party/WebKit/Source/core/page/FrameTree.cpp
@@ -51,8 +51,14 @@ FrameTree::~FrameTree() {}
const AtomicString& FrameTree::GetName() const {
// TODO(andypaicu): remove this once we have gathered the data
if (experimental_set_nulled_name_) {
- UseCounter::Count(this_frame_.Get(),
- UseCounter::kCrossOriginMainFrameNulledNameAccessed);
+ const LocalFrame* frame =
+ this_frame_->IsLocalFrame()
+ ? ToLocalFrame(this_frame_)
+ : (Top().IsLocalFrame() ? ToLocalFrame(&Top()) : nullptr);
+ if (frame) {
+ UseCounter::Count(frame,
+ UseCounter::kCrossOriginMainFrameNulledNameAccessed);
+ }
}
return name_;
}
« no previous file with comments | « third_party/WebKit/Source/core/page/AutoscrollController.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698