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

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

Issue 1583383003: [DevTools] Send source map content from frontend to backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blackbox-inline-source-map
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
index 2f580f5399b709b4dcaaa1bd0e1f2c8337fdbd70..225a84fa0bd19f8651026f8e6ab3cc222f75c1f2 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp
@@ -133,7 +133,7 @@ static PassOwnPtr<SourceMap> parseSourceMapFromDataUrl(const String& url)
RefPtr<SharedBuffer> data = PassRefPtr<SharedBuffer>(Platform::current()->parseDataURL(sourceMapURL, mimetype, charset));
if (!data)
return nullptr;
- return SourceMap::parse(String(data->data(), data->size()));
+ return SourceMap::parse(String(data->data(), data->size()), String());
}
PassOwnPtr<V8DebuggerAgent> V8DebuggerAgent::create(InjectedScriptManager* injectedScriptManager, V8Debugger* debugger, int contextGroupId)
@@ -1379,6 +1379,20 @@ void V8DebuggerAgentImpl::removeAsyncOperationBreakpoint(ErrorString* errorStrin
m_asyncOperationBreakpoints.remove(operationId);
}
+void V8DebuggerAgentImpl::setSourceMapContent(ErrorString*, const String& scriptId, const String& sourceMapURL, const String& content)
+{
+ auto it = m_scripts.find(scriptId);
+ if (it == m_scripts.end())
+ return;
+ if (m_sourceMaps.find(scriptId) != m_sourceMaps.end())
+ return;
+ OwnPtr<SourceMap> sourceMap = SourceMap::parse(content, sourceMapURL);
+ if (sourceMap) {
+ m_sourceMaps.set(scriptId, sourceMap.release());
+ it->value.invalidateBlackboxedState();
+ }
+}
+
void V8DebuggerAgentImpl::willExecuteScript(int scriptId)
{
changeJavaScriptRecursionLevel(+1);

Powered by Google App Engine
This is Rietveld 408576698