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

Side by Side Diff: Source/devtools/front_end/sdk/SASSSourceMapping.js

Issue 396993003: DevTools: get rid of WebInspector.cssModel, use target models instead (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 * @return {?Date} 134 * @return {?Date}
135 */ 135 */
136 _checkLastModified: function(headers, url) 136 _checkLastModified: function(headers, url)
137 { 137 {
138 var lastModified = this._lastModified(headers); 138 var lastModified = this._lastModified(headers);
139 if (lastModified) 139 if (lastModified)
140 return lastModified; 140 return lastModified;
141 141
142 var etagMessage = this._headerValue("etag", headers) ? ", \"ETag\" respo nse header found instead" : ""; 142 var etagMessage = this._headerValue("etag", headers) ? ", \"ETag\" respo nse header found instead" : "";
143 var message = String.sprintf("The \"Last-Modified\" response header is m issing or invalid for %s%s. The CSS auto-reload functionality will not work corr ectly.", url, etagMessage); 143 var message = String.sprintf("The \"Last-Modified\" response header is m issing or invalid for %s%s. The CSS auto-reload functionality will not work corr ectly.", url, etagMessage);
144 this._cssModel.target().consoleModel.log(message); 144 WebInspector.console.log(message);
145 return null; 145 return null;
146 }, 146 },
147 147
148 /** 148 /**
149 * @param {string} sassURL 149 * @param {string} sassURL
150 * @param {boolean} wasLoadedFromFileSystem 150 * @param {boolean} wasLoadedFromFileSystem
151 */ 151 */
152 _sassFileSaved: function(sassURL, wasLoadedFromFileSystem) 152 _sassFileSaved: function(sassURL, wasLoadedFromFileSystem)
153 { 153 {
154 var cssURLs = this._cssURLsForSASSURL[sassURL]; 154 var cssURLs = this._cssURLsForSASSURL[sassURL];
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 /** 236 /**
237 * @param {string} cssURL 237 * @param {string} cssURL
238 * @param {string} sassURL 238 * @param {string} sassURL
239 * @param {function(string, string, boolean)} callback 239 * @param {function(string, string, boolean)} callback
240 */ 240 */
241 _reloadCSS: function(cssURL, sassURL, callback) 241 _reloadCSS: function(cssURL, sassURL, callback)
242 { 242 {
243 var cssUISourceCode = this._workspace.uiSourceCodeForURL(cssURL); 243 var cssUISourceCode = this._workspace.uiSourceCodeForURL(cssURL);
244 if (!cssUISourceCode) { 244 if (!cssUISourceCode) {
245 WebInspector.console.addMessage(WebInspector.UIString("%s resource m issing. Please reload the page.", cssURL), WebInspector.Console.MessageLevel.War ning); 245 WebInspector.console.warn(WebInspector.UIString("%s resource missing . Please reload the page.", cssURL));
246 callback(cssURL, sassURL, true); 246 callback(cssURL, sassURL, true);
247 return; 247 return;
248 } 248 }
249 249
250 if (this._workspace.hasMappingForURL(sassURL)) 250 if (this._workspace.hasMappingForURL(sassURL))
251 this._reloadCSSFromFileSystem(cssUISourceCode, sassURL, callback); 251 this._reloadCSSFromFileSystem(cssUISourceCode, sassURL, callback);
252 else 252 else
253 this._reloadCSSFromNetwork(cssUISourceCode, sassURL, callback); 253 this._reloadCSSFromNetwork(cssUISourceCode, sassURL, callback);
254 }, 254 },
255 255
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 this._cssURLsForSASSURL = {}; 626 this._cssURLsForSASSURL = {};
627 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */ 627 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
628 this._pendingSourceMapLoadingCallbacks = {}; 628 this._pendingSourceMapLoadingCallbacks = {};
629 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st ring, !{timer: number, previousPoll: number}>}>} */ 629 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st ring, !{timer: number, previousPoll: number}>}>} */
630 this._pollDataForSASSURL = {}; 630 this._pollDataForSASSURL = {};
631 /** @type {!Object.<string, !WebInspector.SourceMap>} */ 631 /** @type {!Object.<string, !WebInspector.SourceMap>} */
632 this._sourceMapByURL = {}; 632 this._sourceMapByURL = {};
633 this._sourceMapByStyleSheetURL = {}; 633 this._sourceMapByStyleSheetURL = {};
634 } 634 }
635 } 635 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js ('k') | Source/devtools/front_end/sdk/ScriptSnippetModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698