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

Unified Diff: content/browser/android/content_view_core_impl.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: fix android 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
Index: content/browser/android/content_view_core_impl.cc
===================================================================
--- content/browser/android/content_view_core_impl.cc (revision 269041)
+++ content/browser/android/content_view_core_impl.cc (working copy)
@@ -224,8 +224,7 @@
dpi_scale_(GetPrimaryDisplayDeviceScaleFactor()),
view_android_(view_android),
window_android_(window_android),
- device_orientation_(0),
- geolocation_needs_pause_(false) {
+ device_orientation_(0) {
CHECK(web_contents) <<
"A ContentViewCoreImpl should be created with a valid WebContents.";
@@ -332,8 +331,6 @@
}
}
SetFocusInternal(HasFocus());
- if (geolocation_needs_pause_)
- PauseOrResumeGeolocation(true);
break;
}
case NOTIFICATION_RENDERER_PROCESS_CREATED: {
@@ -418,23 +415,7 @@
}
void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) {
- geolocation_needs_pause_ = should_pause;
- RenderViewHostImpl* rvh =
- static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost());
- if (rvh) {
- scoped_refptr<GeolocationDispatcherHost> geolocation_dispatcher =
- static_cast<RenderProcessHostImpl*>(
- web_contents_->GetRenderProcessHost())->
- geolocation_dispatcher_host();
- if (geolocation_dispatcher.get()) {
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&GeolocationDispatcherHost::PauseOrResume,
- geolocation_dispatcher,
- rvh->GetRoutingID(),
- should_pause));
- geolocation_needs_pause_ = false;
- }
- }
+ web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause);
}
// All positions and sizes are in CSS pixels.

Powered by Google App Engine
This is Rietveld 408576698