| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Except
ion && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::C
ompileError && event != v8::PromiseEvent) | 489 if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Except
ion && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::C
ompileError && event != v8::PromiseEvent) |
| 490 return; | 490 return; |
| 491 | 491 |
| 492 v8::Handle<v8::Context> eventContext = eventDetails.GetEventContext(); | 492 v8::Handle<v8::Context> eventContext = eventDetails.GetEventContext(); |
| 493 ASSERT(!eventContext.IsEmpty()); | 493 ASSERT(!eventContext.IsEmpty()); |
| 494 | 494 |
| 495 ScriptDebugListener* listener = getDebugListenerForContext(eventContext); | 495 ScriptDebugListener* listener = getDebugListenerForContext(eventContext); |
| 496 if (listener) { | 496 if (listener) { |
| 497 v8::HandleScope scope(m_isolate); | 497 v8::HandleScope scope(m_isolate); |
| 498 v8::Handle<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isol
ate); | 498 v8::Handle<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isol
ate); |
| 499 if (event == v8::BeforeCompile) { | 499 if (event == v8::AfterCompile || event == v8::CompileError) { |
| 500 preprocessBeforeCompile(eventDetails); | |
| 501 } else if (event == v8::AfterCompile || event == v8::CompileError) { | |
| 502 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); | 500 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); |
| 503 v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Funct
ion>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getAfterCompileScript"
))); | 501 v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Funct
ion>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getAfterCompileScript"
))); |
| 504 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; | 502 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; |
| 505 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); | 503 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); |
| 506 ASSERT(value->IsObject()); | 504 ASSERT(value->IsObject()); |
| 507 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); | 505 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); |
| 508 dispatchDidParseSource(listener, object, event != v8::AfterCompile ?
CompileError : CompileSuccess); | 506 dispatchDidParseSource(listener, object, event != v8::AfterCompile ?
CompileError : CompileSuccess); |
| 509 } else if (event == v8::Exception) { | 507 } else if (event == v8::Exception) { |
| 510 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); | 508 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); |
| 511 v8::Handle<v8::Value> exception = callInternalGetterFunction(eventDa
ta, "exception", m_isolate); | 509 v8::Handle<v8::Value> exception = callInternalGetterFunction(eventDa
ta, "exception", m_isolate); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); | 694 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message
->Get()); |
| 697 *lineNumber = message->GetLineNumber(); | 695 *lineNumber = message->GetLineNumber(); |
| 698 *columnNumber = message->GetStartColumn(); | 696 *columnNumber = message->GetStartColumn(); |
| 699 *stackTrace = createScriptCallStack(message->GetStackTrace(), messag
e->GetStackTrace()->GetFrameCount(), m_isolate); | 697 *stackTrace = createScriptCallStack(message->GetStackTrace(), messag
e->GetStackTrace()->GetFrameCount(), m_isolate); |
| 700 } | 698 } |
| 701 } else { | 699 } else { |
| 702 *result = ScriptValue(scriptState, value); | 700 *result = ScriptValue(scriptState, value); |
| 703 } | 701 } |
| 704 } | 702 } |
| 705 | 703 |
| 706 PassOwnPtr<ScriptSourceCode> ScriptDebugServer::preprocess(LocalFrame*, const Sc
riptSourceCode&) | |
| 707 { | |
| 708 return PassOwnPtr<ScriptSourceCode>(); | |
| 709 } | |
| 710 | |
| 711 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | |
| 712 { | |
| 713 return source; | |
| 714 } | |
| 715 | |
| 716 } // namespace blink | 704 } // namespace blink |
| OLD | NEW |