|
|
DescriptionMove some rendered rect method impls from DMC To TextMatchMarkerListImpl
In this CL, I'm moving some rendered rect-related logic for TextMatch markers
from DocumentMarkerController into TextMatchMarkerListImpl. I am adding two
methods to TextMatchMarkerListImpl:
AppendRenderedRectsToVector(const Node&, Vector<IntRect>*)
UpdateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&)
In a later CL, I will move the implementations from DocumentMarkerController.cpp
to TextMatchMarkerListImpl.cpp, and make UpdateMarkerRenderedRectIfNeeded a
private method of TextMatchMarkerListImpl.
BUG=707867
Review-Url: https://codereview.chromium.org/2896703003
Cr-Commit-Position: refs/heads/master@{#474596}
Committed: https://chromium.googlesource.com/chromium/src/+/8b8a4e0948600fe3347678918abb63c43e1c2ee3
Patch Set 1 #Patch Set 2 : Remove DocumentMarkerController::UpdateMarkerRenderedRectIfNeeded() declaration #Patch Set 3 : Rebase #
Total comments: 8
Patch Set 4 : Modify DCHECK, make Update..IfNeeded private, return vector instead of appending #Patch Set 5 : Remove unnecessary IsEmpty() check #Patch Set 6 : Rebase #
Total comments: 2
Patch Set 7 : Remove UpdateMarkerRenderedRectIfNecessary(), add const to RenderedRects() #
Dependent Patchsets: Messages
Total messages: 36 (26 generated)
The CQ bit was checked by rlanday@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...
rlanday@chromium.org changed reviewers: + xiaochengh@chromium.org, yosin@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by rlanday@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: This issue passed the CQ dry run.
https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:411: DCHECK(!document_->View() || !document_->View()->NeedsLayout()); We should not call this function when |document_->View() == nullptr|. Did you find the case of |document_->View() == nullptr|? https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:433: ToTextMatchMarkerListImpl(list)->AppendRenderedRectsToVector(node, &result); We can use |Vector<T>::AppendVector()| as |DocumentMarkerController::Markers()|. https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h (right): https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h:40: void AppendRenderedRectsToVector(const Node&, Vector<IntRect>*); Let's make this function to return |Vector<IntRect>|, c++11-ish, rather than updating parameter. https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h:41: void UpdateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&); nit: |UpdateMarkerRenderedRectIfNeeded()| should be in private section. It is called only from |AppendRenderedRectsToVector()|
https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:411: DCHECK(!document_->View() || !document_->View()->NeedsLayout()); On 2017/05/22 at 05:24:18, yosin_UTC9 wrote: > We should not call this function when |document_->View() == nullptr|. > Did you find the case of |document_->View() == nullptr|? I'm just moving this check up from UpdateMarkerRenderedRectIfNeeded() (since it has to be in DMC)...do you think we should change the DCHECK to verify that document_->View() != nullptr? https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:433: ToTextMatchMarkerListImpl(list)->AppendRenderedRectsToVector(node, &result); On 2017/05/22 at 05:24:18, yosin_UTC9 wrote: > We can use |Vector<T>::AppendVector()| as |DocumentMarkerController::Markers()|. I think that would involve constructing a temporary vector and then copying, which would involve some efficiency loss; is that OK?
https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:411: DCHECK(!document_->View() || !document_->View()->NeedsLayout()); On 2017/05/22 at 05:29:11, rlanday wrote: > On 2017/05/22 at 05:24:18, yosin_UTC9 wrote: > > We should not call this function when |document_->View() == nullptr|. > > Did you find the case of |document_->View() == nullptr|? > > I'm just moving this check up from UpdateMarkerRenderedRectIfNeeded() (since it has to be in DMC)...do you think we should change the DCHECK to verify that document_->View() != nullptr? Let's try. And change call sites not to do so. https://codereview.chromium.org/2896703003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:433: ToTextMatchMarkerListImpl(list)->AppendRenderedRectsToVector(node, &result); On 2017/05/22 at 05:29:11, rlanday wrote: > On 2017/05/22 at 05:24:18, yosin_UTC9 wrote: > > We can use |Vector<T>::AppendVector()| as |DocumentMarkerController::Markers()|. > > I think that would involve constructing a temporary vector and then copying, which would involve some efficiency loss; is that OK? OK. Let's do cleaner implementation. When perf testing says temporary vector makes slower, we think better way.
The CQ bit was checked by rlanday@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...
On 2017/05/22 at 05:54:26, yosin wrote: > > > Did you find the case of |document_->View() == nullptr|? > > > > I'm just moving this check up from UpdateMarkerRenderedRectIfNeeded() (since it has to be in DMC)...do you think we should change the DCHECK to verify that document_->View() != nullptr? > > Let's try. And change call sites not to do so. Ok, I've updated the CL. I changed the DCHECK to not check for the null case (if it *is* null, an error should occur when we try to dereference the pointer, so I didn't add a separate DCHECK to verify that it's non-null). There's only one call site, in FrameView.
The CQ bit was checked by rlanday@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: This issue passed the CQ dry run.
The CQ bit was checked by rlanday@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: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
https://codereview.chromium.org/2896703003/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2896703003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:449: void TextMatchMarkerListImpl::UpdateMarkerRenderedRectIfNeeded( Since this function is just two lines, let's expand into |RenderedRects()|. https://codereview.chromium.org/2896703003/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h (right): https://codereview.chromium.org/2896703003/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h:40: Vector<IntRect> RenderedRects(const Node&); nit: s/;/ const;/
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Updated
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: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by yosin@chromium.org
lgtm
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": 120001, "attempt_start_ts": 1495689449706440, "parent_rev": "a0793c35f0db302a2a619f69670149b60a568e55", "commit_rev": "8b8a4e0948600fe3347678918abb63c43e1c2ee3"}
Message was sent while issue was closed.
Description was changed from ========== Move some rendered rect method impls from DMC To TextMatchMarkerListImpl In this CL, I'm moving some rendered rect-related logic for TextMatch markers from DocumentMarkerController into TextMatchMarkerListImpl. I am adding two methods to TextMatchMarkerListImpl: AppendRenderedRectsToVector(const Node&, Vector<IntRect>*) UpdateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&) In a later CL, I will move the implementations from DocumentMarkerController.cpp to TextMatchMarkerListImpl.cpp, and make UpdateMarkerRenderedRectIfNeeded a private method of TextMatchMarkerListImpl. BUG=707867 ========== to ========== Move some rendered rect method impls from DMC To TextMatchMarkerListImpl In this CL, I'm moving some rendered rect-related logic for TextMatch markers from DocumentMarkerController into TextMatchMarkerListImpl. I am adding two methods to TextMatchMarkerListImpl: AppendRenderedRectsToVector(const Node&, Vector<IntRect>*) UpdateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&) In a later CL, I will move the implementations from DocumentMarkerController.cpp to TextMatchMarkerListImpl.cpp, and make UpdateMarkerRenderedRectIfNeeded a private method of TextMatchMarkerListImpl. BUG=707867 Review-Url: https://codereview.chromium.org/2896703003 Cr-Commit-Position: refs/heads/master@{#474596} Committed: https://chromium.googlesource.com/chromium/src/+/8b8a4e0948600fe3347678918abb... ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/8b8a4e0948600fe3347678918abb... |