Commit 8b5d6d41 authored by haraken's avatar haraken Committed by Commit bot

Remove ContextClient from NavigatorGeolocation

Now that Navigator's supplement can get a Navigator object via host().
Then Navigator's supplement doesn't need to observe ContextClient.

BUG=610176

Review-Url: https://codereview.chromium.org/2618773004
Cr-Commit-Position: refs/heads/master@{#441893}
parent 121a875a
......@@ -30,8 +30,8 @@
namespace blink {
NavigatorGeolocation::NavigatorGeolocation(LocalFrame* frame)
: ContextClient(frame) {}
NavigatorGeolocation::NavigatorGeolocation(Navigator& navigator)
: Supplement<Navigator>(navigator) {}
const char* NavigatorGeolocation::supplementName() {
return "NavigatorGeolocation";
......@@ -41,7 +41,7 @@ NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) {
NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(
Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
supplement = new NavigatorGeolocation(navigator.frame());
supplement = new NavigatorGeolocation(navigator);
provideTo(navigator, supplementName(), supplement);
}
return *supplement;
......@@ -52,15 +52,14 @@ Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) {
}
Geolocation* NavigatorGeolocation::geolocation() {
if (!m_geolocation && frame())
m_geolocation = Geolocation::create(frame()->document());
if (!m_geolocation && host()->frame())
m_geolocation = Geolocation::create(host()->frame()->document());
return m_geolocation;
}
DEFINE_TRACE(NavigatorGeolocation) {
visitor->trace(m_geolocation);
Supplement<Navigator>::trace(visitor);
ContextClient::trace(visitor);
}
} // namespace blink
......@@ -20,21 +20,18 @@
#ifndef NavigatorGeolocation_h
#define NavigatorGeolocation_h
#include "core/dom/ContextLifecycleObserver.h"
#include "core/frame/Navigator.h"
#include "platform/Supplementable.h"
#include "platform/heap/Handle.h"
namespace blink {
class LocalFrame;
class Geolocation;
class Navigator;
class NavigatorGeolocation final
: public GarbageCollected<NavigatorGeolocation>,
public Supplement<Navigator>,
public ContextClient {
public Supplement<Navigator> {
USING_GARBAGE_COLLECTED_MIXIN(NavigatorGeolocation);
public:
......@@ -45,7 +42,7 @@ class NavigatorGeolocation final
DECLARE_TRACE();
private:
explicit NavigatorGeolocation(LocalFrame*);
explicit NavigatorGeolocation(Navigator&);
static const char* supplementName();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment