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

Unified Diff: Source/modules/screen_orientation/ScreenOrientationController.h

Issue 595783003: Make ScreenOrientationController a FrameDestructionObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename predicate to isActiveAndVisible() Created 6 years, 3 months 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: Source/modules/screen_orientation/ScreenOrientationController.h
diff --git a/Source/modules/screen_orientation/ScreenOrientationController.h b/Source/modules/screen_orientation/ScreenOrientationController.h
index b4d323ed6928cb1c533f6ff45d669813cb3b230a..0693296f21a15f6c8c39f61139a037cfb05945cd 100644
--- a/Source/modules/screen_orientation/ScreenOrientationController.h
+++ b/Source/modules/screen_orientation/ScreenOrientationController.h
@@ -5,6 +5,7 @@
#ifndef ScreenOrientationController_h
#define ScreenOrientationController_h
+#include "core/frame/FrameDestructionObserver.h"
#include "core/frame/PlatformEventController.h"
#include "platform/Supplementable.h"
#include "platform/Timer.h"
@@ -21,6 +22,7 @@ class WebScreenOrientationClient;
class ScreenOrientationController FINAL
: public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController>
, public WillBeHeapSupplement<LocalFrame>
+ , public FrameDestructionObserver
, public PlatformEventController {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController);
WTF_MAKE_NONCOPYABLE(ScreenOrientationController);
@@ -33,13 +35,11 @@ public:
void lock(WebScreenOrientationLockType, WebLockOrientationCallback*);
void unlock();
- const LocalFrame& frame() const;
-
static void provideTo(LocalFrame&, WebScreenOrientationClient*);
static ScreenOrientationController* from(LocalFrame&);
static const char* supplementName();
- virtual void trace(Visitor*);
+ virtual void trace(Visitor*) OVERRIDE;
private:
explicit ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
@@ -58,9 +58,10 @@ private:
void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
+ bool isActiveAndVisible() const;
+
PersistentWillBeMember<ScreenOrientation> m_orientation;
WebScreenOrientationClient* m_client;
- LocalFrame& m_frame;
Timer<ScreenOrientationController> m_dispatchEventTimer;
};

Powered by Google App Engine
This is Rietveld 408576698