OLD | NEW |
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 Loading... |
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 WebInspector.console.log(message); | 144 this._cssModel.target().consoleModel.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 Loading... |
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.log(WebInspector.UIString("%s resource missing.
Please reload the page.", cssURL)); | 245 WebInspector.messageSink.addMessage(WebInspector.UIString("%s resour
ce 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 this._cssURLsForSASSURL = {}; | 616 this._cssURLsForSASSURL = {}; |
617 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>}
*/ | 617 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>}
*/ |
618 this._pendingSourceMapLoadingCallbacks = {}; | 618 this._pendingSourceMapLoadingCallbacks = {}; |
619 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st
ring, !{timer: number, previousPoll: number}>}>} */ | 619 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st
ring, !{timer: number, previousPoll: number}>}>} */ |
620 this._pollDataForSASSURL = {}; | 620 this._pollDataForSASSURL = {}; |
621 /** @type {!Object.<string, !WebInspector.SourceMap>} */ | 621 /** @type {!Object.<string, !WebInspector.SourceMap>} */ |
622 this._sourceMapByURL = {}; | 622 this._sourceMapByURL = {}; |
623 this._sourceMapByStyleSheetURL = {}; | 623 this._sourceMapByStyleSheetURL = {}; |
624 } | 624 } |
625 } | 625 } |
OLD | NEW |