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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 return new WebInspector.CPUProfileHeader(this, profile.title, profile.ui
d); | 742 return new WebInspector.CPUProfileHeader(this, profile.title, profile.ui
d); |
743 }, | 743 }, |
744 | 744 |
745 /** | 745 /** |
746 * @override | 746 * @override |
747 * @param {!WebInspector.ProfileHeader} profile | 747 * @param {!WebInspector.ProfileHeader} profile |
748 */ | 748 */ |
749 removeProfile: function(profile) | 749 removeProfile: function(profile) |
750 { | 750 { |
751 WebInspector.ProfileType.prototype.removeProfile.call(this, profile); | 751 WebInspector.ProfileType.prototype.removeProfile.call(this, profile); |
752 if (!profile.isTemporary) | 752 if (!profile.isTemporary && !profile.fromFile()) |
753 ProfilerAgent.removeProfile(this.id, profile.uid); | 753 ProfilerAgent.removeProfile(this.id, profile.uid); |
754 }, | 754 }, |
755 | 755 |
756 /** | 756 /** |
757 * @override | 757 * @override |
758 * @param {function(this:WebInspector.ProfileType, ?string, Array.<ProfilerA
gent.ProfileHeader>)} populateCallback | 758 * @param {function(this:WebInspector.ProfileType, ?string, Array.<ProfilerA
gent.ProfileHeader>)} populateCallback |
759 */ | 759 */ |
760 _requestProfilesFromBackend: function(populateCallback) | 760 _requestProfilesFromBackend: function(populateCallback) |
761 { | 761 { |
762 ProfilerAgent.getProfileHeaders(populateCallback); | 762 ProfilerAgent.getProfileHeaders(populateCallback); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 function onOpen() | 912 function onOpen() |
913 { | 913 { |
914 ProfilerAgent.getCPUProfile(this.uid, getCPUProfileCallback.bind(thi
s)); | 914 ProfilerAgent.getCPUProfile(this.uid, getCPUProfileCallback.bind(thi
s)); |
915 } | 915 } |
916 | 916 |
917 this._fileName = this._fileName || "CPU-" + new Date().toISO8601Compact(
) + this._profileType.fileExtension(); | 917 this._fileName = this._fileName || "CPU-" + new Date().toISO8601Compact(
) + this._profileType.fileExtension(); |
918 fileOutputStream.open(this._fileName, onOpen.bind(this)); | 918 fileOutputStream.open(this._fileName, onOpen.bind(this)); |
919 }, | 919 }, |
920 | 920 |
921 /** | 921 /** |
922 * @param {File} file | 922 * @param {!File} file |
923 */ | 923 */ |
924 loadFromFile: function(file) | 924 loadFromFile: function(file) |
925 { | 925 { |
926 this.title = file.name; | |
927 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); | 926 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); |
928 this.sidebarElement.wait = true; | 927 this.sidebarElement.wait = true; |
929 | 928 |
930 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this
); | 929 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this
); |
931 fileReader.start(this); | 930 fileReader.start(this); |
932 }, | 931 }, |
933 | 932 |
934 __proto__: WebInspector.ProfileHeader.prototype | 933 __proto__: WebInspector.ProfileHeader.prototype |
935 } | 934 } |
OLD | NEW |