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

Unified Diff: content/browser/devtools/protocol/emulation_handler.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/devtools/protocol/emulation_handler.cc
diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc
index cae9f00fc490b8beb25ea41dafc8dfbcead61daa..c75d9c2bf08e19d25f7186a36cedc8e0aff24ed8 100644
--- a/content/browser/devtools/protocol/emulation_handler.cc
+++ b/content/browser/devtools/protocol/emulation_handler.cc
@@ -10,6 +10,7 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
+#include "content/public/common/geoposition.h"
#include "content/public/common/url_constants.h"
namespace content {
@@ -75,7 +76,7 @@ Response EmulationHandler::SetGeolocationOverride(
return Response::InternalError("Could not connect to view");
GeolocationServiceContext* geolocation_context =
- GetWebContents()->GetGeolocationServiceContext();
+ GeolocationServiceContext::GetOrCreateForWebContents(GetWebContents());
scoped_ptr<Geoposition> geoposition(new Geoposition());
if (latitude && longitude && accuracy) {
geoposition->latitude = *latitude;
@@ -97,8 +98,9 @@ Response EmulationHandler::ClearGeolocationOverride() {
return Response::InternalError("Could not connect to view");
GeolocationServiceContext* geolocation_context =
- GetWebContents()->GetGeolocationServiceContext();
- geolocation_context->ClearOverride();
+ GeolocationServiceContext::FromWebContents(GetWebContents());
+ if (geolocation_context)
+ geolocation_context->ClearOverride();
return Response::OK();
}

Powered by Google App Engine
This is Rietveld 408576698