|
|
DescriptionMake TopDocumentRootScrollerController store Page instead of FrameHost
This is pre-work to move FrameHost::m_topDocumentRootScrollerController
to Page.
BUG=691794
Review-Url: https://codereview.chromium.org/2732363003
Cr-Commit-Position: refs/heads/master@{#455980}
Committed: https://chromium.googlesource.com/chromium/src/+/32fbfd186648b908ee1f708b6a95f1308f52e308
Patch Set 1 #
Total comments: 2
Patch Set 2 : Review feedback #
Total comments: 4
Patch Set 3 : Rebase and review feedback #Patch Set 4 : Rebase #Patch Set 5 : Rebase #
Dependent Patchsets: Messages
Total messages: 38 (26 generated)
The CQ bit was checked by sashab@chromium.org to run a CQ dry run
sashab@chromium.org changed reviewers: + joelhockey@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2732363003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp (right): https://codereview.chromium.org/2732363003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp:177: return toLocalFrame(m_page->frameHost().page().mainFrame())->document(); I think these references of m_page->frameHost.page() could just be m_page From what I can see, m_page and m_page->frameHost.page() are always the same. I see that Page constructs a FrameHost with this https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/page/Page... And then within FrameHost, page is not modified https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/Fra... Could the whole method be: return m_page && m_page->mainFrame() && m_page->mainFrame().isLocalFrame() ? m_page->mainFrame()->document() : nullptr;
https://codereview.chromium.org/2732363003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp (right): https://codereview.chromium.org/2732363003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp:177: return toLocalFrame(m_page->frameHost().page().mainFrame())->document(); On 2017/03/08 at 04:36:00, joelhockey wrote: > I think these references of m_page->frameHost.page() could just be m_page > > From what I can see, m_page and m_page->frameHost.page() are always the same. > I see that Page constructs a FrameHost with this > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/page/Page... > And then within FrameHost, page is not modified > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/Fra... > > Could the whole method be: > > return m_page && m_page->mainFrame() && m_page->mainFrame().isLocalFrame() > ? m_page->mainFrame()->document() : nullptr; Oh yeah, great catch! Fixed here and below, thanks.
The CQ bit was checked by sashab@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
lgtm https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp (right): https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp:174: return nullptr; It would make a lot of sense to combine the 2 if-statements above. if (!m_page || !m_page->mainFrame() || !m_page->mainFrame()->isLocalFrame() return nullptr; Or, I would use a single ternary statement for the whole function.
haraken@chromium.org changed reviewers: + haraken@chromium.org
LGTM https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h (right): https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h:109: WeakMember<Page> m_page; Not related to this CL, I don't understand why this pointer needs to be weak. TopDocumentRootScrollerController and Page should live and die at the same time, so this could just be a Member<Page>.
The CQ bit was checked by sashab@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks for the great feedback everyone! https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp (right): https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp:174: return nullptr; On 2017/03/08 at 06:02:52, joelhockey wrote: > It would make a lot of sense to combine the 2 if-statements above. > > if (!m_page || !m_page->mainFrame() || !m_page->mainFrame()->isLocalFrame() > return nullptr; > > Or, I would use a single ternary statement for the whole function. Thanks, good idea! Combined them. I tried a ternary but it looked a bit weird, I think the early-exit return better matches the style of the other methods in the class. https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h (right): https://codereview.chromium.org/2732363003/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h:109: WeakMember<Page> m_page; On 2017/03/08 at 06:15:48, haraken wrote: > Not related to this CL, I don't understand why this pointer needs to be weak. TopDocumentRootScrollerController and Page should live and die at the same time, so this could just be a Member<Page>. Haha, I thought the same thing when I saw this! Let me land it in a follow-up patch, in case it causes test failures.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by sashab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org, joelhockey@chromium.org Link to the patchset: https://codereview.chromium.org/2732363003/#ps40001 (title: "Rebase and review feedback")
The CQ bit was unchecked by sashab@chromium.org
The CQ bit was checked by sashab@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by sashab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org, joelhockey@chromium.org Link to the patchset: https://codereview.chromium.org/2732363003/#ps60001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by sashab@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org, joelhockey@chromium.org Link to the patchset: https://codereview.chromium.org/2732363003/#ps80001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 80001, "attempt_start_ts": 1489111032333440, "parent_rev": "fd6d973ee6a4c853542cf4ec2a78dfd294322402", "commit_rev": "32fbfd186648b908ee1f708b6a95f1308f52e308"}
Message was sent while issue was closed.
Description was changed from ========== Make TopDocumentRootScrollerController store Page instead of FrameHost This is pre-work to move FrameHost::m_topDocumentRootScrollerController to Page. BUG=691794 ========== to ========== Make TopDocumentRootScrollerController store Page instead of FrameHost This is pre-work to move FrameHost::m_topDocumentRootScrollerController to Page. BUG=691794 Review-Url: https://codereview.chromium.org/2732363003 Cr-Commit-Position: refs/heads/master@{#455980} Committed: https://chromium.googlesource.com/chromium/src/+/32fbfd186648b908ee1f708b6a95... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/32fbfd186648b908ee1f708b6a95... |