Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp

Issue 1676093002: Revert of DevTools: do not use platform/ to load injected scripts into inspector/v8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
34 #include "core/inspector/v8/JavaScriptCallFrame.h" 33 #include "core/inspector/v8/JavaScriptCallFrame.h"
35 #include "core/inspector/v8/ScriptBreakpoint.h" 34 #include "core/inspector/v8/ScriptBreakpoint.h"
36 #include "core/inspector/v8/V8DebuggerAgentImpl.h" 35 #include "core/inspector/v8/V8DebuggerAgentImpl.h"
37 #include "core/inspector/v8/V8DebuggerClient.h" 36 #include "core/inspector/v8/V8DebuggerClient.h"
38 #include "core/inspector/v8/V8JavaScriptCallFrame.h" 37 #include "core/inspector/v8/V8JavaScriptCallFrame.h"
39 #include "core/inspector/v8/V8StackTraceImpl.h" 38 #include "core/inspector/v8/V8StackTraceImpl.h"
40 #include "core/inspector/v8/V8StringUtil.h" 39 #include "core/inspector/v8/V8StringUtil.h"
41 #include "platform/JSONValues.h" 40 #include "platform/JSONValues.h"
41 #include "public/platform/Platform.h"
42 #include "public/platform/WebData.h"
42 #include "wtf/Atomics.h" 43 #include "wtf/Atomics.h"
43 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
44 #include "wtf/text/CString.h" 45 #include "wtf/text/CString.h"
45 46
46 namespace blink { 47 namespace blink {
47 48
48 namespace { 49 namespace {
49 const char stepIntoV8MethodName[] = "stepIntoStatement"; 50 const char stepIntoV8MethodName[] = "stepIntoStatement";
50 const char stepOutV8MethodName[] = "stepOutOfFunction"; 51 const char stepOutV8MethodName[] = "stepOutOfFunction";
51 volatile int s_lastContextId = 0; 52 volatile int s_lastContextId = 0;
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 711
711 void V8DebuggerImpl::compileDebuggerScript() 712 void V8DebuggerImpl::compileDebuggerScript()
712 { 713 {
713 if (!m_debuggerScript.IsEmpty()) { 714 if (!m_debuggerScript.IsEmpty()) {
714 ASSERT_NOT_REACHED(); 715 ASSERT_NOT_REACHED();
715 return; 716 return;
716 } 717 }
717 718
718 v8::HandleScope scope(m_isolate); 719 v8::HandleScope scope(m_isolate);
719 v8::Context::Scope contextScope(debuggerContext()); 720 v8::Context::Scope contextScope(debuggerContext());
720 721 const WebData& source = Platform::current()->loadResource("DebuggerScriptSou rce.js");
721 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, Debug gerScript_js, v8::NewStringType::kInternalized, sizeof(DebuggerScript_js)).ToLoc alChecked(); 722 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, sourc e.data(), v8::NewStringType::kInternalized, source.size()).ToLocalChecked();
722 v8::Local<v8::Value> value; 723 v8::Local<v8::Value> value;
723 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) 724 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value))
724 return; 725 return;
725 ASSERT(value->IsObject()); 726 ASSERT(value->IsObject());
726 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); 727 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>());
727 } 728 }
728 729
729 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const 730 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const
730 { 731 {
731 ASSERT(!m_debuggerContext.IsEmpty()); 732 ASSERT(!m_debuggerContext.IsEmpty());
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 } 823 }
823 824
824 v8::Local<v8::Context> V8DebuggerImpl::regexContext() 825 v8::Local<v8::Context> V8DebuggerImpl::regexContext()
825 { 826 {
826 if (m_regexContext.IsEmpty()) 827 if (m_regexContext.IsEmpty())
827 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); 828 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate));
828 return m_regexContext.Get(m_isolate); 829 return m_regexContext.Get(m_isolate);
829 } 830 }
830 831
831 } // namespace blink 832 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698