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

Side by Side Diff: Source/devtools/front_end/bindings/TempFile.js

Issue 1314783010: DevTools: fix race conditions while recording film strips (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use counter, not a flag to track reload suspension Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 var callsPendingOpen = this._callsPendingOpen; 291 var callsPendingOpen = this._callsPendingOpen;
292 this._callsPendingOpen = null; 292 this._callsPendingOpen = null;
293 for (var i = 0; i < callsPendingOpen.length; ++i) 293 for (var i = 0; i < callsPendingOpen.length; ++i)
294 callsPendingOpen[i](); 294 callsPendingOpen[i]();
295 if (this._chunks.length) 295 if (this._chunks.length)
296 this._writeNextChunk(); 296 this._writeNextChunk();
297 }, 297 },
298 298
299 _writeNextChunk: function() 299 _writeNextChunk: function()
300 { 300 {
301 // File was deleted while create or write was in-flight.
302 if (!this._tempFile)
303 return;
301 var chunk = this._chunks.shift(); 304 var chunk = this._chunks.shift();
302 this._isWriting = true; 305 this._isWriting = true;
303 this._tempFile.write(/** @type {!Array.<string>} */(chunk.strings), this ._didWriteChunk.bind(this, chunk.callback)); 306 this._tempFile.write(/** @type {!Array.<string>} */(chunk.strings), this ._didWriteChunk.bind(this, chunk.callback));
304 }, 307 },
305 308
306 /** 309 /**
307 * @param {?function(number)} callback 310 * @param {?function(number)} callback
308 * @param {number} size 311 * @param {number} size
309 */ 312 */
310 _didWriteChunk: function(callback, size) 313 _didWriteChunk: function(callback, size)
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 586
584 /** 587 /**
585 * @param {!WebInspector.OutputStream} outputStream 588 * @param {!WebInspector.OutputStream} outputStream
586 * @param {!WebInspector.OutputStreamDelegate} delegate 589 * @param {!WebInspector.OutputStreamDelegate} delegate
587 */ 590 */
588 writeToStream: function(outputStream, delegate) 591 writeToStream: function(outputStream, delegate)
589 { 592 {
590 this._file.writeToOutputStream(outputStream, delegate); 593 this._file.writeToOutputStream(outputStream, delegate);
591 } 594 }
592 } 595 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698