OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 if (!accepted) | 792 if (!accepted) |
793 return; | 793 return; |
794 function didRead(data) | 794 function didRead(data) |
795 { | 795 { |
796 if (data) | 796 if (data) |
797 fileOutputStream.write(data, fileOutputStream.close.bind(fil
eOutputStream)); | 797 fileOutputStream.write(data, fileOutputStream.close.bind(fil
eOutputStream)); |
798 else | 798 else |
799 fileOutputStream.close(); | 799 fileOutputStream.close(); |
800 } | 800 } |
801 if (this._failedToCreateTempFile) { | 801 if (this._failedToCreateTempFile) { |
802 WebInspector.console.log("Failed to open temp file with heap sna
pshot", | 802 WebInspector.messageSink.addErrorMessage("Failed to open temp fi
le with heap snapshot"); |
803 WebInspector.ConsoleMessage.MessageLevel.Error)
; | |
804 fileOutputStream.close(); | 803 fileOutputStream.close(); |
805 } else if (this._tempFile) { | 804 } else if (this._tempFile) { |
806 this._tempFile.read(didRead); | 805 this._tempFile.read(didRead); |
807 } else { | 806 } else { |
808 this._onTempFileReady = onOpenForSave.bind(this, accepted); | 807 this._onTempFileReady = onOpenForSave.bind(this, accepted); |
809 } | 808 } |
810 } | 809 } |
811 this._fileName = this._fileName || "CPU-" + new Date().toISO8601Compact(
) + this._profileType.fileExtension(); | 810 this._fileName = this._fileName || "CPU-" + new Date().toISO8601Compact(
) + this._profileType.fileExtension(); |
812 fileOutputStream.open(this._fileName, onOpenForSave.bind(this)); | 811 fileOutputStream.open(this._fileName, onOpenForSave.bind(this)); |
813 }, | 812 }, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 _notifyTempFileReady: function() | 887 _notifyTempFileReady: function() |
889 { | 888 { |
890 if (this._onTempFileReady) { | 889 if (this._onTempFileReady) { |
891 this._onTempFileReady(); | 890 this._onTempFileReady(); |
892 this._onTempFileReady = null; | 891 this._onTempFileReady = null; |
893 } | 892 } |
894 }, | 893 }, |
895 | 894 |
896 __proto__: WebInspector.ProfileHeader.prototype | 895 __proto__: WebInspector.ProfileHeader.prototype |
897 } | 896 } |
OLD | NEW |