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

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

Issue 2695123004: DevTools: Only provide static script content to UISourceCode (Closed)
Patch Set: another try Created 3 years, 9 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 _parsedScriptSource(event) { 242 _parsedScriptSource(event) {
243 var script = /** @type {!SDK.Script} */ (event.data); 243 var script = /** @type {!SDK.Script} */ (event.data);
244 if (!script.sourceURL || script.isLiveEdit() || (script.isInlineScript() && !script.hasSourceURL)) 244 if (!script.sourceURL || script.isLiveEdit() || (script.isInlineScript() && !script.hasSourceURL))
245 return; 245 return;
246 // Filter out embedder injected content scripts. 246 // Filter out embedder injected content scripts.
247 if (script.isContentScript() && !script.hasSourceURL) { 247 if (script.isContentScript() && !script.hasSourceURL) {
248 var parsedURL = new Common.ParsedURL(script.sourceURL); 248 var parsedURL = new Common.ParsedURL(script.sourceURL);
249 if (!parsedURL.isValid) 249 if (!parsedURL.isValid)
250 return; 250 return;
251 } 251 }
252 var uiSourceCode = this._createFile(script, SDK.ResourceTreeFrame.fromScript (script), script.isContentScript()); 252 var originalContentProvider = script.originalContentProvider();
253 var uiSourceCode =
254 this._createFile(originalContentProvider, SDK.ResourceTreeFrame.fromScri pt(script), script.isContentScript());
253 uiSourceCode[Bindings.NetworkProject._scriptSymbol] = script; 255 uiSourceCode[Bindings.NetworkProject._scriptSymbol] = script;
254 var resource = SDK.ResourceTreeModel.resourceForURL(uiSourceCode.url()); 256 var resource = SDK.ResourceTreeModel.resourceForURL(uiSourceCode.url());
255 this._addUISourceCodeWithProvider(uiSourceCode, script, this._resourceMetada ta(resource)); 257 this._addUISourceCodeWithProvider(uiSourceCode, originalContentProvider, thi s._resourceMetadata(resource));
256 } 258 }
257 259
258 /** 260 /**
259 * @param {!Common.Event} event 261 * @param {!Common.Event} event
260 */ 262 */
261 _styleSheetAdded(event) { 263 _styleSheetAdded(event) {
262 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); 264 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data);
263 if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector' ) 265 if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector' )
264 return; 266 return;
265 if (!header.resourceURL()) 267 if (!header.resourceURL())
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return workspace.uiSourceCode(Bindings.NetworkProject.projectId(header.targe t(), frame, false), url); 410 return workspace.uiSourceCode(Bindings.NetworkProject.projectId(header.targe t(), frame, false), url);
409 } 411 }
410 }; 412 };
411 413
412 Bindings.NetworkProject._networkProjectSymbol = Symbol('networkProject'); 414 Bindings.NetworkProject._networkProjectSymbol = Symbol('networkProject');
413 Bindings.NetworkProject._resourceSymbol = Symbol('resource'); 415 Bindings.NetworkProject._resourceSymbol = Symbol('resource');
414 Bindings.NetworkProject._scriptSymbol = Symbol('script'); 416 Bindings.NetworkProject._scriptSymbol = Symbol('script');
415 Bindings.NetworkProject._styleSheetSymbol = Symbol('styleSheet'); 417 Bindings.NetworkProject._styleSheetSymbol = Symbol('styleSheet');
416 Bindings.NetworkProject._targetSymbol = Symbol('target'); 418 Bindings.NetworkProject._targetSymbol = Symbol('target');
417 Bindings.NetworkProject._frameSymbol = Symbol('frame'); 419 Bindings.NetworkProject._frameSymbol = Symbol('frame');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698