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

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: fix compile and dchecks 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/IntersectionObservation.h" 5 #include "core/dom/IntersectionObservation.h"
6 6
7 #include "core/dom/ElementRareData.h" 7 #include "core/dom/ElementRareData.h"
8 #include "core/dom/IntersectionObserver.h" 8 #include "core/dom/IntersectionObserver.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/layout/IntersectionGeometry.h" 10 #include "core/layout/IntersectionGeometry.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 void IntersectionObservation::UpdateShouldReportRootBoundsAfterDomChange() { 95 void IntersectionObservation::UpdateShouldReportRootBoundsAfterDomChange() {
96 if (!Observer()->RootIsImplicit()) { 96 if (!Observer()->RootIsImplicit()) {
97 should_report_root_bounds_ = true; 97 should_report_root_bounds_ = true;
98 return; 98 return;
99 } 99 }
100 should_report_root_bounds_ = false; 100 should_report_root_bounds_ = false;
101 LocalFrame* target_frame = Target()->GetDocument().GetFrame(); 101 LocalFrame* target_frame = Target()->GetDocument().GetFrame();
102 if (!target_frame) 102 if (!target_frame)
103 return; 103 return;
104 Frame* root_frame = target_frame->Tree().Top(); 104 Frame& root_frame = target_frame->Tree().Top();
105 DCHECK(root_frame); 105 if (&root_frame == target_frame) {
106 if (root_frame == target_frame) {
107 should_report_root_bounds_ = true; 106 should_report_root_bounds_ = true;
108 } else { 107 } else {
109 should_report_root_bounds_ = 108 should_report_root_bounds_ =
110 target_frame->GetSecurityContext()->GetSecurityOrigin()->CanAccess( 109 target_frame->GetSecurityContext()->GetSecurityOrigin()->CanAccess(
111 root_frame->GetSecurityContext()->GetSecurityOrigin()); 110 root_frame.GetSecurityContext()->GetSecurityOrigin());
112 } 111 }
113 } 112 }
114 113
115 DEFINE_TRACE(IntersectionObservation) { 114 DEFINE_TRACE(IntersectionObservation) {
116 visitor->Trace(observer_); 115 visitor->Trace(observer_);
117 visitor->Trace(target_); 116 visitor->Trace(target_);
118 } 117 }
119 118
120 } // namespace blink 119 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698