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/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/Platform.h" |
42 #include "public/platform/WebData.h" | 43 #include "public/platform/WebData.h" |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
711 | 712 |
712 void V8DebuggerImpl::compileDebuggerScript() | 713 void V8DebuggerImpl::compileDebuggerScript() |
713 { | 714 { |
714 if (!m_debuggerScript.IsEmpty()) { | 715 if (!m_debuggerScript.IsEmpty()) { |
715 ASSERT_NOT_REACHED(); | 716 ASSERT_NOT_REACHED(); |
716 return; | 717 return; |
717 } | 718 } |
718 | 719 |
719 v8::HandleScope scope(m_isolate); | 720 v8::HandleScope scope(m_isolate); |
720 v8::Context::Scope contextScope(debuggerContext()); | 721 v8::Context::Scope contextScope(debuggerContext()); |
721 const WebData& source = Platform::current()->loadResource("DebuggerScriptSou rce.js"); | 722 |
722 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, sourc e.data(), v8::NewStringType::kInternalized, source.size()).ToLocalChecked(); | 723 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, reint erpret_cast<const char*>(DebuggerScript_js), v8::NewStringType::kInternalized, s izeof(DebuggerScript_js)).ToLocalChecked(); |
dgozman
2016/02/05 02:49:11
Let's avoid static_cast here.
| |
723 v8::Local<v8::Value> value; | 724 v8::Local<v8::Value> value; |
724 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) | 725 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) |
725 return; | 726 return; |
726 ASSERT(value->IsObject()); | 727 ASSERT(value->IsObject()); |
727 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); | 728 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); |
728 } | 729 } |
729 | 730 |
730 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const | 731 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const |
731 { | 732 { |
732 ASSERT(!m_debuggerContext.IsEmpty()); | 733 ASSERT(!m_debuggerContext.IsEmpty()); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 } | 824 } |
824 | 825 |
825 v8::Local<v8::Context> V8DebuggerImpl::regexContext() | 826 v8::Local<v8::Context> V8DebuggerImpl::regexContext() |
826 { | 827 { |
827 if (m_regexContext.IsEmpty()) | 828 if (m_regexContext.IsEmpty()) |
828 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); | 829 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); |
829 return m_regexContext.Get(m_isolate); | 830 return m_regexContext.Get(m_isolate); |
830 } | 831 } |
831 | 832 |
832 } // namespace blink | 833 } // namespace blink |
OLD | NEW |