| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/InjectedScript.h" | 7 #include "platform/v8_inspector/InjectedScript.h" |
| 8 #include "platform/v8_inspector/InjectedScriptHost.h" | 8 #include "platform/v8_inspector/InjectedScriptHost.h" |
| 9 #include "platform/v8_inspector/InspectedContext.h" | 9 #include "platform/v8_inspector/InspectedContext.h" |
| 10 #include "platform/v8_inspector/RemoteObjectId.h" | 10 #include "platform/v8_inspector/RemoteObjectId.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 void V8InspectorSessionImpl::reset() | 64 void V8InspectorSessionImpl::reset() |
| 65 { | 65 { |
| 66 m_debuggerAgent->reset(); | 66 m_debuggerAgent->reset(); |
| 67 m_runtimeAgent->reset(); | 67 m_runtimeAgent->reset(); |
| 68 discardInjectedScripts(); | 68 discardInjectedScripts(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void V8InspectorSessionImpl::discardInjectedScripts() | 71 void V8InspectorSessionImpl::discardInjectedScripts() |
| 72 { | 72 { |
| 73 m_injectedScriptHost->clearInspectedObjects(); | |
| 74 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); | 73 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); |
| 75 if (!contexts) | 74 if (!contexts) |
| 76 return; | 75 return; |
| 77 | 76 |
| 78 protocol::Vector<int> keys; | 77 protocol::Vector<int> keys; |
| 79 for (auto& idContext : *contexts) | 78 for (auto& idContext : *contexts) |
| 80 keys.append(idContext.first); | 79 keys.append(idContext.first); |
| 81 for (auto& key : keys) { | 80 for (auto& key : keys) { |
| 82 contexts = m_debugger->contextGroup(m_contextGroupId); | 81 contexts = m_debugger->contextGroup(m_contextGroupId); |
| 83 if (contexts && contexts->contains(key)) | 82 if (contexts && contexts->contains(key)) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 109 context->getInjectedScript()->setCustomObjectFormatterEnabled(true); | 108 context->getInjectedScript()->setCustomObjectFormatterEnabled(true); |
| 110 } | 109 } |
| 111 return context->getInjectedScript(); | 110 return context->getInjectedScript(); |
| 112 } | 111 } |
| 113 | 112 |
| 114 InjectedScript* V8InspectorSessionImpl::findInjectedScript(ErrorString* errorStr
ing, RemoteObjectIdBase* objectId) | 113 InjectedScript* V8InspectorSessionImpl::findInjectedScript(ErrorString* errorStr
ing, RemoteObjectIdBase* objectId) |
| 115 { | 114 { |
| 116 return objectId ? findInjectedScript(errorString, objectId->contextId()) : n
ullptr; | 115 return objectId ? findInjectedScript(errorString, objectId->contextId()) : n
ullptr; |
| 117 } | 116 } |
| 118 | 117 |
| 119 void V8InspectorSessionImpl::addInspectedObject(PassOwnPtr<V8RuntimeAgent::Inspe
ctable> inspectable) | |
| 120 { | |
| 121 m_injectedScriptHost->addInspectedObject(inspectable); | |
| 122 } | |
| 123 | |
| 124 void V8InspectorSessionImpl::releaseObjectGroup(const String16& objectGroup) | 118 void V8InspectorSessionImpl::releaseObjectGroup(const String16& objectGroup) |
| 125 { | 119 { |
| 126 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); | 120 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); |
| 127 if (!contexts) | 121 if (!contexts) |
| 128 return; | 122 return; |
| 129 | 123 |
| 130 protocol::Vector<int> keys; | 124 protocol::Vector<int> keys; |
| 131 for (auto& idContext : *contexts) | 125 for (auto& idContext : *contexts) |
| 132 keys.append(idContext.first); | 126 keys.append(idContext.first); |
| 133 for (auto& key : keys) { | 127 for (auto& key : keys) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 156 void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) | 150 void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) |
| 157 { | 151 { |
| 158 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); | 152 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); |
| 159 if (!contexts) | 153 if (!contexts) |
| 160 return; | 154 return; |
| 161 for (auto& idContext : *contexts) | 155 for (auto& idContext : *contexts) |
| 162 agent->reportExecutionContextCreated(idContext.second); | 156 agent->reportExecutionContextCreated(idContext.second); |
| 163 } | 157 } |
| 164 | 158 |
| 165 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |