Changeset 118742 in webkit
- Timestamp:
- May 29, 2012 2:17:36 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118741 r118742 1 2012-05-29 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: REGRESSION: load heap snapshot doesn't work. 4 https://bugs.webkit.org/show_bug.cgi?id=87642 5 6 HeapSnapshotReceiver interface was introduced. 7 It declares the API for HSLoader, HSLoaderProxy and HSSaveToFileReceiver. 8 The HeapProfileHeader was refactored and tests were added. 9 10 Reviewed by Yury Semikhatsky. 11 12 * inspector/profiler/heap-snapshot-loader-expected.txt: 13 * inspector/profiler/heap-snapshot-loader.html: 14 15 2012-05-29 Marcus Bulach <bulach@chromium.org> 16 17 Test expectation pngs missing checksums are treated as MISSING by bots 18 https://bugs.webkit.org/show_bug.cgi?id=87552 19 20 Unreviewed gardening. 21 22 This test was already failing for IMAGE and TEXT reasons prior to r118566. 23 On r118566, new images were added, probably without an embedded checksum. 24 It looks like our test infrastructure thinks that these images are MISSING. 25 Temporarily add MISSING expectations, so that we can proceed with this (failing) test. 26 27 * platform/chromium/test_expectations.txt: 28 1 29 2012-05-29 Marcus Bulach <bulach@chromium.org> 2 30 -
trunk/LayoutTests/inspector/profiler/heap-snapshot-loader-expected.txt
r116771 r118742 4 4 Running: heapSnapshotLoaderTest 5 5 6 Running: heapSnapshotSaveToFileTest 7 8 Running: heapSnapshotLoadFromFileTest 9 -
trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html
r116771 r118742 12 12 } 13 13 14 var source = InspectorTest.createHeapSnapshotMockRaw(); 15 var sourceStringified = JSON.stringify(source); 16 var partSize = sourceStringified.length >> 3; 17 14 18 InspectorTest.runTestSuite([ 15 19 function heapSnapshotLoaderTest(next) 16 20 { 17 var source = InspectorTest.createHeapSnapshotMockRaw();18 var sourceStringified = JSON.stringify(source);19 var partSize = sourceStringified.length >> 3;20 21 var loader = new WebInspector.HeapSnapshotLoader(); 21 22 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) … … 26 27 InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock()), result); 27 28 next(); 29 }, 30 31 function heapSnapshotSaveToFileTest(next) 32 { 33 var profileUID = 42; 34 35 var dispatcher = InspectorBackend._domainDispatchers["Profiler"]; 36 var panel = WebInspector.panels.profiles; 37 38 dispatcher.addProfileHeader({ 39 typeId: WebInspector.HeapSnapshotProfileType.TypeId, 40 title: "heapSnapshotSaveToFileTest", 41 uid: profileUID, 42 maxJSObjectId: 6 43 }); 44 45 var profileHeader = panel._profiles[0]; 46 47 var oldGetProfile = ProfilerAgent.getProfile; 48 ProfilerAgent.getProfile = function getProfileMock(profileTypeName, uid) { 49 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) 50 dispatcher.addHeapSnapshotChunk(uid, sourceStringified.slice(i, i + partSize)); 51 dispatcher.finishHeapSnapshot(uid); 52 }; 53 54 var savedSnapshotData; 55 var oldSave = InspectorFrontendHost.save; 56 InspectorFrontendHost.save = function saveMock(url, data) 57 { 58 savedSnapshotData = data; 59 WebInspector.fileManager.savedURL(url); 60 } 61 62 var oldAppend = InspectorFrontendHost.append; 63 InspectorFrontendHost.append = function appendMock(url, data) 64 { 65 savedSnapshotData += data; 66 WebInspector.fileManager.appendedToURL(url); 67 } 68 69 function parsed() 70 { 71 profileHeader.saveToFile(); 72 InspectorTest.assertEquals(sourceStringified, savedSnapshotData, "Saved snapshot data"); 73 74 InspectorFrontendHost.save = oldSave; 75 InspectorFrontendHost.append = oldAppend; 76 ProfilerAgent.getProfile = oldGetProfile; 77 next(); 78 } 79 InspectorTest.addSniffer(profileHeader, "_parsed", parsed); 80 81 panel.showProfile(profileHeader); 82 }, 83 84 function heapSnapshotLoadFromFileTest(next) 85 { 86 var panel = WebInspector.panels.profiles; 87 88 var fileMock = { 89 name: "mock.heapsnapshot", 90 size: sourceStringified.length, 91 webkitSlice: function(begin, end) { 92 return this; 93 } 94 }; 95 96 WebInspector.HeapProfileHeader.prototype._createFileReader = function() { 97 return { 98 readAsText: function(filePart) { 99 var profileHeader = panel._profiles[panel._profiles.length - 1]; 100 InspectorTest.addSniffer(profileHeader, "_parsed", function parsed() { next(); }); 101 profileHeader._nextChunkLoaded(sourceStringified); 102 } 103 }; 104 } 105 panel._loadFromFile(fileMock); 28 106 } 29 107 ]); -
trunk/Source/WebCore/ChangeLog
r118737 r118742 1 2012-05-29 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: REGRESSION: load heap snapshot doesn't work. 4 https://bugs.webkit.org/show_bug.cgi?id=87642 5 6 HeapSnapshotReceiver interface was introduced. 7 It declares the API for HeapSnapshotLoader, HeapSnapshotLoaderProxy and HeapSnapshotSaveToFileReceiver. 8 The HeapProfileHeader was refactored and tests were added. 9 10 Reviewed by Yury Semikhatsky. 11 12 * inspector/front-end/HeapSnapshotLoader.js: 13 (WebInspector.HeapSnapshotLoader): 14 (WebInspector.HeapSnapshotLoader.prototype.startLoading): 15 (WebInspector.HeapSnapshotLoader.prototype.dispose): 16 (WebInspector.HeapSnapshotLoader.prototype._reset): 17 (WebInspector.HeapSnapshotLoader.prototype.finishLoading): 18 * inspector/front-end/HeapSnapshotProxy.js: 19 (WebInspector.HeapSnapshotWorker.prototype.startCheckingForLongRunningCalls): 20 (WebInspector.HeapSnapshotLoaderProxy.prototype.startLoading): 21 (WebInspector.HeapSnapshotLoaderProxy.prototype.pushJSONChunk): 22 (WebInspector.HeapSnapshotLoaderProxy.prototype.finishLoading): 23 * inspector/front-end/HeapSnapshotView.js: 24 (WebInspector.HeapSnapshotReceiver): 25 (WebInspector.HeapSnapshotReceiver.prototype.startLoading): 26 (WebInspector.HeapSnapshotReceiver.prototype.pushJSONChunk): 27 (WebInspector.HeapSnapshotReceiver.prototype.finishLoading): 28 (WebInspector.HeapSnapshotReceiver.prototype.dispose): 29 (WebInspector.HeapProfileHeader): 30 (WebInspector.HeapProfileHeader.prototype.load): 31 (WebInspector.HeapProfileHeader.prototype._setupWorker): 32 (WebInspector.HeapProfileHeader.prototype.dispose): 33 (WebInspector.HeapProfileHeader.prototype._saveStatusUpdate): 34 (WebInspector.HeapProfileHeader.prototype.pushJSONChunk): 35 (WebInspector.HeapProfileHeader.prototype._parsed): 36 (WebInspector.HeapProfileHeader.prototype.finishHeapSnapshot): 37 (WebInspector.HeapProfileHeader.prototype.saveToFile): 38 (WebInspector.HeapProfileHeader.prototype.loadFromFile.onLoad): 39 (WebInspector.HeapProfileHeader.prototype.loadFromFile): 40 (WebInspector.HeapProfileHeader.prototype._loadNextChunk): 41 (WebInspector.HeapProfileHeader.prototype._nextChunkLoaded): 42 (WebInspector.HeapProfileHeader.prototype._createFileReader): 43 (WebInspector.HeapSnapshotSaveToFileReceiver): 44 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype.startLoading): 45 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype.pushJSONChunk): 46 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype.finishLoading): 47 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype.dispose): 48 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype._startSavingSnapshot): 49 (WebInspector.HeapSnapshotSaveToFileReceiver.prototype._saveStatusUpdate): 50 * inspector/front-end/ProfilesPanel.js: 51 (WebInspector.ProfilesPanel.prototype._createFileSelectorElement.onChange): 52 (WebInspector.ProfilesPanel.prototype._createFileSelectorElement): 53 (WebInspector.ProfilesPanel.prototype._loadFromFile): 54 1 55 2012-05-29 Eric Seidel <eric@webkit.org> 2 56 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshotLoader.js
r118521 r118742 31 31 /** 32 32 * @constructor 33 * @implements {WebInspector.HeapSnapshotReceiver} 33 34 */ 34 35 WebInspector.HeapSnapshotLoader = function() 35 36 { 36 this._json = ""; 37 this._state = "find-snapshot-info"; 38 this._snapshot = {}; 37 this._reset(); 39 38 } 40 39 41 40 WebInspector.HeapSnapshotLoader.prototype = { 41 /** 42 * @param {function(WebInspector.HeapSnapshotProxy)} callback 43 * @return {boolean} 44 */ 45 startLoading: function(callback) 46 { 47 return true; 48 }, 49 50 dispose: function() 51 { 52 this._reset(); 53 }, 54 55 _reset: function() 56 { 57 this._json = ""; 58 this._state = "find-snapshot-info"; 59 this._snapshot = {}; 60 }, 61 42 62 _findBalancedCurlyBrackets: function() 43 63 { … … 61 81 return null; 62 82 this._parseStringsArray(); 63 this._json = "";64 83 var result = new WebInspector.HeapSnapshot(this._snapshot); 65 this._json = ""; 66 this._snapshot = {}; 84 this._reset(); 67 85 return result; 68 86 }, … … 115 133 }, 116 134 135 /** 136 * @param {string} chunk 137 */ 117 138 pushJSONChunk: function(chunk) 118 139 { -
trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js
r118348 r118742 246 246 startCheckingForLongRunningCalls: function() 247 247 { 248 if (this._interval) 249 return; 248 250 this._checkLongRunningCalls(); 249 251 this._interval = setInterval(this._checkLongRunningCalls.bind(this), 300); … … 354 356 * @constructor 355 357 * @extends {WebInspector.HeapSnapshotProxyObject} 358 * @implements {WebInspector.HeapSnapshotReceiver} 356 359 */ 357 360 WebInspector.HeapSnapshotLoaderProxy = function(worker, objectId) … … 362 365 363 366 WebInspector.HeapSnapshotLoaderProxy.prototype = { 367 /** 368 * @param {function(WebInspector.HeapSnapshotProxy)} callback 369 * @return {boolean} 370 */ 371 startLoading: function(callback) 372 { 373 var loadingHasJustStarted = !this._onLoadCallbacks.length; 374 this._onLoadCallbacks.push(callback); 375 return loadingHasJustStarted; 376 }, 377 378 /** 379 * @param {string} chunk 380 */ 381 pushJSONChunk: function(chunk) 382 { 383 this.callMethod(null, "pushJSONChunk", chunk); 384 }, 385 364 386 /** 365 387 * @param {function(WebInspector.HeapSnapshotProxy)} callback … … 381 403 } 382 404 this.callFactoryMethod(updateStaticData.bind(this), "finishLoading", "WebInspector.HeapSnapshotProxy"); 383 },384 385 /**386 * @param {function(WebInspector.HeapSnapshotProxy)} callback387 * @return {boolean}388 */389 startLoading: function(callback)390 {391 var loadingHasJustStarted = !this._onLoadCallbacks.length;392 this._onLoadCallbacks.push(callback);393 return loadingHasJustStarted;394 },395 396 pushJSONChunk: function(chunk)397 {398 this.callMethod(null, "pushJSONChunk", chunk);399 405 } 400 406 }; -
trunk/Source/WebCore/inspector/front-end/HeapSnapshotView.js
r118350 r118742 786 786 WebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype; 787 787 788 789 /** 790 * @interface 791 */ 792 WebInspector.HeapSnapshotReceiver = function() 793 { 794 } 795 796 WebInspector.HeapSnapshotReceiver.prototype = { 797 /** 798 * @param {function(WebInspector.HeapSnapshotProxy)} callback 799 * @return {boolean} 800 */ 801 startLoading: function(callback) 802 { 803 }, 804 805 /** 806 * @param {string} chunk 807 */ 808 pushJSONChunk: function(chunk) 809 { 810 }, 811 812 /** 813 * @param {function(WebInspector.HeapSnapshotProxy)} callback 814 */ 815 finishLoading: function(callback) 816 { 817 }, 818 819 dispose: function() 820 { 821 } 822 }; 823 788 824 /** 789 825 * @constructor … … 799 835 this.maxJSObjectId = maxJSObjectId; 800 836 /** 801 * @type {WebInspector.HeapSnapshot LoaderProxy}802 */ 803 this._ loaderProxy= null;837 * @type {WebInspector.HeapSnapshotReceiver} 838 */ 839 this._receiver = null; 804 840 /** 805 841 * @type {WebInspector.HeapSnapshotProxy} … … 842 878 } 843 879 844 if (!this._ loaderProxy)880 if (!this._receiver) 845 881 this._setupWorker(); 846 882 847 if (this._loaderProxy.startLoading(callback)) { 883 this._numberOfChunks = 0; 884 if (this._receiver.startLoading(callback)) { 848 885 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); 849 886 this.sidebarElement.wait = true; … … 859 896 var worker = new WebInspector.HeapSnapshotWorker(); 860 897 worker.addEventListener("wait", setProfileWait, this); 861 this._ loaderProxy= worker.createObject("WebInspector.HeapSnapshotLoader");898 this._receiver = worker.createObject("WebInspector.HeapSnapshotLoader"); 862 899 }, 863 900 864 901 dispose: function() 865 902 { 866 if (this._ loaderProxy)867 this._ loaderProxy.dispose();903 if (this._receiver) 904 this._receiver.dispose(); 868 905 else if (this._snapshotProxy) 869 906 this._snapshotProxy.dispose(); … … 871 908 872 909 /** 873 * @param {WebInspector.Event} event 874 */ 875 _saveStatusUpdate: function(event) 876 { 877 if (event.data !== this._fileName) 878 return; 879 if (++this._savedChunksCount === this._totalNumberOfChunks) { 910 * @param {number} savedChunksCount 911 */ 912 _saveStatusUpdate: function(savedChunksCount) 913 { 914 if (savedChunksCount === this._totalNumberOfChunks) { 880 915 this.sidebarElement.subtitle = Number.bytesToString(this._snapshotProxy.totalSize); 881 916 this.sidebarElement.wait = false; 882 917 this._savedChunksCount = 0; 883 WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._saveStatusUpdate, this);884 918 } else 885 this.sidebarElement.subtitle = WebInspector.UIString("Saving\u2026 %d\%", ( this._savedChunksCount * 100 / this._totalNumberOfChunks).toFixed(2));919 this.sidebarElement.subtitle = WebInspector.UIString("Saving\u2026 %d\%", (savedChunksCount * 100 / this._totalNumberOfChunks).toFixed(2)); 886 920 }, 887 921 … … 891 925 pushJSONChunk: function(chunk) 892 926 { 893 if (this._loaderProxy) { 894 ++this._totalNumberOfChunks; 895 this._loaderProxy.pushJSONChunk(chunk); 896 } else { 897 this.sidebarElement.wait = true; 898 WebInspector.fileManager.append(this._fileName, chunk); 899 } 927 ++this._numberOfChunks; 928 this._receiver.pushJSONChunk(chunk); 929 }, 930 931 _parsed: function(snapshotProxy) 932 { 933 this._receiver = null; 934 if (snapshotProxy) 935 this._snapshotProxy = snapshotProxy; 936 this.sidebarElement.subtitle = Number.bytesToString(this._snapshotProxy.totalSize); 937 this.sidebarElement.wait = false; 938 var worker = /** @type {WebInspector.HeapSnapshotWorker} */ this._snapshotProxy.worker; 939 this.isTemporary = false; 940 worker.startCheckingForLongRunningCalls(); 900 941 }, 901 942 902 943 finishHeapSnapshot: function() 903 944 { 904 function parsed(snapshotProxy) 905 { 906 this._loaderProxy = null; 907 this._snapshotProxy = snapshotProxy; 908 this.sidebarElement.subtitle = Number.bytesToString(snapshotProxy.totalSize); 909 this.sidebarElement.wait = false; 910 var worker = /** @type {WebInspector.HeapSnapshotWorker} */ snapshotProxy.worker; 911 this.isTemporary = false; 912 worker.startCheckingForLongRunningCalls(); 913 } 914 if (this._loaderProxy.finishLoading(parsed.bind(this))) 945 this._totalNumberOfChunks = this._numberOfChunks; 946 if (this._receiver.finishLoading(this._parsed.bind(this))) 915 947 this.sidebarElement.subtitle = WebInspector.UIString("Parsing\u2026"); 916 948 }, … … 930 962 saveToFile: function() 931 963 { 932 /**933 * @param {WebInspector.Event} event934 */935 function startSavingSnapshot(event)936 {937 if (event.data !== this._fileName)938 return;939 this.sidebarElement.wait = true;940 this.sidebarElement.subtitle = WebInspector.UIString("Saving\u2026 %d\%", 0);941 this._savedChunksCount = 0;942 WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, startSavingSnapshot, this);943 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._saveStatusUpdate, this);944 ProfilerAgent.getProfile(this.profileType().id, this.uid);945 }946 947 964 this._fileName = this._fileName || "Heap-" + new Date().toISO8601Compact() + ".heapsnapshot"; 948 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.SavedURL, startSavingSnapshot, this);949 WebInspector.fileManager.save(this._fileName, "", true);965 this._receiver = new WebInspector.HeapSnapshotSaveToFileReceiver(this._fileName, this); 966 this._receiver.startLoading(function(snapshot) { }); 950 967 }, 951 968 … … 984 1001 this.sidebarElement.wait = true; 985 1002 this._setupWorker(); 986 this._loaderProxy.startLoading(function(ignoredSnapshotProxy) { }); 987 988 function loadNextChunk(file, reader, loadedSize) 989 { 990 var chunkSize = 10000000; 991 var size = file.size < loadedSize + chunkSize ? file.size - loadedSize : chunkSize; 992 var nextPart = file.webkitSlice(loadedSize, loadedSize + size); 993 reader.readAsText(nextPart); 994 } 1003 this._numberOfChunks = 0; 1004 this._receiver.startLoading(function(ignoredSnapshotProxy) { }); 995 1005 996 1006 /** … … 1001 1011 if (event.target.readyState !== FileReader.DONE) 1002 1012 return; 1003 1004 this._loadedSize += event.target.result.length; 1005 this._loaderProxy.pushJSONChunk(event.target.result); 1006 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026 %d%", (this._loadedSize * 100 / file.size).toFixed(2)); 1007 1008 if (this._loadedSize === file.size) { 1009 this.finishHeapSnapshot(); 1010 return; 1011 } 1012 1013 loadNextChunk(file, reader, this._loadedSize); 1014 } 1015 1016 var reader = new FileReader(); 1017 reader.onload = onLoad.bind(this); 1018 reader.onerror = onError; 1013 this._nextChunkLoaded(event.target.result); 1014 } 1015 1016 this._file = file; 1017 this._expectedSize = file.size; 1019 1018 this._loadedSize = 0; 1020 loadNextChunk(file, reader, this._loadedSize); 1019 this._reader = this._createFileReader(); 1020 this._reader.onload = onLoad.bind(this); 1021 this._reader.onerror = onError; 1022 this._loadNextChunk(); 1023 }, 1024 1025 _loadNextChunk: function() 1026 { 1027 var loadedSize = this._loadedSize; 1028 var chunkSize = 10000000; 1029 var size = this._expectedSize < loadedSize + chunkSize ? this._expectedSize - loadedSize : chunkSize; 1030 var nextPart = this._file.webkitSlice(loadedSize, loadedSize + size); 1031 this._reader.readAsText(nextPart); 1032 }, 1033 1034 _nextChunkLoaded: function(data) 1035 { 1036 this._loadedSize += data.length; 1037 this._receiver.pushJSONChunk(data); 1038 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026 %d%", (this._loadedSize * 100 / this._expectedSize).toFixed(2)); 1039 1040 if (this._loadedSize === this._expectedSize) { 1041 this._file = null; 1042 this._reader = null; 1043 this.finishHeapSnapshot(); 1044 return; 1045 } 1046 this._loadNextChunk(); 1047 }, 1048 1049 _createFileReader: function() 1050 { 1051 return new FileReader(); 1021 1052 } 1022 1053 } 1023 1054 1024 1055 WebInspector.HeapProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype; 1056 1057 1058 /** 1059 * @constructor 1060 * @implements {WebInspector.HeapSnapshotReceiver} 1061 */ 1062 WebInspector.HeapSnapshotSaveToFileReceiver = function(fileName, snapshotHeader) 1063 { 1064 this._fileName = fileName; 1065 this._snapshotHeader = snapshotHeader; 1066 this._savedChunks = 0; 1067 this._finishLoadingCallbacks = []; 1068 } 1069 1070 WebInspector.HeapSnapshotSaveToFileReceiver.prototype = { 1071 /** 1072 * @param {function(WebInspector.HeapSnapshotProxy)} callback 1073 * @return {boolean} 1074 */ 1075 startLoading: function(callback) 1076 { 1077 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.SavedURL, this._startSavingSnapshot, this); 1078 WebInspector.fileManager.save(this._fileName, "", true); 1079 if (callback) 1080 this._finishLoadingCallbacks.push(callback); 1081 return true; 1082 }, 1083 1084 /** 1085 * @param {string} chunk 1086 */ 1087 pushJSONChunk: function(chunk) 1088 { 1089 WebInspector.fileManager.append(this._fileName, chunk); 1090 }, 1091 1092 /** 1093 * @param {function(WebInspector.HeapSnapshotProxy)} callback 1094 */ 1095 finishLoading: function(callback) 1096 { 1097 this._finishLoadingCallbacks.push(callback); 1098 for (var i = 0; i < this._finishLoadingCallbacks.length; ++i) 1099 this._finishLoadingCallbacks[i](null); 1100 }, 1101 1102 dispose: function() 1103 { 1104 }, 1105 1106 /** 1107 * @param {WebInspector.Event} event 1108 */ 1109 _startSavingSnapshot: function(event) 1110 { 1111 if (event.data !== this._fileName) 1112 return; 1113 this._snapshotHeader._saveStatusUpdate(0); 1114 WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, this._startSavingSnapshot, this); 1115 WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._saveStatusUpdate, this); 1116 ProfilerAgent.getProfile(this._snapshotHeader.profileType().id, this._snapshotHeader.uid); 1117 }, 1118 1119 /** 1120 * @param {WebInspector.Event} event 1121 */ 1122 _saveStatusUpdate: function(event) 1123 { 1124 if (event.data !== this._fileName) 1125 return; 1126 this._snapshotHeader._saveStatusUpdate(++this._savedChunks); 1127 if (this._savedChunks === this._snapshotHeader._totalNumberOfChunks) 1128 WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._saveStatusUpdate, this); 1129 } 1130 }; 1131 -
trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js
r118662 r118742 265 265 fileSelectorElement.style.zIndex = -1; 266 266 fileSelectorElement.style.position = "absolute"; 267 fileSelectorElement.onchange = this._loadFromFile.bind(this); 267 function onChange(event) { 268 this._loadFromFile(this._fileSelectorElement.files[0]); 269 } 270 fileSelectorElement.onchange = onChange.bind(this); 268 271 this.element.appendChild(fileSelectorElement); 269 272 this._fileSelectorElement = fileSelectorElement; 270 273 }, 271 274 272 _loadFromFile: function(event) 273 { 274 var file = this._fileSelectorElement.files[0]; 275 _loadFromFile: function(file) 276 { 275 277 if (!file.name.endsWith(".heapsnapshot")) { 276 278 WebInspector.log(WebInspector.UIString("Only heap snapshots from files with extension '.heapsnapshot' can be loaded."));
Note: See TracChangeset
for help on using the changeset viewer.