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/PerIsolateDebuggerClient.h" | 6 #include "core/inspector/PerIsolateDebuggerClient.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 PerIsolateDebuggerClient::PerIsolateDebuggerClient(v8::Isolate* isolate, PassOwn
Ptr<ScriptDebugServer> scriptDebugServer) | 15 PerIsolateDebuggerClient::PerIsolateDebuggerClient(v8::Isolate* isolate, PassOwn
PtrWillBeRawPtr<ScriptDebugServer> scriptDebugServer) |
16 : m_isolate(isolate) | 16 : m_isolate(isolate) |
17 , m_scriptDebugServer(scriptDebugServer) | 17 , m_scriptDebugServer(scriptDebugServer) |
18 { | 18 { |
19 } | 19 } |
20 | 20 |
21 PerIsolateDebuggerClient::~PerIsolateDebuggerClient() | 21 PerIsolateDebuggerClient::~PerIsolateDebuggerClient() |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
| 25 DEFINE_TRACE(PerIsolateDebuggerClient) |
| 26 { |
| 27 visitor->trace(m_scriptDebugServer); |
| 28 ScriptDebugServer::Client::trace(visitor); |
| 29 } |
| 30 |
25 v8::Local<v8::Object> PerIsolateDebuggerClient::compileDebuggerScript() | 31 v8::Local<v8::Object> PerIsolateDebuggerClient::compileDebuggerScript() |
26 { | 32 { |
27 const WebData& debuggerScriptSourceResource = Platform::current()->loadResou
rce("DebuggerScriptSource.js"); | 33 const WebData& debuggerScriptSourceResource = Platform::current()->loadResou
rce("DebuggerScriptSource.js"); |
28 v8::Local<v8::String> source = v8String(m_isolate, String(debuggerScriptSour
ceResource.data(), debuggerScriptSourceResource.size())); | 34 v8::Local<v8::String> source = v8String(m_isolate, String(debuggerScriptSour
ceResource.data(), debuggerScriptSourceResource.size())); |
29 v8::Local<v8::Value> value; | 35 v8::Local<v8::Value> value; |
30 if (!V8ScriptRunner::compileAndRunInternalScript(source, m_isolate).ToLocal(
&value)) | 36 if (!V8ScriptRunner::compileAndRunInternalScript(source, m_isolate).ToLocal(
&value)) |
31 return v8::Local<v8::Object>(); | 37 return v8::Local<v8::Object>(); |
32 ASSERT(value->IsObject()); | 38 ASSERT(value->IsObject()); |
33 return value.As<v8::Object>(); | 39 return value.As<v8::Object>(); |
34 } | 40 } |
35 | 41 |
36 } | 42 } |
OLD | NEW |