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

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

Issue 283423005: Use Promises for screen.lockOrientation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cdumez comments Created 6 years, 7 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/ScreenOrientation.h
diff --git a/Source/modules/screen_orientation/ScreenOrientation.h b/Source/modules/screen_orientation/ScreenOrientation.h
index 72e04c8a9ebfff62114a4e60e05b693ced034bc6..5369f58fdb7531d8d964893b14bfb1be3ad7b9f0 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.h
+++ b/Source/modules/screen_orientation/ScreenOrientation.h
@@ -10,14 +10,16 @@
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebScreenOrientationLockType.h"
+#include "public/platform/WebScreenOrientationType.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class Document;
-class ExceptionState;
+class ExecutionContext;
class Screen;
+class ScriptPromise;
yhirano 2014/05/22 03:48:43 I think this forward declaration is meaningless be
mlamouri (slow - plz ping) 2014/05/22 08:58:56 The forward declaration appears to be needed. It d
class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation);
@@ -26,22 +28,19 @@ public:
virtual ~ScreenOrientation();
static const AtomicString& orientation(Screen&);
- static bool lockOrientation(Screen&, const AtomicString& orientation, ExceptionState&);
+ static ScriptPromise lockOrientation(ExecutionContext*, Screen&, const AtomicString& orientation);
static void unlockOrientation(Screen&);
+ // Helper being used by this class and LockOrientationCallback.
+ static const AtomicString& orientationTypeToString(blink::WebScreenOrientationType);
+
virtual void trace(Visitor* visitor) OVERRIDE { WillBeHeapSupplement<Screen>::trace(visitor); }
private:
explicit ScreenOrientation(Screen&);
- void lockOrientationAsync(blink::WebScreenOrientationLockType);
- void orientationLockTimerFired(Timer<ScreenOrientation>*);
-
static const char* supplementName();
Document* document() const;
-
- Timer<ScreenOrientation> m_orientationLockTimer;
- blink::WebScreenOrientationLockType m_prospectiveLock;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698