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

Side by Side Diff: chrome/browser/geolocation/chrome_geolocation_permission_context.h

Issue 273523007: Dispatch geolocation IPCs on the UI thread. Aside from simplifying the code to avoid a lot of threa… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 months 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
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 #ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 10 matching lines...) Expand all
21 // Chrome specific implementation of GeolocationPermissionContext; manages 21 // Chrome specific implementation of GeolocationPermissionContext; manages
22 // Geolocation permissions flow, and delegates UI handling via 22 // Geolocation permissions flow, and delegates UI handling via
23 // PermissionQueueController. 23 // PermissionQueueController.
24 class ChromeGeolocationPermissionContext 24 class ChromeGeolocationPermissionContext
25 : public content::GeolocationPermissionContext { 25 : public content::GeolocationPermissionContext {
26 public: 26 public:
27 explicit ChromeGeolocationPermissionContext(Profile* profile); 27 explicit ChromeGeolocationPermissionContext(Profile* profile);
28 28
29 // GeolocationPermissionContext: 29 // GeolocationPermissionContext:
30 virtual void RequestGeolocationPermission( 30 virtual void RequestGeolocationPermission(
31 int render_process_id, 31 content::WebContents* web_contents,
32 int render_view_id,
33 int bridge_id, 32 int bridge_id,
34 const GURL& requesting_frame, 33 const GURL& requesting_frame,
35 bool user_gesture, 34 bool user_gesture,
36 base::Callback<void(bool)> callback) OVERRIDE; 35 base::Callback<void(bool)> callback) OVERRIDE;
37 virtual void CancelGeolocationPermissionRequest( 36 virtual void CancelGeolocationPermissionRequest(
38 int render_process_id, 37 content::WebContents* web_contents,
39 int render_view_id,
40 int bridge_id, 38 int bridge_id,
41 const GURL& requesting_frame) OVERRIDE; 39 const GURL& requesting_frame) OVERRIDE;
42 40
43 // Called on the UI thread when the profile is about to be destroyed. 41 // Called on the UI thread when the profile is about to be destroyed.
44 void ShutdownOnUIThread(); 42 void ShutdownOnUIThread();
45 43
46 // Notifies whether or not the corresponding bridge is allowed to use 44 // Notifies whether or not the corresponding bridge is allowed to use
47 // geolocation via 45 // geolocation via
48 // GeolocationPermissionContext::SetGeolocationPermissionResponse(). 46 // GeolocationPermissionContext::SetGeolocationPermissionResponse().
49 // Called on the UI thread. 47 // Called on the UI thread.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 99
102 // These must only be accessed from the UI thread. 100 // These must only be accessed from the UI thread.
103 Profile* const profile_; 101 Profile* const profile_;
104 bool shutting_down_; 102 bool shutting_down_;
105 scoped_ptr<PermissionQueueController> permission_queue_controller_; 103 scoped_ptr<PermissionQueueController> permission_queue_controller_;
106 104
107 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext); 105 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext);
108 }; 106 };
109 107
110 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ 108 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698