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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorProfilerAgent.cpp

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing 2 Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void InspectorProfilerAgent::restore() 79 void InspectorProfilerAgent::restore()
80 { 80 {
81 if (!m_state->booleanProperty(ProfilerAgentState::profilerEnabled, false)) 81 if (!m_state->booleanProperty(ProfilerAgentState::profilerEnabled, false))
82 return; 82 return;
83 m_v8ProfilerAgent->restore(); 83 m_v8ProfilerAgent->restore();
84 ErrorString errorString; 84 ErrorString errorString;
85 enable(&errorString); 85 enable(&errorString);
86 } 86 }
87 87
88 // Protocol implementation. 88 // Protocol implementation.
89 void InspectorProfilerAgent::consoleProfile(ExecutionContext* context, const Str ing& title) 89 void InspectorProfilerAgent::consoleProfile(ExecutionContext* context, const Str ing16& title)
90 { 90 {
91 UseCounter::count(context, UseCounter::DevToolsConsoleProfile); 91 UseCounter::count(context, UseCounter::DevToolsConsoleProfile);
92 m_v8ProfilerAgent->consoleProfile(title); 92 m_v8ProfilerAgent->consoleProfile(title);
93 } 93 }
94 94
95 void InspectorProfilerAgent::consoleProfileEnd(const String& title) 95 void InspectorProfilerAgent::consoleProfileEnd(const String16& title)
96 { 96 {
97 m_v8ProfilerAgent->consoleProfileEnd(title); 97 m_v8ProfilerAgent->consoleProfileEnd(title);
98 } 98 }
99 99
100 void InspectorProfilerAgent::enable(ErrorString* errorString) 100 void InspectorProfilerAgent::enable(ErrorString* errorString)
101 { 101 {
102 m_v8ProfilerAgent->enable(errorString); 102 m_v8ProfilerAgent->enable(errorString);
103 m_state->setBoolean(ProfilerAgentState::profilerEnabled, true); 103 m_state->setBoolean(ProfilerAgentState::profilerEnabled, true);
104 m_instrumentingAgents->setInspectorProfilerAgent(this); 104 m_instrumentingAgents->setInspectorProfilerAgent(this);
105 } 105 }
106 106
107 void InspectorProfilerAgent::disable(ErrorString* errorString) 107 void InspectorProfilerAgent::disable(ErrorString* errorString)
108 { 108 {
109 m_instrumentingAgents->setInspectorProfilerAgent(nullptr); 109 m_instrumentingAgents->setInspectorProfilerAgent(nullptr);
110 m_state->setBoolean(ProfilerAgentState::profilerEnabled, false); 110 m_state->setBoolean(ProfilerAgentState::profilerEnabled, false);
111 m_v8ProfilerAgent->disable(errorString); 111 m_v8ProfilerAgent->disable(errorString);
112 } 112 }
113 113
114 void InspectorProfilerAgent::setSamplingInterval(ErrorString* error, int interva l) 114 void InspectorProfilerAgent::setSamplingInterval(ErrorString* error, int interva l)
115 { 115 {
116 m_v8ProfilerAgent->setSamplingInterval(error, interval); 116 m_v8ProfilerAgent->setSamplingInterval(error, interval);
117 } 117 }
118 118
119 void InspectorProfilerAgent::start(ErrorString* error) 119 void InspectorProfilerAgent::start(ErrorString* error)
120 { 120 {
121 m_v8ProfilerAgent->start(error); 121 m_v8ProfilerAgent->start(error);
122 if (m_client && !*error) 122 if (m_client && error->isEmpty())
123 m_client->profilingStarted(); 123 m_client->profilingStarted();
124 } 124 }
125 125
126 void InspectorProfilerAgent::stop(ErrorString* errorString, OwnPtr<protocol::Pro filer::CPUProfile>* profile) 126 void InspectorProfilerAgent::stop(ErrorString* errorString, OwnPtr<protocol::Pro filer::CPUProfile>* profile)
127 { 127 {
128 if (m_client) 128 if (m_client)
129 m_client->profilingStopped(); 129 m_client->profilingStopped();
130 m_v8ProfilerAgent->stop(errorString, profile); 130 m_v8ProfilerAgent->stop(errorString, profile);
131 } 131 }
132 132
(...skipping 16 matching lines...) Expand all
149 { 149 {
150 m_v8ProfilerAgent->idleFinished(); 150 m_v8ProfilerAgent->idleFinished();
151 } 151 }
152 152
153 DEFINE_TRACE(InspectorProfilerAgent) 153 DEFINE_TRACE(InspectorProfilerAgent)
154 { 154 {
155 InspectorBaseAgent::trace(visitor); 155 InspectorBaseAgent::trace(visitor);
156 } 156 }
157 157
158 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698