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 = { ...@@ -382,6 +382,7 @@ WebInspector.DeferredTempFile.prototype = {
} }
if (this._tempFile) if (this._tempFile)
this._tempFile.remove(); this._tempFile.remove();
this._tempFile = null;
} }
} }
......
...@@ -730,6 +730,9 @@ WebInspector.NetworkPanel.FilmStripRecorder.prototype = { ...@@ -730,6 +730,9 @@ WebInspector.NetworkPanel.FilmStripRecorder.prototype = {
return; return;
this._target = WebInspector.targetManager.mainTarget(); this._target = WebInspector.targetManager.mainTarget();
if (this._tracingModel)
this._tracingModel.reset();
else
this._tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing")); this._tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing"));
this._target.tracingManager.start(this, "-*,disabled-by-default-devtools.screenshot", ""); this._target.tracingManager.start(this, "-*,disabled-by-default-devtools.screenshot", "");
this._filmStripView.reset(); this._filmStripView.reset();
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
*/ */
WebInspector.TracingModel = function(backingStorage) WebInspector.TracingModel = function(backingStorage)
{ {
this._backingStorage = backingStorage;
this.reset(); 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,6 +192,7 @@ WebInspector.TracingModel.prototype = { ...@@ -190,6 +192,7 @@ WebInspector.TracingModel.prototype = {
this._minimumRecordTime = 0; this._minimumRecordTime = 0;
this._maximumRecordTime = 0; this._maximumRecordTime = 0;
this._devToolsMetadataEvents = []; this._devToolsMetadataEvents = [];
if (this._backingStorage)
this._backingStorage.reset(); this._backingStorage.reset();
this._appendDelimiter = false; this._appendDelimiter = false;
/** @type {!Array<!WebInspector.TracingModel.Event>} */ /** @type {!Array<!WebInspector.TracingModel.Event>} */
......
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