OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "config.h" | |
6 #include "core/inspector/ScriptDebuggerBase.h" | |
7 | |
8 #include "bindings/core/v8/V8Binding.h" | |
9 #include "bindings/core/v8/V8ScriptRunner.h" | |
10 #include "public/platform/Platform.h" | |
11 #include "public/platform/WebData.h" | |
12 | |
13 namespace blink { | |
14 | |
15 ScriptDebuggerBase::ScriptDebuggerBase(v8::Isolate* isolate) | |
16 : m_isolate(isolate) | |
17 , m_debugger(V8Debugger::create(isolate, this)) | |
18 { | |
19 } | |
20 | |
21 ScriptDebuggerBase::~ScriptDebuggerBase() | |
22 { | |
23 } | |
24 | |
25 v8::Local<v8::Object> ScriptDebuggerBase::compileDebuggerScript() | |
26 { | |
27 const WebData& debuggerScriptSourceResource = Platform::current()->loadResou
rce("DebuggerScriptSource.js"); | |
28 v8::Local<v8::String> source = v8String(m_isolate, String(debuggerScriptSour
ceResource.data(), debuggerScriptSourceResource.size())); | |
29 v8::Local<v8::Value> value; | |
30 if (!V8ScriptRunner::compileAndRunInternalScript(source, m_isolate).ToLocal(
&value)) | |
31 return v8::Local<v8::Object>(); | |
32 ASSERT(value->IsObject()); | |
33 return value.As<v8::Object>(); | |
34 } | |
35 | |
36 } | |
OLD | NEW |