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(); |
} |