Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: Source/bindings/core/v8/ScriptDebugServer.cpp

Issue 538933002: ScriptState::contextIsEmpty shouldn't return true for a context whose global object is detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/bindings/core/v8/ScriptState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } 635 }
636 636
637 637
638 bool ScriptDebugServer::isPaused() 638 bool ScriptDebugServer::isPaused()
639 { 639 {
640 return m_pausedScriptState; 640 return m_pausedScriptState;
641 } 641 }
642 642
643 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) 643 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)
644 { 644 {
645 if (scriptState->contextIsEmpty()) 645 if (scriptState->contextIsValid())
646 return; 646 return;
647 ScriptState::Scope scope(scriptState); 647 ScriptState::Scope scope(scriptState);
648 648
649 v8::Handle<v8::String> source = v8String(m_isolate, expression); 649 v8::Handle<v8::String> source = v8String(m_isolate, expression);
650 v8::TryCatch tryCatch; 650 v8::TryCatch tryCatch;
651 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU RL, TextPosition(), 0, m_isolate); 651 v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceU RL, TextPosition(), 0, m_isolate);
652 if (tryCatch.HasCaught()) { 652 if (tryCatch.HasCaught()) {
653 v8::Local<v8::Message> message = tryCatch.Message(); 653 v8::Local<v8::Message> message = tryCatch.Message();
654 if (!message.IsEmpty()) { 654 if (!message.IsEmpty()) {
655 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message ->Get()); 655 *exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message ->Get());
(...skipping 19 matching lines...) Expand all
675 { 675 {
676 if (!m_compiledScripts.contains(scriptId)) 676 if (!m_compiledScripts.contains(scriptId))
677 return; 677 return;
678 v8::HandleScope handleScope(m_isolate); 678 v8::HandleScope handleScope(m_isolate);
679 ScopedPersistent<v8::Script>* scriptHandle = m_compiledScripts.get(scriptId) ; 679 ScopedPersistent<v8::Script>* scriptHandle = m_compiledScripts.get(scriptId) ;
680 v8::Local<v8::Script> script = scriptHandle->newLocal(m_isolate); 680 v8::Local<v8::Script> script = scriptHandle->newLocal(m_isolate);
681 m_compiledScripts.remove(scriptId); 681 m_compiledScripts.remove(scriptId);
682 if (script.IsEmpty()) 682 if (script.IsEmpty())
683 return; 683 return;
684 684
685 if (scriptState->contextIsEmpty()) 685 if (scriptState->contextIsValid())
686 return; 686 return;
687 ScriptState::Scope scope(scriptState); 687 ScriptState::Scope scope(scriptState);
688 v8::TryCatch tryCatch; 688 v8::TryCatch tryCatch;
689 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(script, scrip tState->executionContext(), m_isolate); 689 v8::Local<v8::Value> value = V8ScriptRunner::runCompiledScript(script, scrip tState->executionContext(), m_isolate);
690 *wasThrown = false; 690 *wasThrown = false;
691 if (tryCatch.HasCaught()) { 691 if (tryCatch.HasCaught()) {
692 *wasThrown = true; 692 *wasThrown = true;
693 *result = ScriptValue(scriptState, tryCatch.Exception()); 693 *result = ScriptValue(scriptState, tryCatch.Exception());
694 v8::Local<v8::Message> message = tryCatch.Message(); 694 v8::Local<v8::Message> message = tryCatch.Message();
695 if (!message.IsEmpty()) { 695 if (!message.IsEmpty()) {
(...skipping 11 matching lines...) Expand all
707 { 707 {
708 return PassOwnPtr<ScriptSourceCode>(); 708 return PassOwnPtr<ScriptSourceCode>();
709 } 709 }
710 710
711 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName) 711 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName)
712 { 712 {
713 return source; 713 return source;
714 } 714 }
715 715
716 } // namespace blink 716 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/bindings/core/v8/ScriptState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698