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

Side by Side Diff: Source/devtools/front_end/profiler/CPUProfileView.js

Issue 705063004: DevTools: Promisify WebInspector.TempFile (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: a few more promises were added Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 { 841 {
842 var serializedData = JSON.stringify(data); 842 var serializedData = JSON.stringify(data);
843 843
844 /** 844 /**
845 * @this {WebInspector.CPUProfileHeader} 845 * @this {WebInspector.CPUProfileHeader}
846 */ 846 */
847 function didCreateTempFile(tempFile) 847 function didCreateTempFile(tempFile)
848 { 848 {
849 this._writeToTempFile(tempFile, serializedData); 849 this._writeToTempFile(tempFile, serializedData);
850 } 850 }
851 new WebInspector.TempFile("cpu-profiler", String(this.uid), didCreateTem pFile.bind(this)); 851 WebInspector.TempFile.create("cpu-profiler", String(this.uid))
852 .then(didCreateTempFile.bind(this));
852 }, 853 },
853 854
854 /** 855 /**
855 * @param {?WebInspector.TempFile} tempFile 856 * @param {?WebInspector.TempFile} tempFile
856 * @param {string} serializedData 857 * @param {string} serializedData
857 */ 858 */
858 _writeToTempFile: function(tempFile, serializedData) 859 _writeToTempFile: function(tempFile, serializedData)
859 { 860 {
860 this._tempFile = tempFile; 861 this._tempFile = tempFile;
861 if (!tempFile) { 862 if (!tempFile) {
(...skipping 18 matching lines...) Expand all
880 _notifyTempFileReady: function() 881 _notifyTempFileReady: function()
881 { 882 {
882 if (this._onTempFileReady) { 883 if (this._onTempFileReady) {
883 this._onTempFileReady(); 884 this._onTempFileReady();
884 this._onTempFileReady = null; 885 this._onTempFileReady = null;
885 } 886 }
886 }, 887 },
887 888
888 __proto__: WebInspector.ProfileHeader.prototype 889 __proto__: WebInspector.ProfileHeader.prototype
889 } 890 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698