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

Unified Diff: content/renderer/screen_orientation/mock_screen_orientation_controller.h

Issue 300063012: Make async methods UpdateLock() and ResetLock() in MockScreenOrientationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang build. 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: content/renderer/screen_orientation/mock_screen_orientation_controller.h
diff --git a/content/renderer/screen_orientation/mock_screen_orientation_controller.h b/content/renderer/screen_orientation/mock_screen_orientation_controller.h
index 330195c94be0fc358fdb93085e17277089f204f4..829561bb7451ba91b782717c19773df3eaec48dd 100644
--- a/content/renderer/screen_orientation/mock_screen_orientation_controller.h
+++ b/content/renderer/screen_orientation/mock_screen_orientation_controller.h
@@ -5,7 +5,9 @@
#ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
#define CONTENT_RENDERER_SCREEN_ORIENTATION_MOCK_SCREEN_ORIENTATION_CONTROLLER_H_
+#include "base/lazy_instance.h"
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
@@ -15,7 +17,8 @@ class WebScreenOrientationListener;
namespace content {
-class MockScreenOrientationController {
+class MockScreenOrientationController
+ : public base::RefCountedThreadSafe<MockScreenOrientationController> {
public:
MockScreenOrientationController();
@@ -26,6 +29,11 @@ class MockScreenOrientationController {
void UpdateDeviceOrientation(blink::WebScreenOrientationType);
private:
+ // Private destructor to make clang compiler checks happy.
+ ~MockScreenOrientationController() { }
mlamouri (slow - plz ping) 2014/05/28 13:23:24 Please, make the dtor virtual, remove the comment
ostap 2014/05/28 14:40:21 Done.
+
+ void UpdateLockSync(blink::WebScreenOrientationLockType);
+ void ResetLockSync();
void UpdateScreenOrientation(blink::WebScreenOrientationType);
bool IsOrientationAllowedByCurrentLock(blink::WebScreenOrientationType);
blink::WebScreenOrientationType SuitableOrientationForCurrentLock();
@@ -36,6 +44,8 @@ class MockScreenOrientationController {
blink::WebScreenOrientationListener* listener_;
DISALLOW_COPY_AND_ASSIGN(MockScreenOrientationController);
+ friend class base::LazyInstance<MockScreenOrientationController>;
+ friend class base::RefCountedThreadSafe<MockScreenOrientationController>;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698