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