| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 | 646 |
| 647 bool ScriptDebugServer::isPaused() | 647 bool ScriptDebugServer::isPaused() |
| 648 { | 648 { |
| 649 return m_pausedScriptState; | 649 return m_pausedScriptState; |
| 650 } | 650 } |
| 651 | 651 |
| 652 void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex
pression, const String& sourceURL, String* scriptId, String* exceptionDetailsTex
t, int* lineNumber, int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stac
kTrace) | 652 void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex
pression, const String& sourceURL, String* scriptId, String* exceptionDetailsTex
t, int* lineNumber, int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stac
kTrace) |
| 653 { | 653 { |
| 654 if (scriptState->contextIsValid()) | 654 if (!scriptState->contextIsValid()) |
| 655 return; | 655 return; |
| 656 ScriptState::Scope scope(scriptState); | 656 ScriptState::Scope scope(scriptState); |
| 657 | 657 |
| 658 v8::Handle<v8::String> source = v8String(m_isolate, expression); | 658 v8::Handle<v8::String> source = v8String(m_isolate, expression); |
| 659 v8::TryCatch tryCatch; | 659 v8::TryCatch tryCatch; |
| 660 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU
RL, TextPosition(), 0, 0, m_isolate); | 660 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU
RL, TextPosition(), 0, 0, m_isolate); |
| 661 if (tryCatch.HasCaught()) { | 661 if (tryCatch.HasCaught()) { |
| 662 v8::Local<v8::Message> message = tryCatch.Message(); | 662 v8::Local<v8::Message> message = tryCatch.Message(); |
| 663 if (!message.IsEmpty()) { | 663 if (!message.IsEmpty()) { |
| 664 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); | 664 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 684 { | 684 { |
| 685 if (!m_compiledScripts.contains(scriptId)) | 685 if (!m_compiledScripts.contains(scriptId)) |
| 686 return; | 686 return; |
| 687 v8::HandleScope handleScope(m_isolate); | 687 v8::HandleScope handleScope(m_isolate); |
| 688 ScopedPersistent<v8::Script>* scriptHandle = m_compiledScripts.get(scriptId)
; | 688 ScopedPersistent<v8::Script>* scriptHandle = m_compiledScripts.get(scriptId)
; |
| 689 v8::Local<v8::Script> script = scriptHandle->newLocal(m_isolate); | 689 v8::Local<v8::Script> script = scriptHandle->newLocal(m_isolate); |
| 690 m_compiledScripts.remove(scriptId); | 690 m_compiledScripts.remove(scriptId); |
| 691 if (script.IsEmpty()) | 691 if (script.IsEmpty()) |
| 692 return; | 692 return; |
| 693 | 693 |
| 694 if (scriptState->contextIsValid()) | 694 if (!scriptState->contextIsValid()) |
| 695 return; | 695 return; |
| 696 ScriptState::Scope scope(scriptState); | 696 ScriptState::Scope scope(scriptState); |
| 697 v8::TryCatch tryCatch; | 697 v8::TryCatch tryCatch; |
| 698 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(script, scrip
tState->executionContext(), m_isolate); | 698 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(script, scrip
tState->executionContext(), m_isolate); |
| 699 *wasThrown = false; | 699 *wasThrown = false; |
| 700 if (tryCatch.HasCaught()) { | 700 if (tryCatch.HasCaught()) { |
| 701 *wasThrown = true; | 701 *wasThrown = true; |
| 702 *result = ScriptValue(scriptState, tryCatch.Exception()); | 702 *result = ScriptValue(scriptState, tryCatch.Exception()); |
| 703 v8::Local<v8::Message> message = tryCatch.Message(); | 703 v8::Local<v8::Message> message = tryCatch.Message(); |
| 704 if (!message.IsEmpty()) { | 704 if (!message.IsEmpty()) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 716 { | 716 { |
| 717 return PassOwnPtr<ScriptSourceCode>(); | 717 return PassOwnPtr<ScriptSourceCode>(); |
| 718 } | 718 } |
| 719 | 719 |
| 720 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | 720 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) |
| 721 { | 721 { |
| 722 return source; | 722 return source; |
| 723 } | 723 } |
| 724 | 724 |
| 725 } // namespace blink | 725 } // namespace blink |
| OLD | NEW |