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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js

Issue 2563383003: DevTools: add extension API to contribute trace events to timeline (Closed)
Patch Set: lint + new compiler warnings Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js b/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js
index ed0573df27f394ee59d36e1fc5e7a38c91753d47..a402a1685c258d1e27851aa7db0c50396e20e63a 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js
@@ -463,6 +463,8 @@ Bindings.TempFileBackingStorage = class {
this._fileSize = fileSize;
}
+ if (!this._file)
+ this._file = new Bindings.DeferredTempFile(this._dirName, String(Date.now()));
this._file.write(this._strings, didWrite.bind(this, chunk));
this._strings = [];
this._stringsLength = 0;
@@ -483,7 +485,7 @@ Bindings.TempFileBackingStorage = class {
reset() {
if (this._file)
this._file.remove();
- this._file = new Bindings.DeferredTempFile(this._dirName, String(Date.now()));
+ this._file = null;
/**
* @type {!Array.<string>}
*/
@@ -497,7 +499,8 @@ Bindings.TempFileBackingStorage = class {
* @param {!Bindings.OutputStreamDelegate} delegate
*/
writeToStream(outputStream, delegate) {
- this._file.copyToOutputStream(outputStream, delegate);
+ if (this._file)
+ this._file.copyToOutputStream(outputStream, delegate);
}
};

Powered by Google App Engine
This is Rietveld 408576698