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

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

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: Created 3 years, 8 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/FocusController.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index 6147f5c5b9e8805b36d5d7b16b1a930762242497..7860d9bf4f2470f173efcefe9825a33bb3ca4282 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -822,7 +822,7 @@ Frame* FocusController::FocusedOrMainFrame() const {
// FIXME: This is a temporary hack to ensure that we return a LocalFrame, even
// when the mainFrame is remote. FocusController needs to be refactored to
// deal with RemoteFrames cross-process focus transfers.
- for (Frame* frame = page_->MainFrame()->Tree().Top(); frame;
+ for (Frame* frame = &page_->MainFrame()->Tree().Top(); frame;
frame = frame->Tree().TraverseNext()) {
if (frame->IsLocalRoot())
return frame;
@@ -978,8 +978,8 @@ bool FocusController::AdvanceFocusInDocumentOrder(
document->ClearFocusedElement();
document->SetSequentialFocusNavigationStartingPoint(nullptr);
SetFocusedFrame(nullptr);
- ToRemoteFrame(frame->LocalFrameRoot()->Tree().Parent())
- ->AdvanceFocus(type, frame->LocalFrameRoot());
+ ToRemoteFrame(frame->LocalFrameRoot().Tree().Parent())
+ ->AdvanceFocus(type, &frame->LocalFrameRoot());
return true;
}
@@ -1144,7 +1144,7 @@ void FocusController::SetActive(bool active) {
Frame* frame = FocusedOrMainFrame();
if (frame->IsLocalFrame()) {
Document* const document =
- ToLocalFrame(frame)->LocalFrameRoot()->GetDocument();
+ ToLocalFrame(frame)->LocalFrameRoot().GetDocument();
DCHECK(document);
if (!document->IsActive())
return;

Powered by Google App Engine
This is Rietveld 408576698