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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp

Issue 1409223006: DevTools: replace content provider when re-adding into network project (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Same with isLiveEdit flag in a scriptParsed. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp
index ee81bdf17a0c492732c5c86e4aa7420036cfccd4..f4ca12cc5fdfd79de3b48767d89b8c6d817c7978 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerImpl.cpp
@@ -49,6 +49,8 @@ const char stepIntoV8MethodName[] = "stepIntoStatement";
const char stepOutV8MethodName[] = "stepOutOfFunction";
}
+static bool inLiveEditScope = false;
+
v8::MaybeLocal<v8::Value> V8DebuggerImpl::callDebuggerMethod(const char* functionName, int argc, v8::Local<v8::Value> argv[])
{
v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate);
@@ -354,8 +356,16 @@ bool V8DebuggerImpl::setScriptSource(const String& sourceID, const String& newCo
{
class EnableLiveEditScope {
public:
- explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) { v8::Debug::SetLiveEditEnabled(m_isolate, true); }
- ~EnableLiveEditScope() { v8::Debug::SetLiveEditEnabled(m_isolate, false); }
+ explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate)
+ {
+ v8::Debug::SetLiveEditEnabled(m_isolate, true);
+ inLiveEditScope = true;
+ }
+ ~EnableLiveEditScope()
+ {
+ v8::Debug::SetLiveEditEnabled(m_isolate, false);
+ inLiveEditScope = false;
+ }
private:
v8::Isolate* m_isolate;
};
@@ -665,7 +675,8 @@ V8DebuggerListener::ParsedScript V8DebuggerImpl::createParsedScript(v8::Local<v8
.setEndLine(object->Get(v8InternalizedString("endLine"))->ToInteger(m_isolate)->Value())
.setEndColumn(object->Get(v8InternalizedString("endColumn"))->ToInteger(m_isolate)->Value())
.setIsContentScript(object->Get(v8InternalizedString("isContentScript"))->ToBoolean(m_isolate)->Value())
- .setIsInternalScript(object->Get(v8InternalizedString("isInternalScript"))->ToBoolean(m_isolate)->Value());
+ .setIsInternalScript(object->Get(v8InternalizedString("isInternalScript"))->ToBoolean(m_isolate)->Value())
+ .setIsLiveEdit(inLiveEditScope);
parsedScript.compileResult = compileResult;
return parsedScript;
}

Powered by Google App Engine
This is Rietveld 408576698