| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-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 "core/inspector/v8/V8DebuggerImpl.h" | 31 #include "core/inspector/v8/V8DebuggerImpl.h" |
| 32 | 32 |
| 33 #include "core/inspector/v8/DebuggerScript.h" |
| 33 #include "core/inspector/v8/JavaScriptCallFrame.h" | 34 #include "core/inspector/v8/JavaScriptCallFrame.h" |
| 34 #include "core/inspector/v8/ScriptBreakpoint.h" | 35 #include "core/inspector/v8/ScriptBreakpoint.h" |
| 35 #include "core/inspector/v8/V8DebuggerAgentImpl.h" | 36 #include "core/inspector/v8/V8DebuggerAgentImpl.h" |
| 36 #include "core/inspector/v8/V8DebuggerClient.h" | 37 #include "core/inspector/v8/V8DebuggerClient.h" |
| 37 #include "core/inspector/v8/V8JavaScriptCallFrame.h" | 38 #include "core/inspector/v8/V8JavaScriptCallFrame.h" |
| 38 #include "core/inspector/v8/V8StackTraceImpl.h" | 39 #include "core/inspector/v8/V8StackTraceImpl.h" |
| 39 #include "core/inspector/v8/V8StringUtil.h" | 40 #include "core/inspector/v8/V8StringUtil.h" |
| 40 #include "platform/JSONValues.h" | 41 #include "platform/JSONValues.h" |
| 41 #include "public/platform/Platform.h" | |
| 42 #include "public/platform/WebData.h" | |
| 43 #include "wtf/Atomics.h" | 42 #include "wtf/Atomics.h" |
| 44 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 45 #include "wtf/text/CString.h" | 44 #include "wtf/text/CString.h" |
| 46 | 45 |
| 47 namespace blink { | 46 namespace blink { |
| 48 | 47 |
| 49 namespace { | 48 namespace { |
| 50 const char stepIntoV8MethodName[] = "stepIntoStatement"; | 49 const char stepIntoV8MethodName[] = "stepIntoStatement"; |
| 51 const char stepOutV8MethodName[] = "stepOutOfFunction"; | 50 const char stepOutV8MethodName[] = "stepOutOfFunction"; |
| 52 volatile int s_lastContextId = 0; | 51 volatile int s_lastContextId = 0; |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 | 710 |
| 712 void V8DebuggerImpl::compileDebuggerScript() | 711 void V8DebuggerImpl::compileDebuggerScript() |
| 713 { | 712 { |
| 714 if (!m_debuggerScript.IsEmpty()) { | 713 if (!m_debuggerScript.IsEmpty()) { |
| 715 ASSERT_NOT_REACHED(); | 714 ASSERT_NOT_REACHED(); |
| 716 return; | 715 return; |
| 717 } | 716 } |
| 718 | 717 |
| 719 v8::HandleScope scope(m_isolate); | 718 v8::HandleScope scope(m_isolate); |
| 720 v8::Context::Scope contextScope(debuggerContext()); | 719 v8::Context::Scope contextScope(debuggerContext()); |
| 721 const WebData& source = Platform::current()->loadResource("DebuggerScriptSou
rce.js"); | 720 |
| 722 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, sourc
e.data(), v8::NewStringType::kInternalized, source.size()).ToLocalChecked(); | 721 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, Debug
gerScript_js, v8::NewStringType::kInternalized, sizeof(DebuggerScript_js)).ToLoc
alChecked(); |
| 723 v8::Local<v8::Value> value; | 722 v8::Local<v8::Value> value; |
| 724 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) | 723 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) |
| 725 return; | 724 return; |
| 726 ASSERT(value->IsObject()); | 725 ASSERT(value->IsObject()); |
| 727 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); | 726 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); |
| 728 } | 727 } |
| 729 | 728 |
| 730 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const | 729 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const |
| 731 { | 730 { |
| 732 ASSERT(!m_debuggerContext.IsEmpty()); | 731 ASSERT(!m_debuggerContext.IsEmpty()); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 } | 822 } |
| 824 | 823 |
| 825 v8::Local<v8::Context> V8DebuggerImpl::regexContext() | 824 v8::Local<v8::Context> V8DebuggerImpl::regexContext() |
| 826 { | 825 { |
| 827 if (m_regexContext.IsEmpty()) | 826 if (m_regexContext.IsEmpty()) |
| 828 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); | 827 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); |
| 829 return m_regexContext.Get(m_isolate); | 828 return m_regexContext.Get(m_isolate); |
| 830 } | 829 } |
| 831 | 830 |
| 832 } // namespace blink | 831 } // namespace blink |
| OLD | NEW |