|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by yuryu Modified:
3 years, 10 months ago CC:
chromium-reviews, blink-reviews-html_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews, kinuko+watch, rwlbuis Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReplace Document::postTask with WebTaskRunner::postTask
Document::postTask is deprecated in favor of WebTaskRunner::postTask.
This patch removes occurrences of postTask invocations from
Document type instances.
BUG=625927
Review-Url: https://codereview.chromium.org/2688473005
Cr-Commit-Position: refs/heads/master@{#450283}
Committed: https://chromium.googlesource.com/chromium/src/+/0c0fbcfa235ac535ef2b82690bb3619deee6b035
Patch Set 1 #
Total comments: 4
Patch Set 2 : Null-check context in task handlers #Patch Set 3 : rebase #
Total comments: 8
Patch Set 4 : make document persistent for console messages #Patch Set 5 : add a comment #Patch Set 6 : remove extra null-check: context on addConsoleMessage is now persistent #
Messages
Total messages: 38 (18 generated)
The CQ bit was checked by yuryu@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.
yuryu@chromium.org changed reviewers: + nhiroki@chromium.org, tzik@chromium.org
https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/Document.cpp:388: static void runAutofocusTask(ExecutionContext* context) { null check for |context| is needed here too. https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/Document.cpp:5715: ExecutionContext* context) { null check for |context| is needed here, since postTask/crossThreadBind doesn't have the task cancellation.
tzik, I added null-checks. There is an additional hunk that only appears in a delta from patch set 1 https://codereview.chromium.org/2688473005/diff2/1:40001/third_party/WebKit/S... but it doesn't appear when you see the entire diff: https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... I'm not sure how I can fix this.
https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/Document.cpp:388: static void runAutofocusTask(ExecutionContext* context) { On 2017/02/09 23:50:20, tzik wrote: > null check for |context| is needed here too. Done. https://codereview.chromium.org/2688473005/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/Document.cpp:5715: ExecutionContext* context) { On 2017/02/09 23:50:19, tzik wrote: > null check for |context| is needed here, since postTask/crossThreadBind doesn't > have the task cancellation. Done.
lgtm
yuryu@chromium.org changed reviewers: + haraken@chromium.org
haraken, can you take a look? thanks.
lgtm. Can you update/remove the prefix on the CL subject and description?
LGTM with comments. https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:5734: wrapCrossThreadWeakPersistent(this))); I guess we should use a strong Persistent here because the console message should be printed regardless of the document is gone or not. https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); Ditto.
https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); On 2017/02/13 06:43:52, haraken wrote: > > Ditto. I think this should be weak, since focusing an element doesn't make sense on a detached document.
https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); On 2017/02/13 06:56:33, tzik wrote: > On 2017/02/13 06:43:52, haraken wrote: > > > > Ditto. > > I think this should be weak, since focusing an element doesn't make sense on a > detached document. Then we should explicitly check if the document has been detached or not. Note that a weak persistent handle is cleared when a GC is eventually triggered not when the document gets detached.
Description was changed from ========== Worker: Replace Document::postTask with WebTaskRunner::postTask Document::postTask is deprecated in favor of WebTaskRunner::postTask. This patch removes occurrences of postTask invocations from Document type instances. BUG=625927 ========== to ========== Replace Document::postTask with WebTaskRunner::postTask Document::postTask is deprecated in favor of WebTaskRunner::postTask. This patch removes occurrences of postTask invocations from Document type instances. BUG=625927 ==========
https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); On 2017/02/13 06:58:35, haraken wrote: > On 2017/02/13 06:56:33, tzik wrote: > > On 2017/02/13 06:43:52, haraken wrote: > > > > > > Ditto. > > > > I think this should be weak, since focusing an element doesn't make sense on a > > detached document. > > Then we should explicitly check if the document has been detached or not. Note > that a weak persistent handle is cleared when a GC is eventually triggered not > when the document gets detached. We don't need the check, since it's done in Element::focus(). The Persistent here extends the lifetime of Document slightly for an effective nop.
On 2017/02/13 08:58:53, tzik wrote: > https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/dom/Document.cpp (right): > > https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Document.cpp:6323: > WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); > On 2017/02/13 06:58:35, haraken wrote: > > On 2017/02/13 06:56:33, tzik wrote: > > > On 2017/02/13 06:43:52, haraken wrote: > > > > > > > > Ditto. > > > > > > I think this should be weak, since focusing an element doesn't make sense on > a > > > detached document. > > > > Then we should explicitly check if the document has been detached or not. Note > > that a weak persistent handle is cleared when a GC is eventually triggered not > > when the document gets detached. > > We don't need the check, since it's done in Element::focus(). > The Persistent here extends the lifetime of Document slightly for an effective > nop. ah, makes sense.
https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:5734: wrapCrossThreadWeakPersistent(this))); On 2017/02/13 06:43:51, haraken wrote: > > I guess we should use a strong Persistent here because the console message > should be printed regardless of the document is gone or not. > Done. https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); Do you think it's good to add a comment about it? If it's confusing.
On 2017/02/13 09:14:04, yuryu wrote: > https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/dom/Document.cpp (right): > > https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Document.cpp:5734: > wrapCrossThreadWeakPersistent(this))); > On 2017/02/13 06:43:51, haraken wrote: > > > > I guess we should use a strong Persistent here because the console message > > should be printed regardless of the document is gone or not. > > > > Done. > > https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Document.cpp:6323: > WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); > Do you think it's good to add a comment about it? If it's confusing. Yeah, sounds nice. LGTM.
https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/2688473005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Document.cpp:6323: WTF::bind(&runAutofocusTask, wrapWeakPersistent(this))); On 2017/02/13 09:14:04, yuryu wrote: > Do you think it's good to add a comment about it? If it's confusing. Done.
The CQ bit was checked by yuryu@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from nhiroki@chromium.org, tzik@chromium.org, haraken@chromium.org Link to the patchset: https://codereview.chromium.org/2688473005/#ps80001 (title: "add a comment")
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 yuryu@chromium.org
I forgot to remove a null-check in runAddConsoleMessageTask after making its context persistent. Can you take a look? Thanks.
The CQ bit was checked by yuryu@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.
lgtm
The CQ bit was checked by yuryu@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org, nhiroki@chromium.org Link to the patchset: https://codereview.chromium.org/2688473005/#ps100001 (title: "remove extra null-check: context on addConsoleMessage is now persistent")
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": 100001, "attempt_start_ts": 1487055231531560,
"parent_rev": "2899a23c7bc25c04eb7c1130d404ddcfd2adff60", "commit_rev":
"0c0fbcfa235ac535ef2b82690bb3619deee6b035"}
Message was sent while issue was closed.
Description was changed from ========== Replace Document::postTask with WebTaskRunner::postTask Document::postTask is deprecated in favor of WebTaskRunner::postTask. This patch removes occurrences of postTask invocations from Document type instances. BUG=625927 ========== to ========== Replace Document::postTask with WebTaskRunner::postTask Document::postTask is deprecated in favor of WebTaskRunner::postTask. This patch removes occurrences of postTask invocations from Document type instances. BUG=625927 Review-Url: https://codereview.chromium.org/2688473005 Cr-Commit-Position: refs/heads/master@{#450283} Committed: https://chromium.googlesource.com/chromium/src/+/0c0fbcfa235ac535ef2b82690bb3... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/0c0fbcfa235ac535ef2b82690bb3... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
