| 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 21 matching lines...) Expand all Loading... |
| 32 #include "bindings/core/v8/ScriptDebugServer.h" | 32 #include "bindings/core/v8/ScriptDebugServer.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScopedPersistent.h" | 34 #include "bindings/core/v8/ScopedPersistent.h" |
| 35 #include "bindings/core/v8/ScriptCallStackFactory.h" | 35 #include "bindings/core/v8/ScriptCallStackFactory.h" |
| 36 #include "bindings/core/v8/ScriptController.h" | 36 #include "bindings/core/v8/ScriptController.h" |
| 37 #include "bindings/core/v8/ScriptSourceCode.h" | 37 #include "bindings/core/v8/ScriptSourceCode.h" |
| 38 #include "bindings/core/v8/ScriptValue.h" | 38 #include "bindings/core/v8/ScriptValue.h" |
| 39 #include "bindings/core/v8/V8Binding.h" | 39 #include "bindings/core/v8/V8Binding.h" |
| 40 #include "bindings/core/v8/V8JavaScriptCallFrame.h" | 40 #include "bindings/core/v8/V8JavaScriptCallFrame.h" |
| 41 #include "bindings/core/v8/V8ScriptRunner.h" | 41 #include "bindings/core/v8/V8ScriptRunner.h" |
| 42 #include "core/DebuggerScriptSource.h" | |
| 43 #include "core/inspector/JavaScriptCallFrame.h" | 42 #include "core/inspector/JavaScriptCallFrame.h" |
| 44 #include "core/inspector/ScriptDebugListener.h" | 43 #include "core/inspector/ScriptDebugListener.h" |
| 45 #include "platform/JSONValues.h" | 44 #include "platform/JSONValues.h" |
| 45 #include "public/platform/Platform.h" |
| 46 #include "public/platform/WebData.h" |
| 46 #include "wtf/StdLibExtras.h" | 47 #include "wtf/StdLibExtras.h" |
| 47 #include "wtf/Vector.h" | 48 #include "wtf/Vector.h" |
| 48 #include "wtf/dtoa/utils.h" | 49 #include "wtf/dtoa/utils.h" |
| 49 #include "wtf/text/CString.h" | 50 #include "wtf/text/CString.h" |
| 50 | 51 |
| 51 namespace blink { | 52 namespace blink { |
| 52 | 53 |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| 55 class ClientDataImpl : public v8::Debug::ClientData { | 56 class ClientDataImpl : public v8::Debug::ClientData { |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 listener->didParseSource(sourceID, script, compileResult); | 550 listener->didParseSource(sourceID, script, compileResult); |
| 550 } | 551 } |
| 551 | 552 |
| 552 void ScriptDebugServer::ensureDebuggerScriptCompiled() | 553 void ScriptDebugServer::ensureDebuggerScriptCompiled() |
| 553 { | 554 { |
| 554 if (!m_debuggerScript.isEmpty()) | 555 if (!m_debuggerScript.isEmpty()) |
| 555 return; | 556 return; |
| 556 | 557 |
| 557 v8::HandleScope scope(m_isolate); | 558 v8::HandleScope scope(m_isolate); |
| 558 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); | 559 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); |
| 559 v8::Handle<v8::String> source = v8String(m_isolate, String(reinterpret_cast<
const char*>(DebuggerScriptSource_js), sizeof(DebuggerScriptSource_js))); | 560 const blink::WebData& debuggerScriptSourceResource = blink::Platform::curren
t()->loadResource("DebuggerScriptSource.js"); |
| 561 v8::Handle<v8::String> source = v8String(m_isolate, String(debuggerScriptSou
rceResource.data(), debuggerScriptSourceResource.size())); |
| 560 v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(sou
rce, m_isolate); | 562 v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(sou
rce, m_isolate); |
| 561 ASSERT(!value.IsEmpty()); | 563 ASSERT(!value.IsEmpty()); |
| 562 ASSERT(value->IsObject()); | 564 ASSERT(value->IsObject()); |
| 563 m_debuggerScript.set(m_isolate, v8::Handle<v8::Object>::Cast(value)); | 565 m_debuggerScript.set(m_isolate, v8::Handle<v8::Object>::Cast(value)); |
| 564 } | 566 } |
| 565 | 567 |
| 566 void ScriptDebugServer::discardDebuggerScript() | 568 void ScriptDebugServer::discardDebuggerScript() |
| 567 { | 569 { |
| 568 ASSERT(!m_debuggerScript.isEmpty()); | 570 ASSERT(!m_debuggerScript.isEmpty()); |
| 569 m_debuggerScript.clear(); | 571 m_debuggerScript.clear(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 { | 676 { |
| 675 return PassOwnPtr<ScriptSourceCode>(); | 677 return PassOwnPtr<ScriptSourceCode>(); |
| 676 } | 678 } |
| 677 | 679 |
| 678 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | 680 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) |
| 679 { | 681 { |
| 680 return source; | 682 return source; |
| 681 } | 683 } |
| 682 | 684 |
| 683 } // namespace blink | 685 } // namespace blink |
| OLD | NEW |