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

Unified Diff: android_webview/native/aw_geolocation_permission_context.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/aw_geolocation_permission_context.h ('k') | base/callback_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_geolocation_permission_context.cc
===================================================================
--- android_webview/native/aw_geolocation_permission_context.cc (revision 269778)
+++ android_webview/native/aw_geolocation_permission_context.cc (working copy)
@@ -16,18 +16,13 @@
AwGeolocationPermissionContext::~AwGeolocationPermissionContext() {
}
-void
-AwGeolocationPermissionContext::RequestGeolocationPermissionOnUIThread(
- int render_process_id,
- int render_view_id,
+void AwGeolocationPermissionContext::RequestGeolocationPermission(
+ content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
base::Callback<void(bool)> callback) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-
- AwContents* aw_contents =
- AwContents::FromID(render_process_id, render_view_id);
+ AwContents* aw_contents = AwContents::FromWebContents(web_contents);
if (!aw_contents) {
callback.Run(false);
return;
@@ -35,65 +30,20 @@
aw_contents->ShowGeolocationPrompt(requesting_frame, callback);
}
-void
-AwGeolocationPermissionContext::RequestGeolocationPermission(
- int render_process_id,
- int render_view_id,
- int bridge_id,
- const GURL& requesting_frame,
- bool user_gesture,
- base::Callback<void(bool)> callback) {
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::Bind(
- &AwGeolocationPermissionContext::
- RequestGeolocationPermissionOnUIThread,
- this,
- render_process_id,
- render_view_id,
- bridge_id,
- requesting_frame,
- user_gesture,
- callback));
-}
-
// static
content::GeolocationPermissionContext*
AwGeolocationPermissionContext::Create(AwBrowserContext* browser_context) {
return new AwGeolocationPermissionContext();
}
-void
-AwGeolocationPermissionContext::CancelGeolocationPermissionRequestOnUIThread(
- int render_process_id,
- int render_view_id,
+void AwGeolocationPermissionContext::CancelGeolocationPermissionRequest(
+ content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-
- AwContents* aw_contents =
- AwContents::FromID(render_process_id, render_view_id);
+ AwContents* aw_contents = AwContents::FromWebContents(web_contents);
if (aw_contents) {
aw_contents->HideGeolocationPrompt(requesting_frame);
}
}
-void
-AwGeolocationPermissionContext::CancelGeolocationPermissionRequest(
- int render_process_id,
- int render_view_id,
- int bridge_id,
- const GURL& requesting_frame) {
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::Bind(
- &AwGeolocationPermissionContext::
- CancelGeolocationPermissionRequestOnUIThread,
- this,
- render_process_id,
- render_view_id,
- bridge_id,
- requesting_frame));
-}
-
} // namespace android_webview
« no previous file with comments | « android_webview/native/aw_geolocation_permission_context.h ('k') | base/callback_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698