Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" | 31 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" |
| 32 | 32 |
| 33 #include "platform/inspector_protocol/Parser.h" | 33 #include "platform/inspector_protocol/Parser.h" |
| 34 #include "platform/inspector_protocol/Values.h" | 34 #include "platform/inspector_protocol/Values.h" |
| 35 #include "platform/v8_inspector/InjectedScript.h" | 35 #include "platform/v8_inspector/InjectedScript.h" |
| 36 #include "platform/v8_inspector/InspectedContext.h" | 36 #include "platform/v8_inspector/InspectedContext.h" |
| 37 #include "platform/v8_inspector/RemoteObjectId.h" | 37 #include "platform/v8_inspector/RemoteObjectId.h" |
| 38 #include "platform/v8_inspector/V8ConsoleMessage.h" | 38 #include "platform/v8_inspector/V8ConsoleMessage.h" |
| 39 #include "platform/v8_inspector/V8Debugger.h" | 39 #include "platform/v8_inspector/V8Debugger.h" |
| 40 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | |
| 40 #include "platform/v8_inspector/V8InspectorImpl.h" | 41 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 41 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 42 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 42 #include "platform/v8_inspector/V8StackTraceImpl.h" | 43 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 43 #include "platform/v8_inspector/V8StringUtil.h" | 44 #include "platform/v8_inspector/V8StringUtil.h" |
| 44 #include "platform/v8_inspector/public/V8InspectorClient.h" | 45 #include "platform/v8_inspector/public/V8InspectorClient.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 namespace V8RuntimeAgentImplState { | 49 namespace V8RuntimeAgentImplState { |
| 49 static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled "; | 50 static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled "; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 496 *errorString = "Runtime agent is not enabled"; | 497 *errorString = "Runtime agent is not enabled"; |
| 497 return; | 498 return; |
| 498 } | 499 } |
| 499 int contextId = ensureContext(errorString, m_inspector, m_session->contextGr oupId(), executionContextId); | 500 int contextId = ensureContext(errorString, m_inspector, m_session->contextGr oupId(), executionContextId); |
| 500 if (!errorString->isEmpty()) | 501 if (!errorString->isEmpty()) |
| 501 return; | 502 return; |
| 502 InjectedScript::ContextScope scope(errorString, m_inspector, m_session->cont extGroupId(), contextId); | 503 InjectedScript::ContextScope scope(errorString, m_inspector, m_session->cont extGroupId(), contextId); |
| 503 if (!scope.initialize()) | 504 if (!scope.initialize()) |
| 504 return; | 505 return; |
| 505 | 506 |
| 507 V8DebuggerAgentImpl* debuggerAgent = m_session->debuggerAgent(); | |
| 508 if (!persistScript) | |
| 509 debuggerAgent->setIgnoreScriptParsedEvents(true); | |
|
dgozman
2016/08/09 20:43:08
Remote the indirection, call into V8Debugger here.
lushnikov
2016/08/09 22:24:29
Done.
| |
| 506 v8::Local<v8::Script> script = m_inspector->compileScript(scope.context(), t oV8String(m_inspector->isolate(), expression), sourceURL, false); | 510 v8::Local<v8::Script> script = m_inspector->compileScript(scope.context(), t oV8String(m_inspector->isolate(), expression), sourceURL, false); |
| 511 if (!persistScript) | |
| 512 debuggerAgent->setIgnoreScriptParsedEvents(false); | |
| 507 if (script.IsEmpty()) { | 513 if (script.IsEmpty()) { |
| 508 v8::Local<v8::Message> message = scope.tryCatch().Message(); | 514 v8::Local<v8::Message> message = scope.tryCatch().Message(); |
| 509 if (!message.IsEmpty()) | 515 if (!message.IsEmpty()) |
| 510 *exceptionDetails = scope.injectedScript()->createExceptionDetails(m essage); | 516 *exceptionDetails = scope.injectedScript()->createExceptionDetails(m essage); |
| 511 else | 517 else |
| 512 *errorString = "Script compilation failed"; | 518 *errorString = "Script compilation failed"; |
| 513 return; | 519 return; |
| 514 } | 520 } |
| 515 | 521 |
| 516 if (!persistScript) | 522 if (!persistScript) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 677 reportMessage(message, true); | 683 reportMessage(message, true); |
| 678 } | 684 } |
| 679 | 685 |
| 680 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review) | 686 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review) |
| 681 { | 687 { |
| 682 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 688 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
| 683 m_frontend.flush(); | 689 m_frontend.flush(); |
| 684 } | 690 } |
| 685 | 691 |
| 686 } // namespace blink | 692 } // namespace blink |
| OLD | NEW |