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

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

Issue 2702583003: DevTools: do not assign empty content to CSS UISourceCode in case of protocol error (Closed)
Patch Set: fix test Created 3 years, 10 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return; 262 return;
263 header.requestContent().then(callback.bind(this, uiSourceCode)); 263 header.requestContent().then(callback.bind(this, uiSourceCode));
264 264
265 /** 265 /**
266 * @param {!Workspace.UISourceCode} uiSourceCode 266 * @param {!Workspace.UISourceCode} uiSourceCode
267 * @param {?string} content 267 * @param {?string} content
268 * @this {Bindings.StylesSourceMapping} 268 * @this {Bindings.StylesSourceMapping}
269 */ 269 */
270 function callback(uiSourceCode, content) { 270 function callback(uiSourceCode, content) {
271 var styleFile = this._styleFiles.get(uiSourceCode); 271 var styleFile = this._styleFiles.get(uiSourceCode);
272 if (styleFile) 272 if (typeof content === 'string' && styleFile)
273 styleFile.addRevision(content || ''); 273 styleFile.addRevision(content);
274 this._styleFileSyncedForTest();
274 } 275 }
275 } 276 }
276 277
278 _styleFileSyncedForTest() {
279 }
280
277 dispose() { 281 dispose() {
278 Common.EventTarget.removeEventListeners(this._eventListeners); 282 Common.EventTarget.removeEventListeners(this._eventListeners);
279 } 283 }
280 }; 284 };
281 285
282 Bindings.StylesSourceMapping.ChangeUpdateTimeoutMs = 200; 286 Bindings.StylesSourceMapping.ChangeUpdateTimeoutMs = 200;
283 287
284 /** 288 /**
285 * @unrestricted 289 * @unrestricted
286 */ 290 */
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 356
353 dispose() { 357 dispose() {
354 if (this._terminated) 358 if (this._terminated)
355 return; 359 return;
356 this._terminated = true; 360 this._terminated = true;
357 Common.EventTarget.removeEventListeners(this._eventListeners); 361 Common.EventTarget.removeEventListeners(this._eventListeners);
358 } 362 }
359 }; 363 };
360 364
361 Bindings.StyleFile.updateTimeout = 200; 365 Bindings.StyleFile.updateTimeout = 200;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698