| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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/inspector_protocol/Parser.h" |
| 33 #include "platform/inspector_protocol/Values.h" | 34 #include "platform/inspector_protocol/Values.h" |
| 34 #include "platform/v8_inspector/InjectedScript.h" | 35 #include "platform/v8_inspector/InjectedScript.h" |
| 35 #include "platform/v8_inspector/InspectedContext.h" | 36 #include "platform/v8_inspector/InspectedContext.h" |
| 36 #include "platform/v8_inspector/RemoteObjectId.h" | 37 #include "platform/v8_inspector/RemoteObjectId.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/V8InspectorImpl.h" | 40 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 40 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 41 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 41 #include "platform/v8_inspector/V8StackTraceImpl.h" | 42 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 42 #include "platform/v8_inspector/V8StringUtil.h" | 43 #include "platform/v8_inspector/V8StringUtil.h" |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 643 } |
| 643 } | 644 } |
| 644 | 645 |
| 645 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) | 646 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) |
| 646 { | 647 { |
| 647 if (!m_enabled) | 648 if (!m_enabled) |
| 648 return; | 649 return; |
| 649 context->setReported(true); | 650 context->setReported(true); |
| 650 std::unique_ptr<protocol::Runtime::ExecutionContextDescription> description
= protocol::Runtime::ExecutionContextDescription::create() | 651 std::unique_ptr<protocol::Runtime::ExecutionContextDescription> description
= protocol::Runtime::ExecutionContextDescription::create() |
| 651 .setId(context->contextId()) | 652 .setId(context->contextId()) |
| 652 .setIsDefault(context->isDefault()) | |
| 653 .setName(context->humanReadableName()) | 653 .setName(context->humanReadableName()) |
| 654 .setOrigin(context->origin()) | 654 .setOrigin(context->origin()).build(); |
| 655 .setFrameId(context->frameId()).build(); | 655 if (!context->auxData().isEmpty()) |
| 656 description->setAuxData(protocol::DictionaryValue::cast(parseJSON(contex
t->auxData()))); |
| 656 m_frontend.executionContextCreated(std::move(description)); | 657 m_frontend.executionContextCreated(std::move(description)); |
| 657 } | 658 } |
| 658 | 659 |
| 659 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(InspectedContext* conte
xt) | 660 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(InspectedContext* conte
xt) |
| 660 { | 661 { |
| 661 if (m_enabled && context->isReported()) { | 662 if (m_enabled && context->isReported()) { |
| 662 context->setReported(false); | 663 context->setReported(false); |
| 663 m_frontend.executionContextDestroyed(context->contextId()); | 664 m_frontend.executionContextDestroyed(context->contextId()); |
| 664 } | 665 } |
| 665 } | 666 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 676 reportMessage(message, true); | 677 reportMessage(message, true); |
| 677 } | 678 } |
| 678 | 679 |
| 679 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) | 680 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) |
| 680 { | 681 { |
| 681 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 682 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
| 682 m_frontend.flush(); | 683 m_frontend.flush(); |
| 683 } | 684 } |
| 684 | 685 |
| 685 } // namespace blink | 686 } // namespace blink |
| OLD | NEW |