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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp

Issue 2001893002: DevTools: expose raw pointers in protocol collections, s/ASSERT/DCHECK/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/v8_inspector/V8InspectorSessionImpl.h" 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h"
6 6
7 #include "platform/v8_inspector/InjectedScript.h" 7 #include "platform/v8_inspector/InjectedScript.h"
8 #include "platform/v8_inspector/InspectedContext.h" 8 #include "platform/v8_inspector/InspectedContext.h"
9 #include "platform/v8_inspector/RemoteObjectId.h" 9 #include "platform/v8_inspector/RemoteObjectId.h"
10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 { 196 {
197 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_ contextGroupId); 197 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_ contextGroupId);
198 if (!contexts) 198 if (!contexts)
199 return; 199 return;
200 for (auto& idContext : *contexts) 200 for (auto& idContext : *contexts)
201 agent->reportExecutionContextCreated(idContext.second); 201 agent->reportExecutionContextCreated(idContext.second);
202 } 202 }
203 203
204 void V8InspectorSessionImpl::changeInstrumentationCounter(int delta) 204 void V8InspectorSessionImpl::changeInstrumentationCounter(int delta)
205 { 205 {
206 ASSERT(m_instrumentationCounter + delta >= 0); 206 DCHECK_GE(m_instrumentationCounter + delta, 0);
207 if (!m_instrumentationCounter && m_client) 207 if (!m_instrumentationCounter && m_client)
208 m_client->startInstrumenting(); 208 m_client->startInstrumenting();
209 m_instrumentationCounter += delta; 209 m_instrumentationCounter += delta;
210 if (!m_instrumentationCounter && m_client) 210 if (!m_instrumentationCounter && m_client)
211 m_client->stopInstrumenting(); 211 m_client->stopInstrumenting();
212 } 212 }
213 213
214 void V8InspectorSessionImpl::addInspectedObject(PassOwnPtr<V8InspectorSession::I nspectable> inspectable) 214 void V8InspectorSessionImpl::addInspectedObject(PassOwnPtr<V8InspectorSession::I nspectable> inspectable)
215 { 215 {
216 m_inspectedObjects.prepend(std::move(inspectable)); 216 m_inspectedObjects.prepend(std::move(inspectable));
217 while (m_inspectedObjects.size() > kInspectedObjectBufferSize) 217 while (m_inspectedObjects.size() > kInspectedObjectBufferSize)
218 m_inspectedObjects.removeLast(); 218 m_inspectedObjects.removeLast();
219 } 219 }
220 220
221 V8InspectorSession::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigne d num) 221 V8InspectorSession::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigne d num)
222 { 222 {
223 if (num >= m_inspectedObjects.size()) 223 if (num >= m_inspectedObjects.size())
224 return nullptr; 224 return nullptr;
225 return m_inspectedObjects[num].get(); 225 return m_inspectedObjects[num];
226 } 226 }
227 227
228 void V8InspectorSessionImpl::schedulePauseOnNextStatement(const String16& breakR eason, PassOwnPtr<protocol::DictionaryValue> data) 228 void V8InspectorSessionImpl::schedulePauseOnNextStatement(const String16& breakR eason, PassOwnPtr<protocol::DictionaryValue> data)
229 { 229 {
230 m_debuggerAgent->schedulePauseOnNextStatement(breakReason, std::move(data)); 230 m_debuggerAgent->schedulePauseOnNextStatement(breakReason, std::move(data));
231 } 231 }
232 232
233 void V8InspectorSessionImpl::cancelPauseOnNextStatement() 233 void V8InspectorSessionImpl::cancelPauseOnNextStatement()
234 { 234 {
235 m_debuggerAgent->cancelPauseOnNextStatement(); 235 m_debuggerAgent->cancelPauseOnNextStatement();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 { 270 {
271 m_debuggerAgent->asyncTaskFinished(task); 271 m_debuggerAgent->asyncTaskFinished(task);
272 } 272 }
273 273
274 void V8InspectorSessionImpl::allAsyncTasksCanceled() 274 void V8InspectorSessionImpl::allAsyncTasksCanceled()
275 { 275 {
276 m_debuggerAgent->allAsyncTasksCanceled(); 276 m_debuggerAgent->allAsyncTasksCanceled();
277 } 277 }
278 278
279 } // namespace blink 279 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698