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

Side by Side Diff: content/browser/geolocation/geolocation.cc

Issue 11269002: Introduce GeolocationPermissionRequestID, a wrapper struct to contain the (render process ID, rende… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/browser/geolocation/geolocation_dispatcher_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/geolocation.h" 5 #include "content/public/browser/geolocation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
45 GeolocationUpdateCallback io_thread_callback = base::Bind( 45 GeolocationUpdateCallback io_thread_callback = base::Bind(
46 &GeolocationUpdateCallbackOnIOThread, 46 &GeolocationUpdateCallbackOnIOThread,
47 client_callback, 47 client_callback,
48 client_loop); 48 client_loop);
49 GeolocationProvider::GetInstance()->RequestCallback(io_thread_callback); 49 GeolocationProvider::GetInstance()->RequestCallback(io_thread_callback);
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54
55 // ----------------------------------------------------------------------------
56
54 void OverrideLocationForTesting( 57 void OverrideLocationForTesting(
55 const Geoposition& position, 58 const Geoposition& position,
56 const base::Closure& completion_callback) { 59 const base::Closure& completion_callback) {
57 base::Closure closure = base::Bind(&OverrideLocationForTestingOnIOThread, 60 base::Closure closure = base::Bind(&OverrideLocationForTestingOnIOThread,
58 position, 61 position,
59 completion_callback, 62 completion_callback,
60 base::MessageLoopProxy::current()); 63 base::MessageLoopProxy::current());
61 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) 64 if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
62 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, closure); 65 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, closure);
63 else 66 else
64 closure.Run(); 67 closure.Run();
65 } 68 }
66 69
67 void RequestLocationUpdate(const GeolocationUpdateCallback& callback) { 70 void RequestLocationUpdate(const GeolocationUpdateCallback& callback) {
68 base::Closure closure = base::Bind(&RequestLocationUpdateOnIOThread, 71 base::Closure closure = base::Bind(&RequestLocationUpdateOnIOThread,
69 callback, 72 callback,
70 base::MessageLoopProxy::current()); 73 base::MessageLoopProxy::current());
71 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) 74 if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
72 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, closure); 75 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, closure);
73 else 76 else
74 closure.Run(); 77 closure.Run();
75 } 78 }
76 79
77 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/browser/geolocation/geolocation_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698