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

Unified Diff: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp

Issue 1521113002: DevTools: Initial implementation of slow CPU emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 4 landing Created 5 years 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/web/InspectorEmulationAgent.cpp
diff --git a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
index b879e210a53ca61c8e4d99d71e29def99eb73e62..3d5a278c09603eadc23b81a57cea0da0ea9da65e 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -23,14 +23,15 @@ static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
static const char emulatedMedia[] = "emulatedMedia";
}
-PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> InspectorEmulationAgent::create(WebLocalFrameImpl* webLocalFrameImpl)
+PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> InspectorEmulationAgent::create(WebLocalFrameImpl* webLocalFrameImpl, Client* client)
{
- return adoptPtrWillBeNoop(new InspectorEmulationAgent(webLocalFrameImpl));
+ return adoptPtrWillBeNoop(new InspectorEmulationAgent(webLocalFrameImpl, client));
}
-InspectorEmulationAgent::InspectorEmulationAgent(WebLocalFrameImpl* webLocalFrameImpl)
+InspectorEmulationAgent::InspectorEmulationAgent(WebLocalFrameImpl* webLocalFrameImpl, Client* client)
: InspectorBaseAgent<InspectorEmulationAgent, InspectorFrontend::Emulation>("Emulation")
, m_webLocalFrameImpl(webLocalFrameImpl)
+ , m_client(client)
{
webViewImpl()->devToolsEmulator()->setEmulationAgent(this);
}
@@ -99,6 +100,11 @@ void InspectorEmulationAgent::setEmulatedMedia(ErrorString*, const String& media
webViewImpl()->page()->settings().setMediaTypeOverride(media);
}
+void InspectorEmulationAgent::setCPUThrottlingRate(ErrorString*, double throttlingRate)
+{
+ m_client->setCPUThrottlingRate(throttlingRate);
+}
+
void InspectorEmulationAgent::viewportChanged()
{
if (!webViewImpl()->devToolsEmulator()->deviceEmulationEnabled() || !frontend())
« no previous file with comments | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | third_party/WebKit/Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698