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

Side by Side Diff: src/inspector/v8-inspector-impl.cc

Issue 2896303004: [inspector] Move SetIdle from CPUProfiler to debug-interface (Closed)
Patch Set: rebased Created 3 years, 6 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 | « src/debug/debug-interface.h ('k') | src/inspector/v8-profiler-agent-impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 void V8InspectorImpl::resetContextGroup(int contextGroupId) { 223 void V8InspectorImpl::resetContextGroup(int contextGroupId) {
224 m_consoleStorageMap.erase(contextGroupId); 224 m_consoleStorageMap.erase(contextGroupId);
225 m_muteExceptionsMap.erase(contextGroupId); 225 m_muteExceptionsMap.erase(contextGroupId);
226 SessionMap::iterator session = m_sessions.find(contextGroupId); 226 SessionMap::iterator session = m_sessions.find(contextGroupId);
227 if (session != m_sessions.end()) session->second->reset(); 227 if (session != m_sessions.end()) session->second->reset();
228 m_contexts.erase(contextGroupId); 228 m_contexts.erase(contextGroupId);
229 m_debugger->wasmTranslation()->Clear(); 229 m_debugger->wasmTranslation()->Clear();
230 } 230 }
231 231
232 void V8InspectorImpl::idleStarted() { 232 void V8InspectorImpl::idleStarted() { v8::debug::SetIdle(m_isolate, true); }
233 for (auto it = m_sessions.begin(); it != m_sessions.end(); ++it) {
234 if (it->second->profilerAgent()->idleStarted()) return;
235 }
236 }
237 233
238 void V8InspectorImpl::idleFinished() { 234 void V8InspectorImpl::idleFinished() { v8::debug::SetIdle(m_isolate, false); }
239 for (auto it = m_sessions.begin(); it != m_sessions.end(); ++it) {
240 if (it->second->profilerAgent()->idleFinished()) return;
241 }
242 }
243 235
244 unsigned V8InspectorImpl::exceptionThrown( 236 unsigned V8InspectorImpl::exceptionThrown(
245 v8::Local<v8::Context> context, const StringView& message, 237 v8::Local<v8::Context> context, const StringView& message,
246 v8::Local<v8::Value> exception, const StringView& detailedMessage, 238 v8::Local<v8::Value> exception, const StringView& detailedMessage,
247 const StringView& url, unsigned lineNumber, unsigned columnNumber, 239 const StringView& url, unsigned lineNumber, unsigned columnNumber,
248 std::unique_ptr<V8StackTrace> stackTrace, int scriptId) { 240 std::unique_ptr<V8StackTrace> stackTrace, int scriptId) {
249 int groupId = contextGroupId(context); 241 int groupId = contextGroupId(context);
250 if (!groupId || m_muteExceptionsMap[groupId]) return 0; 242 if (!groupId || m_muteExceptionsMap[groupId]) return 0;
251 std::unique_ptr<V8StackTraceImpl> stackTraceImpl( 243 std::unique_ptr<V8StackTraceImpl> stackTraceImpl(
252 static_cast<V8StackTraceImpl*>(stackTrace.release())); 244 static_cast<V8StackTraceImpl*>(stackTrace.release()));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // Retrieve by ids each time since |callback| may destroy some contexts. 332 // Retrieve by ids each time since |callback| may destroy some contexts.
341 for (auto& contextId : ids) { 333 for (auto& contextId : ids) {
342 it = m_contexts.find(contextGroupId); 334 it = m_contexts.find(contextGroupId);
343 if (it == m_contexts.end()) continue; 335 if (it == m_contexts.end()) continue;
344 auto contextIt = it->second->find(contextId); 336 auto contextIt = it->second->find(contextId);
345 if (contextIt != it->second->end()) callback(contextIt->second.get()); 337 if (contextIt != it->second->end()) callback(contextIt->second.get());
346 } 338 }
347 } 339 }
348 340
349 } // namespace v8_inspector 341 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/debug/debug-interface.h ('k') | src/inspector/v8-profiler-agent-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698