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

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

Issue 2407973002: 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 String16 emulatedMedia; 53 String16 emulatedMedia;
54 m_state->getString(EmulationAgentState::emulatedMedia, &emulatedMedia); 54 m_state->getString(EmulationAgentState::emulatedMedia, &emulatedMedia);
55 setEmulatedMedia(&error, emulatedMedia); 55 setEmulatedMedia(&error, emulatedMedia);
56 } 56 }
57 57
58 void InspectorEmulationAgent::disable(ErrorString*) 58 void InspectorEmulationAgent::disable(ErrorString*)
59 { 59 {
60 ErrorString error; 60 ErrorString error;
61 setScriptExecutionDisabled(&error, false); 61 setScriptExecutionDisabled(&error, false);
62 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>()); 62 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>());
63 setCPUThrottlingRate(&error, 1);
63 setEmulatedMedia(&error, String()); 64 setEmulatedMedia(&error, String());
64 } 65 }
65 66
66 void InspectorEmulationAgent::resetPageScaleFactor(ErrorString*) 67 void InspectorEmulationAgent::resetPageScaleFactor(ErrorString*)
67 { 68 {
68 webViewImpl()->resetScaleStateImmediately(); 69 webViewImpl()->resetScaleStateImmediately();
69 } 70 }
70 71
71 void InspectorEmulationAgent::setPageScaleFactor(ErrorString*, double pageScaleF actor) 72 void InspectorEmulationAgent::setPageScaleFactor(ErrorString*, double pageScaleF actor)
72 { 73 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 frontend()->virtualTimeBudgetExpired(); 121 frontend()->virtualTimeBudgetExpired();
121 } 122 }
122 123
123 DEFINE_TRACE(InspectorEmulationAgent) 124 DEFINE_TRACE(InspectorEmulationAgent)
124 { 125 {
125 visitor->trace(m_webLocalFrameImpl); 126 visitor->trace(m_webLocalFrameImpl);
126 InspectorBaseAgent::trace(visitor); 127 InspectorBaseAgent::trace(visitor);
127 } 128 }
128 129
129 } // namespace blink 130 } // 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