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

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: review commenst 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..1091cdb224e11d9e0cc04593744091375c632c2e 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.h
+++ b/Source/modules/screen_orientation/ScreenOrientation.h
@@ -10,13 +10,15 @@
#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 ScriptPromise;
+class ScriptState;
class Screen;
class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty {
@@ -26,22 +28,19 @@ public:
virtual ~ScreenOrientation();
static const AtomicString& orientation(Screen&);
- static bool lockOrientation(Screen&, const AtomicString& orientation, ExceptionState&);
+ static ScriptPromise lockOrientation(ScriptState*, 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
« no previous file with comments | « Source/modules/screen_orientation/LockOrientationCallback.cpp ('k') | Source/modules/screen_orientation/ScreenOrientation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698