OLD | NEW |
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (storageIt == m_consoleStorageMap.end()) | 159 if (storageIt == m_consoleStorageMap.end()) |
160 storageIt = m_consoleStorageMap.insert(std::make_pair(contextGroupId, wr
apUnique(new V8ConsoleMessageStorage(this, contextGroupId)))).first; | 160 storageIt = m_consoleStorageMap.insert(std::make_pair(contextGroupId, wr
apUnique(new V8ConsoleMessageStorage(this, contextGroupId)))).first; |
161 return storageIt->second.get(); | 161 return storageIt->second.get(); |
162 } | 162 } |
163 | 163 |
164 std::unique_ptr<V8StackTrace> V8InspectorImpl::createStackTrace(v8::Local<v8::St
ackTrace> stackTrace) | 164 std::unique_ptr<V8StackTrace> V8InspectorImpl::createStackTrace(v8::Local<v8::St
ackTrace> stackTrace) |
165 { | 165 { |
166 return m_debugger->createStackTrace(stackTrace); | 166 return m_debugger->createStackTrace(stackTrace); |
167 } | 167 } |
168 | 168 |
169 std::unique_ptr<V8InspectorSession> V8InspectorImpl::connect(int contextGroupId,
protocol::FrontendChannel* channel, const String16* state) | 169 std::unique_ptr<V8InspectorSession> V8InspectorImpl::connect(int contextGroupId,
protocol::FrontendChannel* channel, const StringView& state) |
170 { | 170 { |
171 DCHECK(m_sessions.find(contextGroupId) == m_sessions.cend()); | 171 DCHECK(m_sessions.find(contextGroupId) == m_sessions.cend()); |
172 std::unique_ptr<V8InspectorSessionImpl> session = V8InspectorSessionImpl::cr
eate(this, contextGroupId, channel, state); | 172 std::unique_ptr<V8InspectorSessionImpl> session = V8InspectorSessionImpl::cr
eate(this, contextGroupId, channel, state); |
173 m_sessions[contextGroupId] = session.get(); | 173 m_sessions[contextGroupId] = session.get(); |
174 return std::move(session); | 174 return std::move(session); |
175 } | 175 } |
176 | 176 |
177 void V8InspectorImpl::disconnect(V8InspectorSessionImpl* session) | 177 void V8InspectorImpl::disconnect(V8InspectorSessionImpl* session) |
178 { | 178 { |
179 DCHECK(m_sessions.find(session->contextGroupId()) != m_sessions.end()); | 179 DCHECK(m_sessions.find(session->contextGroupId()) != m_sessions.end()); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void V8InspectorImpl::idleStarted() | 258 void V8InspectorImpl::idleStarted() |
259 { | 259 { |
260 m_isolate->GetCpuProfiler()->SetIdle(true); | 260 m_isolate->GetCpuProfiler()->SetIdle(true); |
261 } | 261 } |
262 | 262 |
263 void V8InspectorImpl::idleFinished() | 263 void V8InspectorImpl::idleFinished() |
264 { | 264 { |
265 m_isolate->GetCpuProfiler()->SetIdle(false); | 265 m_isolate->GetCpuProfiler()->SetIdle(false); |
266 } | 266 } |
267 | 267 |
268 unsigned V8InspectorImpl::exceptionThrown(v8::Local<v8::Context> context, const
String16& message, v8::Local<v8::Value> exception, const String16& detailedMessa
ge, const String16& url, unsigned lineNumber, unsigned columnNumber, std::unique
_ptr<V8StackTrace> stackTrace, int scriptId) | 268 unsigned V8InspectorImpl::exceptionThrown(v8::Local<v8::Context> context, const
StringView& message, v8::Local<v8::Value> exception, const StringView& detailedM
essage, const StringView& url, unsigned lineNumber, unsigned columnNumber, std::
unique_ptr<V8StackTrace> stackTrace, int scriptId) |
269 { | 269 { |
270 int contextGroupId = V8Debugger::getGroupId(context); | 270 int contextGroupId = V8Debugger::getGroupId(context); |
271 if (!contextGroupId || m_muteExceptionsMap[contextGroupId]) | 271 if (!contextGroupId || m_muteExceptionsMap[contextGroupId]) |
272 return 0; | 272 return 0; |
273 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8
StackTraceImpl*>(stackTrace.release())); | 273 std::unique_ptr<V8StackTraceImpl> stackTraceImpl = wrapUnique(static_cast<V8
StackTraceImpl*>(stackTrace.release())); |
274 unsigned exceptionId = nextExceptionId(); | 274 unsigned exceptionId = nextExceptionId(); |
275 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orException(m_client->currentTimeMS(), detailedMessage, url, lineNumber, columnN
umber, std::move(stackTraceImpl), scriptId, m_isolate, message, V8Debugger::cont
extId(context), exception, exceptionId); | 275 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orException(m_client->currentTimeMS(), toString16(detailedMessage), toString16(u
rl), lineNumber, columnNumber, std::move(stackTraceImpl), scriptId, m_isolate, t
oString16(message), V8Debugger::contextId(context), exception, exceptionId); |
276 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); | 276 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); |
277 return exceptionId; | 277 return exceptionId; |
278 } | 278 } |
279 | 279 |
280 void V8InspectorImpl::exceptionRevoked(v8::Local<v8::Context> context, unsigned
exceptionId, const String16& message) | 280 void V8InspectorImpl::exceptionRevoked(v8::Local<v8::Context> context, unsigned
exceptionId, const StringView& message) |
281 { | 281 { |
282 int contextGroupId = V8Debugger::getGroupId(context); | 282 int contextGroupId = V8Debugger::getGroupId(context); |
283 if (!contextGroupId) | 283 if (!contextGroupId) |
284 return; | 284 return; |
285 | 285 |
286 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orRevokedException(m_client->currentTimeMS(), message, exceptionId); | 286 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF
orRevokedException(m_client->currentTimeMS(), toString16(message), exceptionId); |
287 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); | 287 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes
sage)); |
288 } | 288 } |
289 | 289 |
290 std::unique_ptr<V8StackTrace> V8InspectorImpl::captureStackTrace(bool fullStack) | 290 std::unique_ptr<V8StackTrace> V8InspectorImpl::captureStackTrace(bool fullStack) |
291 { | 291 { |
292 return m_debugger->captureStackTrace(fullStack); | 292 return m_debugger->captureStackTrace(fullStack); |
293 } | 293 } |
294 | 294 |
295 void V8InspectorImpl::asyncTaskScheduled(const String16& taskName, void* task, b
ool recurring) | 295 void V8InspectorImpl::asyncTaskScheduled(const StringView& taskName, void* task,
bool recurring) |
296 { | 296 { |
297 m_debugger->asyncTaskScheduled(taskName, task, recurring); | 297 m_debugger->asyncTaskScheduled(taskName, task, recurring); |
298 } | 298 } |
299 | 299 |
300 void V8InspectorImpl::asyncTaskCanceled(void* task) | 300 void V8InspectorImpl::asyncTaskCanceled(void* task) |
301 { | 301 { |
302 m_debugger->asyncTaskCanceled(task); | 302 m_debugger->asyncTaskCanceled(task); |
303 } | 303 } |
304 | 304 |
305 void V8InspectorImpl::asyncTaskStarted(void* task) | 305 void V8InspectorImpl::asyncTaskStarted(void* task) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup(int contextGroup
Id) | 342 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup(int contextGroup
Id) |
343 { | 343 { |
344 if (!contextGroupId) | 344 if (!contextGroupId) |
345 return nullptr; | 345 return nullptr; |
346 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 346 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
347 return iter == m_sessions.end() ? nullptr : iter->second; | 347 return iter == m_sessions.end() ? nullptr : iter->second; |
348 } | 348 } |
349 | 349 |
350 } // namespace v8_inspector | 350 } // namespace v8_inspector |
OLD | NEW |