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

Side by Side Diff: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp

Issue 2399883005: DevTools: CPU throttling should disable when DevTools are closed. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "web/InspectorEmulationAgent.h" 5 #include "web/InspectorEmulationAgent.h"
6 6
7 #include "core/frame/FrameHost.h" 7 #include "core/frame/FrameHost.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/page/Page.h" 10 #include "core/page/Page.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 m_state->doubleProperty(EmulationAgentState::forcedViewportY, 0), 71 m_state->doubleProperty(EmulationAgentState::forcedViewportY, 0),
72 m_state->doubleProperty(EmulationAgentState::forcedViewportScale, 1)); 72 m_state->doubleProperty(EmulationAgentState::forcedViewportScale, 1));
73 } 73 }
74 } 74 }
75 75
76 void InspectorEmulationAgent::disable(ErrorString*) { 76 void InspectorEmulationAgent::disable(ErrorString*) {
77 ErrorString error; 77 ErrorString error;
78 setScriptExecutionDisabled(&error, false); 78 setScriptExecutionDisabled(&error, false);
79 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>()); 79 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>());
80 setEmulatedMedia(&error, String()); 80 setEmulatedMedia(&error, String());
81 setCPUThrottlingRate(&error, 1.);
dgozman 2016/10/08 00:37:36 I believe blink uses "1" in such cases :-)
alph 2016/10/08 00:40:43 thx
81 resetViewport(&error); 82 resetViewport(&error);
82 } 83 }
83 84
84 void InspectorEmulationAgent::forceViewport(ErrorString* error, 85 void InspectorEmulationAgent::forceViewport(ErrorString* error,
85 double x, 86 double x,
86 double y, 87 double y,
87 double scale) { 88 double scale) {
88 if (x < 0 || y < 0) { 89 if (x < 0 || y < 0) {
89 *error = "Coordinates must be non-negative"; 90 *error = "Coordinates must be non-negative";
90 return; 91 return;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 WebViewScheduler::VirtualTimePolicy::PAUSE); 175 WebViewScheduler::VirtualTimePolicy::PAUSE);
175 frontend()->virtualTimeBudgetExpired(); 176 frontend()->virtualTimeBudgetExpired();
176 } 177 }
177 178
178 DEFINE_TRACE(InspectorEmulationAgent) { 179 DEFINE_TRACE(InspectorEmulationAgent) {
179 visitor->trace(m_webLocalFrameImpl); 180 visitor->trace(m_webLocalFrameImpl);
180 InspectorBaseAgent::trace(visitor); 181 InspectorBaseAgent::trace(visitor);
181 } 182 }
182 183
183 } // namespace blink 184 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698