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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

Issue 2408203007: DevTools: teach network UISourceCodes to return metadata (Closed)
Patch Set: address comments Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 // Report sources. 231 // Report sources.
232 var missingSources = []; 232 var missingSources = [];
233 for (var sourceURL of sourceMap.sourceURLs()) { 233 for (var sourceURL of sourceMap.sourceURLs()) {
234 if (this._sourceMapForURL.get(sourceURL)) 234 if (this._sourceMapForURL.get(sourceURL))
235 continue; 235 continue;
236 this._sourceMapForURL.set(sourceURL, sourceMap); 236 this._sourceMapForURL.set(sourceURL, sourceMap);
237 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sou rceURL, script); 237 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sou rceURL, script);
238 if (!uiSourceCode) { 238 if (!uiSourceCode) {
239 var contentProvider = sourceMap.sourceContentProvider(sourceURL, WebInspector.resourceTypes.SourceMapScript); 239 var contentProvider = sourceMap.sourceContentProvider(sourceURL, WebInspector.resourceTypes.SourceMapScript);
240 uiSourceCode = this._networkProject.addFile(contentProvider, Web Inspector.ResourceTreeFrame.fromScript(script), script.isContentScript()); 240 var embeddedContent = sourceMap.embeddedContentByURL(sourceURL);
241 var embeddedContentLength = typeof embeddedContent === "string" ? embeddedContent.length : null;
242 uiSourceCode = this._networkProject.addFile(contentProvider, Web Inspector.ResourceTreeFrame.fromScript(script), script.isContentScript(), embedd edContentLength);
241 uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] = script.sourceURL; 243 uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] = script.sourceURL;
242 } 244 }
243 if (uiSourceCode) { 245 if (uiSourceCode) {
244 this._bindUISourceCode(uiSourceCode); 246 this._bindUISourceCode(uiSourceCode);
245 } else { 247 } else {
246 if (missingSources.length < 3) 248 if (missingSources.length < 3)
247 missingSources.push(sourceURL); 249 missingSources.push(sourceURL);
248 else if (missingSources.peekLast() !== "\u2026") 250 else if (missingSources.peekLast() !== "\u2026")
249 missingSources.push("\u2026"); 251 missingSources.push("\u2026");
250 } 252 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 387 }
386 388
387 /** 389 /**
388 * @param {!WebInspector.Target} target 390 * @param {!WebInspector.Target} target
389 * @return {string} 391 * @return {string}
390 */ 392 */
391 WebInspector.CompilerScriptMapping.projectIdForTarget = function(target) 393 WebInspector.CompilerScriptMapping.projectIdForTarget = function(target)
392 { 394 {
393 return "compiler-script-project:" + target.id(); 395 return "compiler-script-project:" + target.id();
394 } 396 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698