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

Unified Diff: Source/devtools/front_end/HeapSnapshotView.js

Issue 132993009: Use mock temp file in profiler tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comment Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/HeapSnapshotView.js
diff --git a/Source/devtools/front_end/HeapSnapshotView.js b/Source/devtools/front_end/HeapSnapshotView.js
index 414e2b88e38ca187e126032ef26b4a43dafec52f..60f951bab0f8cca41d5ddf849e2d0920e62d8771 100644
--- a/Source/devtools/front_end/HeapSnapshotView.js
+++ b/Source/devtools/front_end/HeapSnapshotView.js
@@ -1301,6 +1301,8 @@ WebInspector.HeapProfileHeader.prototype = {
_didCompleteSnapshotTransfer: function()
{
+ if (!this._snapshotProxy)
+ return;
this.sidebarElement.subtitle = Number.bytesToString(this._snapshotProxy.totalSize);
this.sidebarElement.wait = false;
},
@@ -1372,33 +1374,13 @@ WebInspector.HeapProfileHeader.prototype = {
{
if (!accepted)
return;
- /**
- * @param {!File} file
- * @this {WebInspector.HeapProfileHeader}
- */
- function didGetFile(file)
- {
- if (!file) {
- reportTempFileError();
- return;
- }
-
- var delegate = new WebInspector.SaveSnapshotOutputStreamDelegate(this);
- var reader = new WebInspector.ChunkedFileReader(file, 10*1000*1000, delegate)
- reader.start(fileOutputStream);
- }
-
- function reportTempFileError()
- {
+ if (this._failedToCreateTempFile) {
WebInspector.log("Failed to open temp file with heap snapshot",
WebInspector.ConsoleMessage.MessageLevel.Error);
fileOutputStream.close();
- }
-
- if (this._failedToCreateTempFile) {
- reportTempFileError();
} else if (this._tempFile) {
- this._tempFile.getFile(didGetFile.bind(this));
+ var delegate = new WebInspector.SaveSnapshotOutputStreamDelegate(this);
+ this._tempFile.writeToOutputSteam(fileOutputStream, delegate);
} else {
this._onTempFileReady = onOpen.bind(this, accepted);
this._updateSaveProgress(0, 1);
« no previous file with comments | « LayoutTests/inspector/profiler/heap-snapshot-loader-expected.txt ('k') | Source/devtools/front_end/TempFile.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698