Hi John, Marcus, Could you please review this CL? @Marcus: I am looping in as ...
8 years, 7 months ago
(2012-05-02 19:10:21 UTC)
#1
Hi John, Marcus,
Could you please review this CL?
@Marcus: I am looping in as a reviewer because joth@ and jknotten@ are both out
of office and I need this CL for R20.
jam
http://codereview.chromium.org/10344004/diff/3001/content/public/browser/geolocation.h File content/public/browser/geolocation.h (right): http://codereview.chromium.org/10344004/diff/3001/content/public/browser/geolocation.h#newcode29 content/public/browser/geolocation.h:29: // (crbug.com/125931). it's a bit odd adding this warning ...
8 years, 7 months ago
(2012-05-02 20:59:04 UTC)
#2
The issue is that OverrideLocationForTesting() is meant to be used far beyond the scope of ...
8 years, 7 months ago
(2012-05-02 21:06:28 UTC)
#3
The issue is that OverrideLocationForTesting() is meant to be used far beyond
the scope of unit tests as well. It is exposed via the browser's automation
interface. It really does have to affect the actual running geolocation stack.
On the other hand, in unit tests, spinning up the geolocation stack is overkill
and also very problematic as it cannot be undone (crbug.com/125342 may change
this but will not be done for R20).
jam
it's hard to review this change with all the function moves. these should be done ...
8 years, 7 months ago
(2012-05-03 06:17:49 UTC)
#4
As requested, I put the functions in geolocation_provider.cc back into their random order for easier ...
8 years, 7 months ago
(2012-05-03 08:41:15 UTC)
#5
As requested, I put the functions in geolocation_provider.cc back into their
random order for easier reviewing.
http://codereview.chromium.org/10344004/diff/7001/content/browser/geolocation...
File content/browser/geolocation/geolocation_provider.cc (right):
http://codereview.chromium.org/10344004/diff/7001/content/browser/geolocation...
content/browser/geolocation/geolocation_provider.cc:48: is_permission_granted_ =
true;
No. Website permissions are handled elsewhere. The only purpose of this variable
is to avoid spinning up the actual location providers (which costs battery)
until there is at least one client that is actually permitted to access
geolocation information. Callbacks implicitly have that permission.
bartfab (slow)
Replacing reviewer bulach@ with jknotten@ as I believe he will be back in the office ...
8 years, 7 months ago
(2012-05-03 14:25:07 UTC)
#6
Replacing reviewer bulach@ with jknotten@ as I believe he will be back in the
office first.
jam
lgtm http://codereview.chromium.org/10344004/diff/3005/content/browser/geolocation/geolocation.cc File content/browser/geolocation/geolocation.cc (left): http://codereview.chromium.org/10344004/diff/3005/content/browser/geolocation/geolocation.cc#oldcode30 content/browser/geolocation/geolocation.cc:30: void OverrideLocationForTesting( nit: no need to change the ...
8 years, 7 months ago
(2012-05-03 18:22:19 UTC)
#7
http://codereview.chromium.org/10344004/diff/3005/content/browser/geolocation/geolocation.cc File content/browser/geolocation/geolocation.cc (left): http://codereview.chromium.org/10344004/diff/3005/content/browser/geolocation/geolocation.cc#oldcode30 content/browser/geolocation/geolocation.cc:30: void OverrideLocationForTesting( The intention was not to enforce one ...
8 years, 7 months ago
(2012-05-04 08:30:21 UTC)
#8
Thanks for doing this, Bart! http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocation/geolocation.cc File content/browser/geolocation/geolocation.cc (right): http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocation/geolocation.cc#newcode61 content/browser/geolocation/geolocation.cc:61: if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { Please ...
8 years, 7 months ago
(2012-05-04 10:16:58 UTC)
#9
Thanks for doing this, Bart!
http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocatio...
File content/browser/geolocation/geolocation.cc (right):
http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocatio...
content/browser/geolocation/geolocation.cc:61: if
(!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
Please remove the curly braces here (or add them in your added code) to make the
style consistent in this file.
http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocatio...
File content/browser/geolocation/geolocation_provider.cc (right):
http://codereview.chromium.org/10344004/diff/22001/content/browser/geolocatio...
content/browser/geolocation/geolocation_provider.cc:111: it->Run(position);
It seems possible, perhaps likely, that a callback may call
GeolocationProvider::RequestCallback which could result in the vector being
reallocated and so the iterators may be invalidated.
I can think of two ways to avoid this problem.
- instead of using an iterator, use operator [] and index variable. callbacks
registered during callback invocation will be called in the same pass.
- before iterating through the vector, swap it with an empty one. callbacks
registered during the callback invocation will be called at the next update.
I think that the second option makes more sense than the first.
bartfab (slow)
John Knottenbelt, could you have another look and approve the CL if you see no ...
8 years, 7 months ago
(2012-05-04 10:35:58 UTC)
#10
Issue 10344004: Add content API for requesting the current geolocation
(Closed)
Created 8 years, 7 months ago by bartfab (slow)
Modified 8 years, 7 months ago
Reviewers: jam, John Knottenbelt
Base URL: http://git.chromium.org/chromium/src.git@master
Comments: 12