Commit 9df18a21 authored by caseq@chromium.org's avatar caseq@chromium.org

DevTools: fix 'Failed to write into a temp file' when recording a filmstrip

BUG=524107

Review URL: https://codereview.chromium.org/1310343007

git-svn-id: svn://svn.chromium.org/blink/trunk@201758 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b66c5db3
......@@ -382,6 +382,7 @@ WebInspector.DeferredTempFile.prototype = {
}
if (this._tempFile)
this._tempFile.remove();
this._tempFile = null;
}
}
......
......@@ -730,7 +730,10 @@ WebInspector.NetworkPanel.FilmStripRecorder.prototype = {
return;
this._target = WebInspector.targetManager.mainTarget();
this._tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing"));
if (this._tracingModel)
this._tracingModel.reset();
else
this._tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing"));
this._target.tracingManager.start(this, "-*,disabled-by-default-devtools.screenshot", "");
this._filmStripView.reset();
this._filmStripView.setStatusText(WebInspector.UIString("Recording frames..."));
......
......@@ -10,8 +10,10 @@
*/
WebInspector.TracingModel = function(backingStorage)
{
this._backingStorage = backingStorage;
this.reset();
// Set backing storage after reset so that we do not perform
// an extra reset of backing storage -- this is not free.
this._backingStorage = backingStorage;
}
/**
......@@ -190,7 +192,8 @@ WebInspector.TracingModel.prototype = {
this._minimumRecordTime = 0;
this._maximumRecordTime = 0;
this._devToolsMetadataEvents = [];
this._backingStorage.reset();
if (this._backingStorage)
this._backingStorage.reset();
this._appendDelimiter = false;
/** @type {!Array<!WebInspector.TracingModel.Event>} */
this._asyncEvents = [];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment