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

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

Issue 2877893002: Make UseCounter take a LocaFrame instead of any Frame (Closed)
Patch Set: Rebase 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 29d2a49089d485622075f03d89e80fc5cb4d1aeb..4091caebdf28cfa50a6123b0bf121c3e23911c3b 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);
dcheng 2017/05/12 22:15:18 I think we might want to keep this: can we cheat b
Rick Byers 2017/05/25 15:32:31 Unfortunately no, in order to migrate UseCounter h
+ }
}
return name_;
}

Powered by Google App Engine
This is Rietveld 408576698