| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @implements {UI.Searchable} | 5 * @implements {UI.Searchable} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Profiler.ProfileView = class extends UI.SimpleView { | 8 Profiler.ProfileView = class extends UI.SimpleView { |
| 9 constructor() { | 9 constructor() { |
| 10 super(Common.UIString('Profile')); | 10 super(Common.UIString('Profile')); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 /** | 413 /** |
| 414 * @override | 414 * @override |
| 415 */ | 415 */ |
| 416 onTransferFinished() { | 416 onTransferFinished() { |
| 417 this.updateStatus(Common.UIString('Parsing\u2026'), true); | 417 this.updateStatus(Common.UIString('Parsing\u2026'), true); |
| 418 this._profile = JSON.parse(this._jsonifiedProfile); | 418 this._profile = JSON.parse(this._jsonifiedProfile); |
| 419 this._jsonifiedProfile = null; | 419 this._jsonifiedProfile = null; |
| 420 this.updateStatus(Common.UIString('Loaded'), false); | 420 this.updateStatus(Common.UIString('Loaded'), false); |
| 421 | 421 |
| 422 if (this._profileType.profileBeingRecorded() === this) | 422 if (this.profileType().profileBeingRecorded() === this) |
| 423 this._profileType.setProfileBeingRecorded(null); | 423 this.profileType().setProfileBeingRecorded(null); |
| 424 } | 424 } |
| 425 | 425 |
| 426 /** | 426 /** |
| 427 * @override | 427 * @override |
| 428 * @param {!Bindings.ChunkedReader} reader | 428 * @param {!Bindings.ChunkedReader} reader |
| 429 * @param {!Event} e | 429 * @param {!Event} e |
| 430 */ | 430 */ |
| 431 onError(reader, e) { | 431 onError(reader, e) { |
| 432 var subtitle; | 432 var subtitle; |
| 433 switch (e.target.error.code) { | 433 switch (e.target.error.code) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 if (this._failedToCreateTempFile) { | 505 if (this._failedToCreateTempFile) { |
| 506 Common.console.error('Failed to open temp file with heap snapshot'); | 506 Common.console.error('Failed to open temp file with heap snapshot'); |
| 507 fileOutputStream.close(); | 507 fileOutputStream.close(); |
| 508 } else if (this._tempFile) { | 508 } else if (this._tempFile) { |
| 509 this._tempFile.read(didRead); | 509 this._tempFile.read(didRead); |
| 510 } else { | 510 } else { |
| 511 this._onTempFileReady = onOpenForSave.bind(this, accepted); | 511 this._onTempFileReady = onOpenForSave.bind(this, accepted); |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 this._fileName = this._fileName || | 514 this._fileName = this._fileName || |
| 515 `${this._profileType.typeName()}-${new Date().toISO8601Compact()}${this.
_profileType.fileExtension()}`; | 515 `${this.profileType().typeName()}-${new Date().toISO8601Compact()}${this
.profileType().fileExtension()}`; |
| 516 fileOutputStream.open(this._fileName, onOpenForSave.bind(this)); | 516 fileOutputStream.open(this._fileName, onOpenForSave.bind(this)); |
| 517 } | 517 } |
| 518 | 518 |
| 519 /** | 519 /** |
| 520 * @override | 520 * @override |
| 521 * @param {!File} file | 521 * @param {!File} file |
| 522 */ | 522 */ |
| 523 loadFromFile(file) { | 523 loadFromFile(file) { |
| 524 this.updateStatus(Common.UIString('Loading\u2026'), true); | 524 this.updateStatus(Common.UIString('Loading\u2026'), true); |
| 525 var fileReader = new Bindings.ChunkedFileReader(file, 10000000, this); | 525 var fileReader = new Bindings.ChunkedFileReader(file, 10000000, this); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 tempFile.write([serializedData], didWriteToTempFile.bind(this)); | 575 tempFile.write([serializedData], didWriteToTempFile.bind(this)); |
| 576 } | 576 } |
| 577 | 577 |
| 578 _notifyTempFileReady() { | 578 _notifyTempFileReady() { |
| 579 if (this._onTempFileReady) { | 579 if (this._onTempFileReady) { |
| 580 this._onTempFileReady(); | 580 this._onTempFileReady(); |
| 581 this._onTempFileReady = null; | 581 this._onTempFileReady = null; |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 }; | 584 }; |
| OLD | NEW |