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_; |
} |