OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 { | 260 { |
261 m_session->client()->resumeStartup(); | 261 m_session->client()->resumeStartup(); |
262 } | 262 } |
263 | 263 |
264 void V8RuntimeAgentImpl::setCustomObjectFormatterEnabled(ErrorString*, bool enab
led) | 264 void V8RuntimeAgentImpl::setCustomObjectFormatterEnabled(ErrorString*, bool enab
led) |
265 { | 265 { |
266 m_state->setBoolean(V8RuntimeAgentImplState::customObjectFormatterEnabled, e
nabled); | 266 m_state->setBoolean(V8RuntimeAgentImplState::customObjectFormatterEnabled, e
nabled); |
267 m_session->setCustomObjectFormatterEnabled(enabled); | 267 m_session->setCustomObjectFormatterEnabled(enabled); |
268 } | 268 } |
269 | 269 |
| 270 void V8RuntimeAgentImpl::discardConsoleEntries(ErrorString*) |
| 271 { |
| 272 V8ConsoleMessageStorage* storage = m_session->debugger()->ensureConsoleMessa
geStorage(m_session->contextGroupId()); |
| 273 storage->clear(); |
| 274 } |
| 275 |
270 void V8RuntimeAgentImpl::compileScript(ErrorString* errorString, | 276 void V8RuntimeAgentImpl::compileScript(ErrorString* errorString, |
271 const String16& expression, | 277 const String16& expression, |
272 const String16& sourceURL, | 278 const String16& sourceURL, |
273 bool persistScript, | 279 bool persistScript, |
274 int executionContextId, | 280 int executionContextId, |
275 Maybe<String16>* scriptId, | 281 Maybe<String16>* scriptId, |
276 Maybe<ExceptionDetails>* exceptionDetails) | 282 Maybe<ExceptionDetails>* exceptionDetails) |
277 { | 283 { |
278 if (!m_enabled) { | 284 if (!m_enabled) { |
279 *errorString = "Runtime agent is not enabled"; | 285 *errorString = "Runtime agent is not enabled"; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 void V8RuntimeAgentImpl::enable(ErrorString* errorString) | 368 void V8RuntimeAgentImpl::enable(ErrorString* errorString) |
363 { | 369 { |
364 if (m_enabled) | 370 if (m_enabled) |
365 return; | 371 return; |
366 m_session->client()->runtimeEnabled(); | 372 m_session->client()->runtimeEnabled(); |
367 m_enabled = true; | 373 m_enabled = true; |
368 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); | 374 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); |
369 m_session->debugger()->enableStackCapturingIfNeeded(); | 375 m_session->debugger()->enableStackCapturingIfNeeded(); |
370 m_session->reportAllContexts(this); | 376 m_session->reportAllContexts(this); |
371 V8ConsoleMessageStorage* storage = m_session->debugger()->ensureConsoleMessa
geStorage(m_session->contextGroupId()); | 377 V8ConsoleMessageStorage* storage = m_session->debugger()->ensureConsoleMessa
geStorage(m_session->contextGroupId()); |
372 for (const auto& message : storage->messages()) { | 378 for (const auto& message : storage->messages()) |
373 if (message->origin() != V8MessageOrigin::kExternalConsole) | 379 reportMessage(message.get(), false); |
374 reportMessage(message.get(), false); | |
375 } | |
376 } | 380 } |
377 | 381 |
378 void V8RuntimeAgentImpl::disable(ErrorString* errorString) | 382 void V8RuntimeAgentImpl::disable(ErrorString* errorString) |
379 { | 383 { |
380 if (!m_enabled) | 384 if (!m_enabled) |
381 return; | 385 return; |
382 m_enabled = false; | 386 m_enabled = false; |
383 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); | 387 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); |
384 m_session->debugger()->disableStackCapturingIfNeeded(); | 388 m_session->debugger()->disableStackCapturingIfNeeded(); |
385 m_session->discardInjectedScripts(); | 389 m_session->discardInjectedScripts(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 432 } |
429 | 433 |
430 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) | 434 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) |
431 { | 435 { |
432 if (m_enabled) | 436 if (m_enabled) |
433 reportMessage(message, true); | 437 reportMessage(message, true); |
434 } | 438 } |
435 | 439 |
436 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) | 440 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) |
437 { | 441 { |
438 DCHECK(message->origin() != V8MessageOrigin::kExternalConsole); | |
439 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 442 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
440 m_frontend.flush(); | 443 m_frontend.flush(); |
441 } | 444 } |
442 | 445 |
443 } // namespace blink | 446 } // namespace blink |
OLD | NEW |