Commit 010086a3 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Oilpan: add transition types to Navigator and its supplements.

R=haraken@chromium.org
BUG=340522

Review URL: https://codereview.chromium.org/204063002

git-svn-id: svn://svn.chromium.org/blink/trunk@169529 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ca4c25ae
...@@ -352,7 +352,7 @@ enum PageshowEventPersistence { ...@@ -352,7 +352,7 @@ enum PageshowEventPersistence {
mutable RefPtr<BarProp> m_statusbar; mutable RefPtr<BarProp> m_statusbar;
mutable RefPtr<BarProp> m_toolbar; mutable RefPtr<BarProp> m_toolbar;
mutable RefPtr<Console> m_console; mutable RefPtr<Console> m_console;
mutable RefPtr<Navigator> m_navigator; mutable RefPtrWillBePersistent<Navigator> m_navigator;
mutable RefPtr<Location> m_location; mutable RefPtr<Location> m_location;
mutable RefPtr<StyleMedia> m_media; mutable RefPtr<StyleMedia> m_media;
......
...@@ -129,4 +129,13 @@ void Navigator::getStorageUpdates() ...@@ -129,4 +129,13 @@ void Navigator::getStorageUpdates()
// FIXME: Remove this method or rename to yieldForStorageUpdates. // FIXME: Remove this method or rename to yieldForStorageUpdates.
} }
void Navigator::trace(Visitor* visitor)
{
visitor->trace(m_plugins);
visitor->trace(m_mimeTypes);
#if ENABLE(OILPAN)
HeapSupplementable<Navigator>::trace(visitor);
#endif
}
} // namespace WebCore } // namespace WebCore
...@@ -39,9 +39,14 @@ class PluginData; ...@@ -39,9 +39,14 @@ class PluginData;
typedef int ExceptionCode; typedef int ExceptionCode;
class Navigator FINAL : public NavigatorBase, public ScriptWrappable, public RefCounted<Navigator>, public DOMWindowProperty, public Supplementable<Navigator> { class Navigator FINAL : public RefCountedWillBeGarbageCollectedFinalized<Navigator>, public NavigatorBase, public ScriptWrappable, public DOMWindowProperty, public WillBeHeapSupplementable<Navigator> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Navigator);
public: public:
static PassRefPtr<Navigator> create(LocalFrame* frame) { return adoptRef(new Navigator(frame)); } static PassRefPtrWillBeRawPtr<Navigator> create(LocalFrame* frame)
{
return adoptRefWillBeNoop(new Navigator(frame));
}
virtual ~Navigator(); virtual ~Navigator();
AtomicString language() const; AtomicString language() const;
...@@ -59,11 +64,13 @@ public: ...@@ -59,11 +64,13 @@ public:
// Relinquishes the storage lock, if one exists. // Relinquishes the storage lock, if one exists.
void getStorageUpdates(); void getStorageUpdates();
virtual void trace(Visitor*);
private: private:
explicit Navigator(LocalFrame*); explicit Navigator(LocalFrame*);
mutable RefPtrWillBePersistent<DOMPluginArray> m_plugins; mutable RefPtrWillBeMember<DOMPluginArray> m_plugins;
mutable RefPtrWillBePersistent<DOMMimeTypeArray> m_mimeTypes; mutable RefPtrWillBeMember<DOMMimeTypeArray> m_mimeTypes;
}; };
} }
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
interface Navigator { [
WillBeGarbageCollected,
] interface Navigator {
readonly attribute DOMString language; readonly attribute DOMString language;
readonly attribute PluginArray plugins; readonly attribute PluginArray plugins;
readonly attribute MimeTypeArray mimeTypes; readonly attribute MimeTypeArray mimeTypes;
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
namespace WebCore { namespace WebCore {
PassRefPtr<BatteryManager> BatteryManager::create(ExecutionContext* context) PassRefPtrWillBeRawPtr<BatteryManager> BatteryManager::create(ExecutionContext* context)
{ {
return adoptRef(new BatteryManager(context)); return adoptRefWillBeRefCountedGarbageCollected(new BatteryManager(context));
} }
BatteryManager::~BatteryManager() BatteryManager::~BatteryManager()
......
...@@ -8,17 +8,18 @@ ...@@ -8,17 +8,18 @@
#include "core/dom/ContextLifecycleObserver.h" #include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/events/EventTarget.h" #include "core/events/EventTarget.h"
#include "heap/Handle.h"
#include "modules/battery/BatteryStatus.h" #include "modules/battery/BatteryStatus.h"
namespace WebCore { namespace WebCore {
class Navigator; class Navigator;
class BatteryManager FINAL : public ContextLifecycleObserver, public RefCounted<BatteryManager>, public EventTargetWithInlineData { class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ContextLifecycleObserver, public EventTargetWithInlineData {
REFCOUNTED_EVENT_TARGET(BatteryManager); DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<BatteryManager>);
public: public:
virtual ~BatteryManager(); virtual ~BatteryManager();
static PassRefPtr<BatteryManager> create(ExecutionContext*); static PassRefPtrWillBeRawPtr<BatteryManager> create(ExecutionContext*);
// EventTarget implementation. // EventTarget implementation.
virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return EventTargetNames::BatteryManager; } virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return EventTargetNames::BatteryManager; }
...@@ -36,6 +37,8 @@ public: ...@@ -36,6 +37,8 @@ public:
void didChangeBatteryStatus(PassRefPtr<Event>, PassOwnPtr<BatteryStatus>); void didChangeBatteryStatus(PassRefPtr<Event>, PassOwnPtr<BatteryStatus>);
void trace(Visitor*) { }
private: private:
explicit BatteryManager(ExecutionContext*); explicit BatteryManager(ExecutionContext*);
......
...@@ -37,12 +37,17 @@ const char* NavigatorBattery::supplementName() ...@@ -37,12 +37,17 @@ const char* NavigatorBattery::supplementName()
NavigatorBattery& NavigatorBattery::from(Navigator& navigator) NavigatorBattery& NavigatorBattery::from(Navigator& navigator)
{ {
NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorBattery* supplement = static_cast<NavigatorBattery*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorBattery(); supplement = new NavigatorBattery();
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
void NavigatorBattery::trace(Visitor* visitor)
{
visitor->trace(m_batteryManager);
}
} // namespace WebCore } // namespace WebCore
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define NavigatorBattery_h #define NavigatorBattery_h
#include "core/frame/Navigator.h" #include "core/frame/Navigator.h"
#include "heap/Handle.h"
#include "platform/Supplementable.h" #include "platform/Supplementable.h"
namespace WebCore { namespace WebCore {
...@@ -13,7 +14,8 @@ namespace WebCore { ...@@ -13,7 +14,8 @@ namespace WebCore {
class BatteryManager; class BatteryManager;
class Navigator; class Navigator;
class NavigatorBattery : public Supplement<Navigator> { class NavigatorBattery FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorBattery>, public WillBeHeapSupplement<Navigator> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBattery);
public: public:
virtual ~NavigatorBattery(); virtual ~NavigatorBattery();
...@@ -22,11 +24,13 @@ public: ...@@ -22,11 +24,13 @@ public:
static BatteryManager* battery(Navigator&); static BatteryManager* battery(Navigator&);
BatteryManager* batteryManager(Navigator&); BatteryManager* batteryManager(Navigator&);
void trace(Visitor*);
private: private:
NavigatorBattery(); NavigatorBattery();
static const char* supplementName(); static const char* supplementName();
RefPtr<BatteryManager> m_batteryManager; RefPtrWillBeMember<BatteryManager> m_batteryManager;
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -53,10 +53,10 @@ const char* NavigatorDoNotTrack::supplementName() ...@@ -53,10 +53,10 @@ const char* NavigatorDoNotTrack::supplementName()
NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator) NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator)
{ {
NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorDoNotTrack(navigator.frame()); supplement = new NavigatorDoNotTrack(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define NavigatorDoNotTrack_h #define NavigatorDoNotTrack_h
#include "core/frame/DOMWindowProperty.h" #include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "platform/Supplementable.h" #include "platform/Supplementable.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -40,7 +41,8 @@ namespace WebCore { ...@@ -40,7 +41,8 @@ namespace WebCore {
class LocalFrame; class LocalFrame;
class Navigator; class Navigator;
class NavigatorDoNotTrack FINAL : public Supplement<Navigator>, public DOMWindowProperty { class NavigatorDoNotTrack FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorDoNotTrack>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorDoNotTrack);
public: public:
virtual ~NavigatorDoNotTrack(); virtual ~NavigatorDoNotTrack();
static NavigatorDoNotTrack& from(Navigator&); static NavigatorDoNotTrack& from(Navigator&);
...@@ -49,6 +51,8 @@ public: ...@@ -49,6 +51,8 @@ public:
String doNotTrack(); String doNotTrack();
void trace(Visitor*) { }
private: private:
explicit NavigatorDoNotTrack(LocalFrame*); explicit NavigatorDoNotTrack(LocalFrame*);
static const char* supplementName(); static const char* supplementName();
......
...@@ -82,10 +82,10 @@ const char* NavigatorGamepad::supplementName() ...@@ -82,10 +82,10 @@ const char* NavigatorGamepad::supplementName()
NavigatorGamepad& NavigatorGamepad::from(Navigator& navigator) NavigatorGamepad& NavigatorGamepad::from(Navigator& navigator)
{ {
NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorGamepad(); supplement = new NavigatorGamepad();
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
...@@ -116,4 +116,10 @@ GamepadList* NavigatorGamepad::gamepads() ...@@ -116,4 +116,10 @@ GamepadList* NavigatorGamepad::gamepads()
return m_gamepads.get(); return m_gamepads.get();
} }
void NavigatorGamepad::trace(Visitor* visitor)
{
visitor->trace(m_gamepads);
visitor->trace(m_webkitGamepads);
}
} // namespace WebCore } // namespace WebCore
...@@ -36,7 +36,8 @@ class GamepadList; ...@@ -36,7 +36,8 @@ class GamepadList;
class Navigator; class Navigator;
class WebKitGamepadList; class WebKitGamepadList;
class NavigatorGamepad FINAL : public Supplement<Navigator> { class NavigatorGamepad FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorGamepad>, public WillBeHeapSupplement<Navigator> {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGamepad);
public: public:
virtual ~NavigatorGamepad(); virtual ~NavigatorGamepad();
static NavigatorGamepad& from(Navigator&); static NavigatorGamepad& from(Navigator&);
...@@ -47,12 +48,14 @@ public: ...@@ -47,12 +48,14 @@ public:
WebKitGamepadList* webkitGamepads(); WebKitGamepadList* webkitGamepads();
GamepadList* gamepads(); GamepadList* gamepads();
virtual void trace(Visitor*);
private: private:
NavigatorGamepad(); NavigatorGamepad();
static const char* supplementName(); static const char* supplementName();
RefPtrWillBePersistent<GamepadList> m_gamepads; RefPtrWillBeMember<GamepadList> m_gamepads;
RefPtrWillBePersistent<WebKitGamepadList> m_webkitGamepads; RefPtrWillBeMember<WebKitGamepadList> m_webkitGamepads;
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -46,10 +46,10 @@ const char* NavigatorGeolocation::supplementName() ...@@ -46,10 +46,10 @@ const char* NavigatorGeolocation::supplementName()
NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator)
{ {
NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorGeolocation(navigator.frame()); supplement = new NavigatorGeolocation(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
...@@ -66,4 +66,9 @@ Geolocation* NavigatorGeolocation::geolocation() const ...@@ -66,4 +66,9 @@ Geolocation* NavigatorGeolocation::geolocation() const
return m_geolocation.get(); return m_geolocation.get();
} }
void NavigatorGeolocation::trace(Visitor* visitor)
{
visitor->trace(m_geolocation);
}
} // namespace WebCore } // namespace WebCore
...@@ -30,7 +30,8 @@ class LocalFrame; ...@@ -30,7 +30,8 @@ class LocalFrame;
class Geolocation; class Geolocation;
class Navigator; class Navigator;
class NavigatorGeolocation FINAL : public Supplement<Navigator>, public DOMWindowProperty { class NavigatorGeolocation FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorGeolocation>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorGeolocation);
public: public:
virtual ~NavigatorGeolocation(); virtual ~NavigatorGeolocation();
static NavigatorGeolocation& from(Navigator&); static NavigatorGeolocation& from(Navigator&);
...@@ -38,11 +39,13 @@ public: ...@@ -38,11 +39,13 @@ public:
static Geolocation* geolocation(Navigator&); static Geolocation* geolocation(Navigator&);
Geolocation* geolocation() const; Geolocation* geolocation() const;
void trace(Visitor*);
private: private:
NavigatorGeolocation(LocalFrame*); NavigatorGeolocation(LocalFrame*);
static const char* supplementName(); static const char* supplementName();
mutable RefPtrWillBePersistent<Geolocation> m_geolocation; mutable RefPtrWillBeMember<Geolocation> m_geolocation;
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -53,10 +53,10 @@ const char* NavigatorStorageQuota::supplementName() ...@@ -53,10 +53,10 @@ const char* NavigatorStorageQuota::supplementName()
NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator) NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator)
{ {
NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorStorageQuota(navigator.frame()); supplement = new NavigatorStorageQuota(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
...@@ -97,4 +97,11 @@ DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage() const ...@@ -97,4 +97,11 @@ DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage() const
return m_persistentStorage.get(); return m_persistentStorage.get();
} }
void NavigatorStorageQuota::trace(Visitor* visitor)
{
visitor->trace(m_storageQuota);
visitor->trace(m_temporaryStorage);
visitor->trace(m_persistentStorage);
}
} // namespace WebCore } // namespace WebCore
...@@ -42,7 +42,8 @@ class LocalFrame; ...@@ -42,7 +42,8 @@ class LocalFrame;
class Navigator; class Navigator;
class StorageQuota; class StorageQuota;
class NavigatorStorageQuota FINAL : public Supplement<Navigator>, public DOMWindowProperty { class NavigatorStorageQuota FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorStorageQuota>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorStorageQuota);
public: public:
virtual ~NavigatorStorageQuota(); virtual ~NavigatorStorageQuota();
static NavigatorStorageQuota& from(Navigator&); static NavigatorStorageQuota& from(Navigator&);
...@@ -55,13 +56,15 @@ public: ...@@ -55,13 +56,15 @@ public:
DeprecatedStorageQuota* webkitTemporaryStorage() const; DeprecatedStorageQuota* webkitTemporaryStorage() const;
DeprecatedStorageQuota* webkitPersistentStorage() const; DeprecatedStorageQuota* webkitPersistentStorage() const;
void trace(Visitor*);
private: private:
explicit NavigatorStorageQuota(LocalFrame*); explicit NavigatorStorageQuota(LocalFrame*);
static const char* supplementName(); static const char* supplementName();
mutable RefPtrWillBePersistent<StorageQuota> m_storageQuota; mutable RefPtrWillBeMember<StorageQuota> m_storageQuota;
mutable RefPtrWillBePersistent<DeprecatedStorageQuota> m_temporaryStorage; mutable RefPtrWillBeMember<DeprecatedStorageQuota> m_temporaryStorage;
mutable RefPtrWillBePersistent<DeprecatedStorageQuota> m_persistentStorage; mutable RefPtrWillBeMember<DeprecatedStorageQuota> m_persistentStorage;
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -24,11 +24,16 @@ NavigatorServiceWorker& NavigatorServiceWorker::from(Navigator& navigator) ...@@ -24,11 +24,16 @@ NavigatorServiceWorker& NavigatorServiceWorker::from(Navigator& navigator)
NavigatorServiceWorker* supplement = toNavigatorServiceWorker(navigator); NavigatorServiceWorker* supplement = toNavigatorServiceWorker(navigator);
if (!supplement) { if (!supplement) {
supplement = new NavigatorServiceWorker(navigator); supplement = new NavigatorServiceWorker(navigator);
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
NavigatorServiceWorker* NavigatorServiceWorker::toNavigatorServiceWorker(Navigator& navigator)
{
return static_cast<NavigatorServiceWorker*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
}
const char* NavigatorServiceWorker::supplementName() const char* NavigatorServiceWorker::supplementName()
{ {
return "NavigatorServiceWorker"; return "NavigatorServiceWorker";
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "bindings/v8/ScriptPromise.h" #include "bindings/v8/ScriptPromise.h"
#include "core/frame/Navigator.h" #include "core/frame/Navigator.h"
#include "heap/Handle.h"
#include "platform/Supplementable.h" #include "platform/Supplementable.h"
namespace WebCore { namespace WebCore {
...@@ -14,15 +15,18 @@ namespace WebCore { ...@@ -14,15 +15,18 @@ namespace WebCore {
class Navigator; class Navigator;
class ServiceWorkerContainer; class ServiceWorkerContainer;
class NavigatorServiceWorker FINAL : public Supplement<Navigator>, DOMWindowProperty { class NavigatorServiceWorker FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker);
public: public:
virtual ~NavigatorServiceWorker(); virtual ~NavigatorServiceWorker();
static NavigatorServiceWorker& from(Navigator&); static NavigatorServiceWorker& from(Navigator&);
static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator& navigator) { return static_cast<NavigatorServiceWorker*>(Supplement<Navigator>::from(navigator, supplementName())); } static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&);
static const char* supplementName(); static const char* supplementName();
static ServiceWorkerContainer* serviceWorker(ExecutionContext*, Navigator&); static ServiceWorkerContainer* serviceWorker(ExecutionContext*, Navigator&);
void trace(Visitor*) { }
private: private:
explicit NavigatorServiceWorker(Navigator&); explicit NavigatorServiceWorker(Navigator&);
ServiceWorkerContainer* serviceWorker(ExecutionContext*); ServiceWorkerContainer* serviceWorker(ExecutionContext*);
......
...@@ -55,10 +55,10 @@ const char* NavigatorWebMIDI::supplementName() ...@@ -55,10 +55,10 @@ const char* NavigatorWebMIDI::supplementName()
NavigatorWebMIDI& NavigatorWebMIDI::from(Navigator& navigator) NavigatorWebMIDI& NavigatorWebMIDI::from(Navigator& navigator)
{ {
NavigatorWebMIDI* supplement = static_cast<NavigatorWebMIDI*>(Supplement<Navigator>::from(navigator, supplementName())); NavigatorWebMIDI* supplement = static_cast<NavigatorWebMIDI*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) { if (!supplement) {
supplement = new NavigatorWebMIDI(navigator.frame()); supplement = new NavigatorWebMIDI(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
} }
return *supplement; return *supplement;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define NavigatorWebMIDI_h #define NavigatorWebMIDI_h
#include "core/frame/DOMWindowProperty.h" #include "core/frame/DOMWindowProperty.h"
#include "heap/Handle.h"
#include "modules/webmidi/MIDIOptions.h" #include "modules/webmidi/MIDIOptions.h"
#include "platform/Supplementable.h" #include "platform/Supplementable.h"
...@@ -40,7 +41,8 @@ namespace WebCore { ...@@ -40,7 +41,8 @@ namespace WebCore {
class MIDIAccessPromise; class MIDIAccessPromise;
class Navigator; class Navigator;
class NavigatorWebMIDI FINAL : public Supplement<Navigator>, public DOMWindowProperty { class NavigatorWebMIDI FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorWebMIDI>, public WillBeHeapSupplement<Navigator>, public DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorWebMIDI);
public: public:
virtual ~NavigatorWebMIDI(); virtual ~NavigatorWebMIDI();
static NavigatorWebMIDI& from(Navigator&); static NavigatorWebMIDI& from(Navigator&);
...@@ -48,6 +50,8 @@ public: ...@@ -48,6 +50,8 @@ public:
static PassRefPtrWillBeRawPtr<MIDIAccessPromise> requestMIDIAccess(Navigator&, const Dictionary&); static PassRefPtrWillBeRawPtr<MIDIAccessPromise> requestMIDIAccess(Navigator&, const Dictionary&);
PassRefPtrWillBeRawPtr<MIDIAccessPromise> requestMIDIAccess(const Dictionary&); PassRefPtrWillBeRawPtr<MIDIAccessPromise> requestMIDIAccess(const Dictionary&);
void trace(Visitor*) { }
private: private:
NavigatorWebMIDI(LocalFrame*); NavigatorWebMIDI(LocalFrame*);
static const char* supplementName(); 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