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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 1411063007: Add mojo::StrongBindingSet and use it in GeolocationServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 7aa79eefc542720c2b9e04e982dd5930607d2fee..e8f96ef0a02de21e0719e530d9e883730e1fb995 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -364,10 +364,15 @@ jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) {
}
void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) {
- if (should_pause)
- web_contents_->GetGeolocationServiceContext()->PauseUpdates();
- else
- web_contents_->GetGeolocationServiceContext()->ResumeUpdates();
+ if (should_pause) {
+ GeolocationServiceContext::GetOrCreateForWebContents(web_contents_)
+ ->PauseUpdates();
+ } else {
+ auto geolocation_service_context =
Anand Mistry (off Chromium) 2015/11/10 04:53:39 Why the difference?
Sam McNally 2015/11/11 07:04:02 Pausing should create the context so that if the f
+ GeolocationServiceContext::FromWebContents(web_contents_);
+ if (geolocation_service_context)
+ geolocation_service_context->ResumeUpdates();
+ }
}
// All positions and sizes are in CSS pixels.

Powered by Google App Engine
This is Rietveld 408576698