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

Issue 2642863002: Move geolocation timer to frame-specific TaskRunnerTimer. (Closed)

Created:
3 years, 11 months ago by dougt
Modified:
3 years, 11 months ago
CC:
chromium-reviews, blink-reviews, mlamouri+watch-blink_chromium.org, timvolodine, mvanouwerkerk+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move geolocation timer to frame-specific TaskRunnerTimer. Move geolocation timer |m_timer| to frame-specific TaskRunnerTimer. This associates it with the geolocation frame's timer task queue. Note that the geolocation specification under specifies exactly what kind of timeout should be used, and we will use MiscPlatformAPI. See: https://www.w3.org/TR/geolocation-API/ This m_timer is used to support, in part, the geolocation 'position options'. BUG=624694 R=haraken,scheib Review-Url: https://codereview.chromium.org/2642863002 Cr-Commit-Position: refs/heads/master@{#444794} Committed: https://chromium.googlesource.com/chromium/src/+/d620cdbebcf22fbc7a76c269cf289ab87f5c646d

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use MiscPlatformAPI #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
M third_party/WebKit/Source/modules/geolocation/GeoNotifier.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp View 1 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 48 (14 generated)
dougt
haraken, ptal.
3 years, 11 months ago (2017-01-18 19:07:42 UTC) #5
haraken
Thanks for the contribution! https://codereview.chromium.org/2642863002/diff/1/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp File third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp (right): https://codereview.chromium.org/2642863002/diff/1/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp#newcode24 third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp:24: m_timer(TaskRunnerHelper::get(TaskType::Timer, geolocation->frame()), Do you have ...
3 years, 11 months ago (2017-01-18 23:30:56 UTC) #6
dougt
On 2017/01/18 23:30:56, haraken wrote: > Thanks for the contribution! > > https://codereview.chromium.org/2642863002/diff/1/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp > File ...
3 years, 11 months ago (2017-01-19 00:16:39 UTC) #7
haraken
On 2017/01/19 00:16:39, dougt wrote: > On 2017/01/18 23:30:56, haraken wrote: > > Thanks for ...
3 years, 11 months ago (2017-01-19 00:57:25 UTC) #8
dougt
On 2017/01/19 00:57:25, haraken wrote: > On 2017/01/19 00:16:39, dougt wrote: > > On 2017/01/18 ...
3 years, 11 months ago (2017-01-19 01:11:55 UTC) #12
haraken
LGTM
3 years, 11 months ago (2017-01-19 01:14:21 UTC) #13
scheib
I'm not super familiar here. I think that the comments in *code* could help justify/explain ...
3 years, 11 months ago (2017-01-19 06:19:05 UTC) #16
dougt
On 2017/01/19 06:19:05, scheib wrote: > I'm not super familiar here. I think that the ...
3 years, 11 months ago (2017-01-19 15:19:32 UTC) #17
scheib
On 2017/01/19 15:19:32, dougt wrote: > On 2017/01/19 06:19:05, scheib wrote: > > I'm not ...
3 years, 11 months ago (2017-01-19 18:19:36 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642863002/20001
3 years, 11 months ago (2017-01-19 18:25:02 UTC) #20
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/d620cdbebcf22fbc7a76c269cf289ab87f5c646d
3 years, 11 months ago (2017-01-19 18:33:16 UTC) #23
jianli
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2640403002/ by jianli@chromium.org. ...
3 years, 11 months ago (2017-01-19 20:45:24 UTC) #24
haraken
On 2017/01/19 20:45:24, jianli wrote: > A revert of this CL (patchset #2 id:20001) has ...
3 years, 11 months ago (2017-01-19 23:58:23 UTC) #26
haraken
On 2017/01/19 23:58:23, haraken wrote: > On 2017/01/19 20:45:24, jianli wrote: > > A revert ...
3 years, 11 months ago (2017-01-20 00:05:02 UTC) #27
jianli
On 2017/01/20 00:05:02, haraken wrote: > On 2017/01/19 23:58:23, haraken wrote: > > On 2017/01/19 ...
3 years, 11 months ago (2017-01-20 00:08:46 UTC) #28
haraken
On 2017/01/20 00:08:46, jianli wrote: > On 2017/01/20 00:05:02, haraken wrote: > > On 2017/01/19 ...
3 years, 11 months ago (2017-01-20 00:09:35 UTC) #29
dougt
On 2017/01/20 00:09:35, haraken wrote: > On 2017/01/20 00:08:46, jianli wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 00:17:52 UTC) #30
haraken
On 2017/01/20 00:17:52, dougt wrote: > On 2017/01/20 00:09:35, haraken wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 00:24:07 UTC) #32
dcheng
On 2017/01/20 00:24:07, haraken wrote: > On 2017/01/20 00:17:52, dougt wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 08:11:09 UTC) #33
kinuko
On 2017/01/20 00:24:07, haraken wrote: > On 2017/01/20 00:17:52, dougt wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 08:27:09 UTC) #34
dcheng
On 2017/01/20 08:27:09, kinuko wrote: > On 2017/01/20 00:24:07, haraken wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 08:31:26 UTC) #35
kinuko
On 2017/01/20 08:31:26, dcheng wrote: > On 2017/01/20 08:27:09, kinuko wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 08:36:53 UTC) #36
kinuko
On 2017/01/20 08:36:53, kinuko wrote: > On 2017/01/20 08:31:26, dcheng wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 08:39:56 UTC) #37
haraken
On 2017/01/20 08:39:56, kinuko wrote: > On 2017/01/20 08:36:53, kinuko wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 09:38:08 UTC) #38
alex clarke (OOO till 29th)
On 2017/01/20 09:38:08, haraken wrote: > On 2017/01/20 08:39:56, kinuko wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 09:39:19 UTC) #39
alex clarke (OOO till 29th)
On 2017/01/20 09:39:19, alex clarke wrote: > On 2017/01/20 09:38:08, haraken wrote: > > On ...
3 years, 11 months ago (2017-01-20 09:40:12 UTC) #40
alex clarke (OOO till 29th)
On 2017/01/20 09:39:19, alex clarke wrote: > On 2017/01/20 09:38:08, haraken wrote: > > On ...
3 years, 11 months ago (2017-01-20 09:40:14 UTC) #41
haraken
> Thanks for the digging! That makes sense. > > Would it be crazy (waste ...
3 years, 11 months ago (2017-01-20 09:40:18 UTC) #42
haraken
> > We could add a scheduler api to mass cancel everything posted if useful. ...
3 years, 11 months ago (2017-01-20 09:54:53 UTC) #43
kinuko
On 2017/01/20 09:54:53, haraken wrote: > > > We could add a scheduler api to ...
3 years, 11 months ago (2017-01-20 13:06:10 UTC) #44
tzik
On 2017/01/20 09:54:53, haraken wrote: > > > We could add a scheduler api to ...
3 years, 11 months ago (2017-01-20 19:15:40 UTC) #45
dcheng
On 2017/01/20 19:15:40, tzik wrote: > On 2017/01/20 09:54:53, haraken wrote: > > > > ...
3 years, 11 months ago (2017-01-20 19:20:40 UTC) #46
dcheng
On 2017/01/20 19:20:40, dcheng wrote: > On 2017/01/20 19:15:40, tzik wrote: > > On 2017/01/20 ...
3 years, 11 months ago (2017-01-20 19:25:51 UTC) #47
haraken
3 years, 11 months ago (2017-01-21 01:55:16 UTC) #48
Message was sent while issue was closed.
On 2017/01/20 19:25:51, dcheng wrote:
> On 2017/01/20 19:20:40, dcheng wrote:
> > On 2017/01/20 19:15:40, tzik wrote:
> > > On 2017/01/20 09:54:53, haraken wrote:
> > > > > > We could add a scheduler api to mass cancel everything posted if
> useful.
> > > > > 
> > > > > This would literally call clear() on the queues freeing the memory
(I'm
> > > > assuming
> > > > > deleting the closure would release the memory).
> > > > 
> > > > It's not enough to delete the closure. The timer needs to actually fire
in
> > the
> > > > case of Geolocation and ImageLoader.
> > > 
> > > I think that's true. If we remove m_timer.startOneShot(0,
BLINK_FROM_HERE);
> in
> > > GeoNotifier::setFatalError(), the leak happen even without this CL.
> > Geolocation
> > > seems to have a strong reference cycle containing a non GCed object.
> > > 
> > > > 
> > > > If it's nasty, we can ask developers to not assume that timers always
> fire.
> > > 
> > > +1.
> > 
> > Hmmm. I'm not sure if this is a good idea...
> > 
> > It's relatively obvious that if you destroy an object holding a Timer, that
> the
> > Timer will be cancelled.
> > It's not so obvious that tearing down something seemingly unrelated (the
> frame)
> > will also automatically cancel Timer callbacks and prevent crucial code like
> > this from running.
> > 
> > Would it be bad to just throw all the pending callbacks in a
WebFrameScheduler
> > into the process-wide task queue?
> 
> (I guess this doesn't really help either: the timer is holding a reference to
a
> task runner associated with a detached WebFrameScheduler, so if it posts more
> tasks after that, they won't get transferred...)
> 
> But I do think it will very hard to work with a system that randomly (from the
> developer's perspective) doesn't run cleanup callbacks.

Agreed with dcheng@.

Why can't we simply run all pending tasks just before the frame scheduler gets
destroyed?

BTW, when does the frame scheduler get destroyed in the sequence of
Frame::detach()?

Powered by Google App Engine
This is Rietveld 408576698