| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LockOrientationCallback_h | 5 #ifndef LockOrientationCallback_h |
| 6 #define LockOrientationCallback_h | 6 #define LockOrientationCallback_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" |
| 8 #include "public/platform/WebLockOrientationCallback.h" | 9 #include "public/platform/WebLockOrientationCallback.h" |
| 9 #include "public/platform/WebScreenOrientationType.h" | 10 #include "public/platform/WebScreenOrientationType.h" |
| 10 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 11 #include "wtf/PassRefPtr.h" | 12 #include "wtf/PassRefPtr.h" |
| 12 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class ScriptPromiseResolver; | 17 class ScriptPromiseResolver; |
| 17 | 18 |
| 18 // LockOrientationCallback is an implementation of WebLockOrientationCallback | 19 // LockOrientationCallback is an implementation of WebLockOrientationCallback |
| 19 // that will resolve the underlying promise depending on the result passed to | 20 // that will resolve the underlying promise depending on the result passed to |
| 20 // the callback. | 21 // the callback. |
| 21 class LockOrientationCallback final : public WebLockOrientationCallback { | 22 class LockOrientationCallback final : public WebLockOrientationCallback { |
| 22 WTF_MAKE_NONCOPYABLE(LockOrientationCallback); | 23 WTF_MAKE_NONCOPYABLE(LockOrientationCallback); |
| 23 public: | 24 public: |
| 24 explicit LockOrientationCallback(PassRefPtr<ScriptPromiseResolver>); | 25 explicit LockOrientationCallback(PassRefPtrWillBeRawPtr<ScriptPromiseResolve
r>); |
| 25 virtual ~LockOrientationCallback(); | 26 virtual ~LockOrientationCallback(); |
| 26 | 27 |
| 27 virtual void onSuccess() override; | 28 virtual void onSuccess() override; |
| 28 virtual void onError(WebLockOrientationError) override; | 29 virtual void onError(WebLockOrientationError) override; |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 RefPtr<ScriptPromiseResolver> m_resolver; | 32 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 } // namespace blink | 35 } // namespace blink |
| 35 | 36 |
| 36 #endif // LockOrientationCallback_h | 37 #endif // LockOrientationCallback_h |
| OLD | NEW |