diff options
author | mlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-23 09:53:17 +0000 |
---|---|---|
committer | mlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-23 09:53:17 +0000 |
commit | 30d7d441e8939ea4e482b14684f5a96669915ab9 (patch) | |
tree | 5c0d6433dc316005cf2eba7c24ff6552f07ce2b8 | |
parent | e753c05718e564bcaf0e365cf123186955b20ee6 (diff) | |
download | chromium_src-30d7d441e8939ea4e482b14684f5a96669915ab9.zip chromium_src-30d7d441e8939ea4e482b14684f5a96669915ab9.tar.gz chromium_src-30d7d441e8939ea4e482b14684f5a96669915ab9.tar.bz2 |
Use WebLockOrientationError instead of WebLockOrientationCallbackErrorType.
This is the Chromium side of https://codereview.chromium.org/332493003/
BUG=162827
TBR=jam@chromium.org (for content/common/DEPS)
Review URL: https://codereview.chromium.org/347553002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279073 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 21 insertions, 29 deletions
diff --git a/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc b/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc index 67174d0..8d6c604 100644 --- a/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc +++ b/content/browser/screen_orientation/screen_orientation_dispatcher_host.cc @@ -54,7 +54,7 @@ void ScreenOrientationDispatcherHost::OnLockRequest( render_frame_host->Send(new ScreenOrientationMsg_LockError( render_frame_host->GetRoutingID(), request_id, - blink::WebLockOrientationCallback::ErrorTypeNotAvailable)); + blink::WebLockOrientationErrorNotAvailable)); return; } diff --git a/content/common/DEPS b/content/common/DEPS index 388e1db..b4f22c9 100644 --- a/content/common/DEPS +++ b/content/common/DEPS @@ -21,7 +21,7 @@ include_rules = [ "+third_party/WebKit/public/platform/WebIDBCursor.h", "+third_party/WebKit/public/platform/WebIDBDatabase.h", "+third_party/WebKit/public/platform/WebIDBTypes.h", - "+third_party/WebKit/public/platform/WebLockOrientationCallback.h", + "+third_party/WebKit/public/platform/WebLockOrientationError.h", "+third_party/WebKit/public/platform/WebReferrerPolicy.h", "+third_party/WebKit/public/platform/WebScreenOrientationLockType.h", "+third_party/WebKit/public/platform/WebScreenOrientationType.h", diff --git a/content/common/screen_orientation_messages.h b/content/common/screen_orientation_messages.h index b7336d6..ea6640c 100644 --- a/content/common/screen_orientation_messages.h +++ b/content/common/screen_orientation_messages.h @@ -7,7 +7,7 @@ #include "content/common/content_export.h" #include "ipc/ipc_message_macros.h" -#include "third_party/WebKit/public/platform/WebLockOrientationCallback.h" +#include "third_party/WebKit/public/platform/WebLockOrientationError.h" #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" @@ -23,9 +23,9 @@ IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationLockType, blink::WebScreenOrientationLockDefault, blink::WebScreenOrientationLockPortrait) IPC_ENUM_TRAITS_MIN_MAX_VALUE( - blink::WebLockOrientationCallback::ErrorType, - blink::WebLockOrientationCallback::ErrorTypeNotAvailable, - blink::WebLockOrientationCallback::ErrorTypeCanceled) + blink::WebLockOrientationError, + blink::WebLockOrientationErrorNotAvailable, + blink::WebLockOrientationErrorCanceled) // The browser process informs the renderer process that the screen orientation // has changed. |orientation| contains the new screen orientation in degrees. @@ -48,7 +48,7 @@ IPC_MESSAGE_ROUTED3(ScreenOrientationMsg_LockSuccess, // process can associate the response to the right request. IPC_MESSAGE_ROUTED2(ScreenOrientationMsg_LockError, int, /* request_id */ - blink::WebLockOrientationCallback::ErrorType /* error */); + blink::WebLockOrientationError /* error */); // The renderer process requests the browser process to lock the screen // orientation to the specified |orientations|. The request contains a diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher.cc b/content/renderer/screen_orientation/screen_orientation_dispatcher.cc index e67cc73..7e5bcfc 100644 --- a/content/renderer/screen_orientation/screen_orientation_dispatcher.cc +++ b/content/renderer/screen_orientation/screen_orientation_dispatcher.cc @@ -44,8 +44,7 @@ void ScreenOrientationDispatcher::OnLockSuccess( } void ScreenOrientationDispatcher::OnLockError( - int request_id, - blink::WebLockOrientationCallback::ErrorType error) { + int request_id, blink::WebLockOrientationError error) { blink::WebLockOrientationCallback* callback = pending_callbacks_.Lookup(request_id); if (!callback) @@ -57,8 +56,7 @@ void ScreenOrientationDispatcher::OnLockError( void ScreenOrientationDispatcher::CancelPendingLocks() { for (CallbackMap::Iterator<blink::WebLockOrientationCallback> iterator(&pending_callbacks_); !iterator.IsAtEnd(); iterator.Advance()) { - iterator.GetCurrentValue()->onError( - blink::WebLockOrientationCallback::ErrorTypeCanceled); + iterator.GetCurrentValue()->onError(blink::WebLockOrientationErrorCanceled); pending_callbacks_.Remove(iterator.GetCurrentKey()); } } diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher.h b/content/renderer/screen_orientation/screen_orientation_dispatcher.h index d64fda1..bc17854 100644 --- a/content/renderer/screen_orientation/screen_orientation_dispatcher.h +++ b/content/renderer/screen_orientation/screen_orientation_dispatcher.h @@ -45,7 +45,7 @@ class CONTENT_EXPORT ScreenOrientationDispatcher : unsigned angle, blink::WebScreenOrientationType orientation); void OnLockError(int request_id, - blink::WebLockOrientationCallback::ErrorType error); + blink::WebLockOrientationError error); void CancelPendingLocks(); diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc b/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc index 461533e..cc5a7e8 100644 --- a/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc +++ b/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc @@ -34,7 +34,7 @@ class MockLockOrientationCallback : bool failed_; unsigned angle_; blink::WebScreenOrientationType orientation_; - blink::WebLockOrientationCallback::ErrorType error_; + blink::WebLockOrientationError error_; }; explicit MockLockOrientationCallback(LockOrientationResultHolder* results) @@ -47,8 +47,7 @@ class MockLockOrientationCallback : results_->orientation_ = orientation; } - virtual void onError( - blink::WebLockOrientationCallback::ErrorType error) { + virtual void onError(blink::WebLockOrientationError error) { results_->failed_ = true; results_->error_ = error; } @@ -124,8 +123,7 @@ TEST_F(ScreenOrientationDispatcherTest, CancelPending_Unlocking) { EXPECT_FALSE(callback_results.succeeded_); EXPECT_TRUE(callback_results.failed_); - EXPECT_EQ(blink::WebLockOrientationCallback::ErrorTypeCanceled, - callback_results.error_); + EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results.error_); } // Test that calling lockOrientation() twice cancel the first lockOrientation(). @@ -141,20 +139,19 @@ TEST_F(ScreenOrientationDispatcherTest, CancelPending_DoubleLock) { EXPECT_FALSE(callback_results.succeeded_); EXPECT_TRUE(callback_results.failed_); - EXPECT_EQ(blink::WebLockOrientationCallback::ErrorTypeCanceled, - callback_results.error_); + EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results.error_); } // Test that when a LockError message is received, the request is set as failed // with the correct values. TEST_F(ScreenOrientationDispatcherTest, LockRequest_Error) { - std::list<blink::WebLockOrientationCallback::ErrorType> errors; - errors.push_back(blink::WebLockOrientationCallback::ErrorTypeNotAvailable); + std::list<blink::WebLockOrientationError> errors; + errors.push_back(blink::WebLockOrientationErrorNotAvailable); errors.push_back( - blink::WebLockOrientationCallback::ErrorTypeFullScreenRequired); - errors.push_back(blink::WebLockOrientationCallback::ErrorTypeCanceled); + blink::WebLockOrientationErrorFullScreenRequired); + errors.push_back(blink::WebLockOrientationErrorCanceled); - for (std::list<blink::WebLockOrientationCallback::ErrorType>::const_iterator + for (std::list<blink::WebLockOrientationError>::const_iterator it = errors.begin(); it != errors.end(); ++it) { MockLockOrientationCallback::LockOrientationResultHolder callback_results; LockOrientation(blink::WebScreenOrientationLockPortraitPrimary, @@ -234,9 +231,7 @@ TEST_F(ScreenOrientationDispatcherTest, ErrorForUnknownRequest) { int request_id = GetFirstLockRequestIdFromSink(); OnMessageReceived(ScreenOrientationMsg_LockError( - routing_id(), - request_id + 1, - blink::WebLockOrientationCallback::ErrorTypeCanceled)); + routing_id(), request_id + 1, blink::WebLockOrientationErrorCanceled)); EXPECT_FALSE(callback_results.succeeded_); EXPECT_FALSE(callback_results.failed_); @@ -270,8 +265,7 @@ TEST_F(ScreenOrientationDispatcherTest, RaceScenario) { // First request is still rejected. EXPECT_FALSE(callback_results1.succeeded_); EXPECT_TRUE(callback_results1.failed_); - EXPECT_EQ(blink::WebLockOrientationCallback::ErrorTypeCanceled, - callback_results1.error_); + EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results1.error_); // Second request is still pending. EXPECT_FALSE(callback_results2.succeeded_); |