| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/v8_inspector/InjectedScriptHost.h" | 31 #include "platform/v8_inspector/InjectedScriptHost.h" |
| 32 | 32 |
| 33 #include "platform/JSONValues.h" | 33 #include "platform/inspector_protocol/Values.h" |
| 34 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 34 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 35 #include "platform/v8_inspector/public/V8Debugger.h" | 35 #include "platform/v8_inspector/public/V8Debugger.h" |
| 36 | 36 |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 #include "wtf/text/StringBuilder.h" | 38 #include "wtf/text/StringBuilder.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 PassRefPtr<InjectedScriptHost> InjectedScriptHost::create(V8DebuggerImpl* debugg
er) | 42 PassRefPtr<InjectedScriptHost> InjectedScriptHost::create(V8DebuggerImpl* debugg
er) |
| 43 { | 43 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 | 68 |
| 69 void InjectedScriptHost::disconnect() | 69 void InjectedScriptHost::disconnect() |
| 70 { | 70 { |
| 71 m_debugger = nullptr; | 71 m_debugger = nullptr; |
| 72 m_debuggerAgent = nullptr; | 72 m_debuggerAgent = nullptr; |
| 73 m_inspectCallback = nullptr; | 73 m_inspectCallback = nullptr; |
| 74 m_clearConsoleCallback = nullptr; | 74 m_clearConsoleCallback = nullptr; |
| 75 m_inspectedObjects.clear(); | 75 m_inspectedObjects.clear(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void InjectedScriptHost::inspectImpl(PassRefPtr<JSONValue> object, PassRefPtr<JS
ONValue> hints) | 78 void InjectedScriptHost::inspectImpl(PassRefPtr<protocol::Value> object, PassRef
Ptr<protocol::Value> hints) |
| 79 { | 79 { |
| 80 if (m_inspectCallback) { | 80 if (m_inspectCallback) { |
| 81 protocol::ErrorSupport errors; | 81 protocol::ErrorSupport errors; |
| 82 OwnPtr<protocol::Runtime::RemoteObject> remoteObject = protocol::Runtime
::RemoteObject::parse(object, &errors); | 82 OwnPtr<protocol::Runtime::RemoteObject> remoteObject = protocol::Runtime
::RemoteObject::parse(object, &errors); |
| 83 (*m_inspectCallback)(remoteObject.release(), JSONObject::cast(hints)); | 83 (*m_inspectCallback)(remoteObject.release(), protocol::DictionaryValue::
cast(hints)); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void InjectedScriptHost::clearConsoleMessages() | 87 void InjectedScriptHost::clearConsoleMessages() |
| 88 { | 88 { |
| 89 if (m_clearConsoleCallback) | 89 if (m_clearConsoleCallback) |
| 90 (*m_clearConsoleCallback)(); | 90 (*m_clearConsoleCallback)(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void InjectedScriptHost::addInspectedObject(PassOwnPtr<V8RuntimeAgent::Inspectab
le> object) | 93 void InjectedScriptHost::addInspectedObject(PassOwnPtr<V8RuntimeAgent::Inspectab
le> object) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 m_debuggerAgent->setBreakpointAt(scriptId, lineNumber, columnNumber, V8D
ebuggerAgentImpl::MonitorCommandBreakpointSource, builder.toString()); | 134 m_debuggerAgent->setBreakpointAt(scriptId, lineNumber, columnNumber, V8D
ebuggerAgentImpl::MonitorCommandBreakpointSource, builder.toString()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void InjectedScriptHost::unmonitorFunction(const String& scriptId, int lineNumbe
r, int columnNumber) | 137 void InjectedScriptHost::unmonitorFunction(const String& scriptId, int lineNumbe
r, int columnNumber) |
| 138 { | 138 { |
| 139 if (m_debuggerAgent) | 139 if (m_debuggerAgent) |
| 140 m_debuggerAgent->removeBreakpointAt(scriptId, lineNumber, columnNumber,
V8DebuggerAgentImpl::MonitorCommandBreakpointSource); | 140 m_debuggerAgent->removeBreakpointAt(scriptId, lineNumber, columnNumber,
V8DebuggerAgentImpl::MonitorCommandBreakpointSource); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |