|
|
DescriptionUse per-frame task runner in XHR
The XHR spec describes progress events on XHR are queued on the networking
task source, where Networking task runner is the corresponding task runner.
https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
BUG=624696
Committed: https://crrev.com/f884e370f225e3cb7cde91f08dcc369952c7b863
Cr-Commit-Position: refs/heads/master@{#417230}
Patch Set 1 #Patch Set 2 : fix #Patch Set 3 : make XHRPT own a clone of WebTaskRunner #
Total comments: 4
Patch Set 4 : +comment #Patch Set 5 : revert to PS1 #Messages
Total messages: 57 (28 generated)
The CQ bit was checked by tzik@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_chromium_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 tzik@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...
Description was changed from ========== Use per-frame task runner in XHR BUG= ========== to ========== Use per-frame task runner in XHR 123456789012345678901234567890123456789012345678901234567890123456789012 The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG= ==========
tzik@chromium.org changed reviewers: + haraken@chromium.org
PTAL
LGTM Remove the 123456... in the CL description :)
Description was changed from ========== Use per-frame task runner in XHR 123456789012345678901234567890123456789012345678901234567890123456789012 The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG= ========== to ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG= ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Description was changed from ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG= ========== to ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG=624696 ==========
The CQ bit was checked by tzik@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: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by tzik@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.
I updated the CL to fix the test failure. We had to hold a ref to the WebTaskRunner for TimerBase to ensure it keeps valid while a frame is being detached. PTAL.
On 2016/08/24 04:37:12, tzik wrote: > I updated the CL to fix the test failure. We had to hold a ref to the > WebTaskRunner for TimerBase to ensure it keeps valid while a frame is being > detached. PTAL. Hmm. Maybe a better fix is to add a 'frame->isNotDetached()' check to TaskRunnerHelper::get so that it can use the default task runner when the frame is detached?
On 2016/08/24 05:03:22, haraken wrote: > On 2016/08/24 04:37:12, tzik wrote: > > I updated the CL to fix the test failure. We had to hold a ref to the > > WebTaskRunner for TimerBase to ensure it keeps valid while a frame is being > > detached. PTAL. > > Hmm. Maybe a better fix is to add a 'frame->isNotDetached()' check to > TaskRunnerHelper::get so that it can use the default task runner when the frame > is detached? We have no way to replace WebTaskRunner after the TimerBase instance is created. Can we just cancel the event on detach()?
haraken@chromium.org changed reviewers: + alexclarke@chromium.org, dcheng@chromium.org, skyostil@chromium.org
On 2016/08/24 09:28:48, tzik wrote: > On 2016/08/24 05:03:22, haraken wrote: > > On 2016/08/24 04:37:12, tzik wrote: > > > I updated the CL to fix the test failure. We had to hold a ref to the > > > WebTaskRunner for TimerBase to ensure it keeps valid while a frame is being > > > detached. PTAL. > > > > Hmm. Maybe a better fix is to add a 'frame->isNotDetached()' check to > > TaskRunnerHelper::get so that it can use the default task runner when the > frame > > is detached? > > We have no way to replace WebTaskRunner after the TimerBase instance is created. > Can we just cancel the event on detach()? Makes sense. LGTM but let's add a TODO. We should move WebTaskRunner to Oilpan's heap and replace WebTaskRunner* in TimerBase with Member<WebTaskRunner>. Then we no longer need to worry about clone(). To make that happen earlier, it's important to reach consensus about the design of the cancellable tasks. +Sami +Alex +Daniel FYI
lgtm.
https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp (right): https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp:85: , m_taskRunner(std::move(taskRunner)) I'm a bit confused why we need to clone() and keep this alive manually. Why is it not normally a problem (and why wasn't it a problem before)?
https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp (right): https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp:85: , m_taskRunner(std::move(taskRunner)) On 2016/08/24 23:30:34, dcheng wrote: > I'm a bit confused why we need to clone() and keep this alive manually. Why is > it not normally a problem (and why wasn't it a problem before)? It's normally a problem today. Currently we need to call clone() whenever we store a pointer to the per-frame scheduler on some objects. This issue will be gone once we move WebTaskRunner to Oilpan's heap and start using Member<WebTaskRunner>. In this particular case, it was not a problem before because Platform::current()->currentThread()->scheduler() is not a per-frame scheduler. The scheduler keeps alive the underlying task runners until the renderer stops.
On 2016/08/24 23:51:58, haraken wrote: > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > File > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp > (right): > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp:85: > , m_taskRunner(std::move(taskRunner)) > On 2016/08/24 23:30:34, dcheng wrote: > > I'm a bit confused why we need to clone() and keep this alive manually. Why is > > it not normally a problem (and why wasn't it a problem before)? > > It's normally a problem today. Currently we need to call clone() whenever we > store a pointer to the per-frame scheduler on some objects. This issue will be > gone once we move WebTaskRunner to Oilpan's heap and start using > Member<WebTaskRunner>. > > In this particular case, it was not a problem before because > Platform::current()->currentThread()->scheduler() is not a per-frame scheduler. > The scheduler keeps alive the underlying task runners until the renderer stops. Wow, that's a really subtle distinction. How hard will it be to move WebTaskRunner to the Oilpan heap?
On 2016/08/25 00:39:40, dcheng wrote: > On 2016/08/24 23:51:58, haraken wrote: > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > File > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp > > (right): > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp:85: > > , m_taskRunner(std::move(taskRunner)) > > On 2016/08/24 23:30:34, dcheng wrote: > > > I'm a bit confused why we need to clone() and keep this alive manually. Why > is > > > it not normally a problem (and why wasn't it a problem before)? > > > > It's normally a problem today. Currently we need to call clone() whenever we > > store a pointer to the per-frame scheduler on some objects. This issue will be > > gone once we move WebTaskRunner to Oilpan's heap and start using > > Member<WebTaskRunner>. > > > > In this particular case, it was not a problem before because > > Platform::current()->currentThread()->scheduler() is not a per-frame > scheduler. > > The scheduler keeps alive the underlying task runners until the renderer > stops. > > Wow, that's a really subtle distinction. How hard will it be to move > WebTaskRunner to the Oilpan heap? I don't think that's too hard. Alex is planning to work on it (although he is now busy with sorting out the cancellable task APIs :-) Also my plan is to completely remove Platform::current()->currentThread()->scheduler(). Once we move everything to TaskRunnerHelper, there will be no user of Platform::current()->currentThread()->scheduler().
On 2016/08/25 00:55:56, haraken wrote: > On 2016/08/25 00:39:40, dcheng wrote: > > On 2016/08/24 23:51:58, haraken wrote: > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > File > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp > > > (right): > > > > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp:85: > > > , m_taskRunner(std::move(taskRunner)) > > > On 2016/08/24 23:30:34, dcheng wrote: > > > > I'm a bit confused why we need to clone() and keep this alive manually. > Why > > is > > > > it not normally a problem (and why wasn't it a problem before)? > > > > > > It's normally a problem today. Currently we need to call clone() whenever we > > > store a pointer to the per-frame scheduler on some objects. This issue will > be > > > gone once we move WebTaskRunner to Oilpan's heap and start using > > > Member<WebTaskRunner>. > > > > > > In this particular case, it was not a problem before because > > > Platform::current()->currentThread()->scheduler() is not a per-frame > > scheduler. > > > The scheduler keeps alive the underlying task runners until the renderer > > stops. > > > > Wow, that's a really subtle distinction. How hard will it be to move > > WebTaskRunner to the Oilpan heap? > > I don't think that's too hard. Alex is planning to work on it (although he is > now busy with sorting out the cancellable task APIs :-) > > Also my plan is to completely remove > Platform::current()->currentThread()->scheduler(). Once we move everything to > TaskRunnerHelper, there will be no user of > Platform::current()->currentThread()->scheduler(). LGTM, hopefully we can get the lifetime stuff sorted out soon.
Discussed offline with dcheng. Would it be an option to make TimerBase own std::unique_ptr<WebTaskRunner> and call clone()? Once we move WebTaskRunner to Oilpan's heap, we can just replace it with Member<WebTaskRunner>.
On 2016/08/25 02:29:33, haraken wrote: > Discussed offline with dcheng. > > Would it be an option to make TimerBase own std::unique_ptr<WebTaskRunner> and > call clone()? Once we move WebTaskRunner to Oilpan's heap, we can just replace > it with Member<WebTaskRunner>. It would also make me feel safer about making changes like https://codereview.chromium.org/2250553002/ - I wasn't initially aware of the UaF potential, but now, I'm not sure how much of that CL is safe.
yhirano@chromium.org changed reviewers: + yhirano@chromium.org
https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h (right): https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: std::unique_ptr<WebTaskRunner> m_taskRunner; Please add some comments describing why this is needed.
On 2016/08/25 02:29:33, haraken wrote: > Discussed offline with dcheng. > > Would it be an option to make TimerBase own std::unique_ptr<WebTaskRunner> and > call clone()? Once we move WebTaskRunner to Oilpan's heap, we can just replace > it with Member<WebTaskRunner>. I agree that it would make sense for TimerBase to own the task runner.
https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h (right): https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: std::unique_ptr<WebTaskRunner> m_taskRunner; On 2016/08/25 04:28:25, yhirano wrote: > Please add some comments describing why this is needed. Done.
On 2016/08/29 02:08:59, tzik wrote: > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > File > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h > (right): > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: > std::unique_ptr<WebTaskRunner> m_taskRunner; > On 2016/08/25 04:28:25, yhirano wrote: > > Please add some comments describing why this is needed. > > Done. Per the discussion in #34, #35 and #38, our plan is to make TimerBase own std::unique_ptr<WebTaskRunner> instead of landing this CL, right?
On 2016/08/29 02:30:35, haraken wrote: > On 2016/08/29 02:08:59, tzik wrote: > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > File > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h > > (right): > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: > > std::unique_ptr<WebTaskRunner> m_taskRunner; > > On 2016/08/25 04:28:25, yhirano wrote: > > > Please add some comments describing why this is needed. > > > > Done. > > Per the discussion in #34, #35 and #38, our plan is to make TimerBase own > std::unique_ptr<WebTaskRunner> instead of landing this CL, right? Do we want to do it before this CL...? OK, I made a separate CL for it: https://codereview.chromium.org/2290243002/
On 2016/08/30 13:13:48, tzik wrote: > On 2016/08/29 02:30:35, haraken wrote: > > On 2016/08/29 02:08:59, tzik wrote: > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > File > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h > > > (right): > > > > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: > > > std::unique_ptr<WebTaskRunner> m_taskRunner; > > > On 2016/08/25 04:28:25, yhirano wrote: > > > > Please add some comments describing why this is needed. > > > > > > Done. > > > > Per the discussion in #34, #35 and #38, our plan is to make TimerBase own > > std::unique_ptr<WebTaskRunner> instead of landing this CL, right? > > Do we want to do it before this CL...? > OK, I made a separate CL for it: https://codereview.chromium.org/2290243002/ Once you land that CL, PS1 will work, right?
The CQ bit was checked by tzik@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.
On 2016/08/30 15:40:36, haraken wrote: > On 2016/08/30 13:13:48, tzik wrote: > > On 2016/08/29 02:30:35, haraken wrote: > > > On 2016/08/29 02:08:59, tzik wrote: > > > > > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > > File > > > > > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h > > > > (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2269513002/diff/40001/third_party/WebKit/Sour... > > > > > > > > > > third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h:112: > > > > std::unique_ptr<WebTaskRunner> m_taskRunner; > > > > On 2016/08/25 04:28:25, yhirano wrote: > > > > > Please add some comments describing why this is needed. > > > > > > > > Done. > > > > > > Per the discussion in #34, #35 and #38, our plan is to make TimerBase own > > > std::unique_ptr<WebTaskRunner> instead of landing this CL, right? > > > > Do we want to do it before this CL...? > > OK, I made a separate CL for it: https://codereview.chromium.org/2290243002/ > > Once you land that CL, PS1 will work, right? Landed the TimerBase CL and reverted this CL to PS1. Is this ready to land now?
lgtm
LGTM
The CQ bit was checked by tzik@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dcheng@chromium.org, skyostil@chromium.org Link to the patchset: https://codereview.chromium.org/2269513002/#ps80001 (title: "revert to PS1")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG=624696 ========== to ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG=624696 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG=624696 ========== to ========== Use per-frame task runner in XHR The XHR spec describes progress events on XHR are queued on the networking task source, where Networking task runner is the corresponding task runner. https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send BUG=624696 Committed: https://crrev.com/f884e370f225e3cb7cde91f08dcc369952c7b863 Cr-Commit-Position: refs/heads/master@{#417230} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/f884e370f225e3cb7cde91f08dcc369952c7b863 Cr-Commit-Position: refs/heads/master@{#417230}
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2407233002/ by tzik@chromium.org. The reason for reverting is: Speculative revert for http://crbug.com/645365. Will reland once it turns out being not the case.. |