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 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" | 31 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" |
32 | 32 |
33 #include "platform/v8_inspector/InjectedScript.h" | 33 #include "platform/v8_inspector/InjectedScript.h" |
34 #include "platform/v8_inspector/InspectedContext.h" | 34 #include "platform/v8_inspector/InspectedContext.h" |
35 #include "platform/v8_inspector/RemoteObjectId.h" | 35 #include "platform/v8_inspector/RemoteObjectId.h" |
| 36 #include "platform/v8_inspector/StringUtil.h" |
36 #include "platform/v8_inspector/V8Compat.h" | 37 #include "platform/v8_inspector/V8Compat.h" |
37 #include "platform/v8_inspector/V8ConsoleMessage.h" | 38 #include "platform/v8_inspector/V8ConsoleMessage.h" |
38 #include "platform/v8_inspector/V8Debugger.h" | 39 #include "platform/v8_inspector/V8Debugger.h" |
39 #include "platform/v8_inspector/V8DebuggerAgentImpl.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/protocol/Protocol.h" |
44 #include "platform/v8_inspector/public/V8InspectorClient.h" | 45 #include "platform/v8_inspector/public/V8InspectorClient.h" |
45 | 46 |
46 namespace v8_inspector { | 47 namespace v8_inspector { |
47 | 48 |
48 namespace V8RuntimeAgentImplState { | 49 namespace V8RuntimeAgentImplState { |
49 static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled
"; | 50 static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled
"; |
50 static const char runtimeEnabled[] = "runtimeEnabled"; | 51 static const char runtimeEnabled[] = "runtimeEnabled"; |
51 }; | 52 }; |
52 | 53 |
53 using protocol::Runtime::RemoteObject; | 54 using protocol::Runtime::RemoteObject; |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) | 648 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) |
648 { | 649 { |
649 if (!m_enabled) | 650 if (!m_enabled) |
650 return; | 651 return; |
651 context->setReported(true); | 652 context->setReported(true); |
652 std::unique_ptr<protocol::Runtime::ExecutionContextDescription> description
= protocol::Runtime::ExecutionContextDescription::create() | 653 std::unique_ptr<protocol::Runtime::ExecutionContextDescription> description
= protocol::Runtime::ExecutionContextDescription::create() |
653 .setId(context->contextId()) | 654 .setId(context->contextId()) |
654 .setName(context->humanReadableName()) | 655 .setName(context->humanReadableName()) |
655 .setOrigin(context->origin()).build(); | 656 .setOrigin(context->origin()).build(); |
656 if (!context->auxData().isEmpty()) | 657 if (!context->auxData().isEmpty()) |
657 description->setAuxData(protocol::DictionaryValue::cast(parseJSON(contex
t->auxData()))); | 658 description->setAuxData(protocol::DictionaryValue::cast(protocol::parseJ
SON(context->auxData()))); |
658 m_frontend.executionContextCreated(std::move(description)); | 659 m_frontend.executionContextCreated(std::move(description)); |
659 } | 660 } |
660 | 661 |
661 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(InspectedContext* conte
xt) | 662 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(InspectedContext* conte
xt) |
662 { | 663 { |
663 if (m_enabled && context->isReported()) { | 664 if (m_enabled && context->isReported()) { |
664 context->setReported(false); | 665 context->setReported(false); |
665 m_frontend.executionContextDestroyed(context->contextId()); | 666 m_frontend.executionContextDestroyed(context->contextId()); |
666 } | 667 } |
667 } | 668 } |
(...skipping 10 matching lines...) Expand all Loading... |
678 reportMessage(message, true); | 679 reportMessage(message, true); |
679 } | 680 } |
680 | 681 |
681 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) | 682 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) |
682 { | 683 { |
683 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 684 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
684 m_frontend.flush(); | 685 m_frontend.flush(); |
685 } | 686 } |
686 | 687 |
687 } // namespace v8_inspector | 688 } // namespace v8_inspector |
OLD | NEW |