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

Unified Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp

Issue 1621923002: [DevTools] Remove InspectorState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 11 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: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp
index 1ee8add57b554f04aaf00f82f8d41717eebf1118..862aa667bcae083e1b958c353646a104de8cde07 100644
--- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp
+++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationInspectorAgent.cpp
@@ -6,7 +6,6 @@
#include "core/InspectorTypeBuilder.h"
#include "core/frame/LocalFrame.h"
-#include "core/inspector/InspectorState.h"
#include "modules/screen_orientation/ScreenOrientation.h"
#include "modules/screen_orientation/ScreenOrientationController.h"
@@ -74,8 +73,8 @@ void ScreenOrientationInspectorAgent::setScreenOrientationOverride(ErrorString*
return;
}
m_state->setBoolean(ScreenOrientationInspectorAgentState::overrideEnabled, true);
- m_state->setLong(ScreenOrientationInspectorAgentState::angle, angle);
- m_state->setLong(ScreenOrientationInspectorAgentState::type, type);
+ m_state->setNumber(ScreenOrientationInspectorAgentState::angle, angle);
+ m_state->setNumber(ScreenOrientationInspectorAgentState::type, type);
controller->setOverride(type, angle);
}
@@ -99,9 +98,12 @@ void ScreenOrientationInspectorAgent::disable(ErrorString*)
void ScreenOrientationInspectorAgent::restore()
{
- if (m_state->getBoolean(ScreenOrientationInspectorAgentState::overrideEnabled)) {
- WebScreenOrientationType type = static_cast<WebScreenOrientationType>(m_state->getLong(ScreenOrientationInspectorAgentState::type));
- int angle = m_state->getLong(ScreenOrientationInspectorAgentState::angle);
+ if (m_state->booleanProperty(ScreenOrientationInspectorAgentState::overrideEnabled, false)) {
+ long longType = static_cast<long>(WebScreenOrientationUndefined);
+ m_state->getNumber(ScreenOrientationInspectorAgentState::type, &longType);
+ WebScreenOrientationType type = static_cast<WebScreenOrientationType>(longType);
+ int angle = 0;
+ m_state->getNumber(ScreenOrientationInspectorAgentState::angle, &angle);
if (ScreenOrientationController* controller = ScreenOrientationController::from(*m_frame))
controller->setOverride(type, angle);
}

Powered by Google App Engine
This is Rietveld 408576698