X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fdevtools%2Ffront_end%2Fsdk%2FCPUProfilerModel.js;h=3fe78bdb26bad2e2757b6276709f4d1e070949fb;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=eedc80c0fef9406013c417c3c2d46f10bf64ee92;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js b/src/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js index eedc80c..3fe78bd 100644 --- a/src/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js +++ b/src/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js @@ -72,9 +72,15 @@ WebInspector.CPUProfilerModel.prototype = { consoleProfileFinished: function(id, scriptLocation, cpuProfile, title) { // Make sure ProfilesPanel is initialized and CPUProfileType is created. - self.runtime.loadModule("profiler"); - var debuggerLocation = WebInspector.DebuggerModel.Location.fromPayload(this.target(), scriptLocation); - this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileFinished, {protocolId: id, scriptLocation: debuggerLocation, cpuProfile: cpuProfile, title: title}); + self.runtime.loadModulePromise("profiler").then(dispatchEvent.bind(this)).done(); + /** + * @this {WebInspector.CPUProfilerModel} + */ + function dispatchEvent() + { + var debuggerLocation = WebInspector.DebuggerModel.Location.fromPayload(this.target(), scriptLocation); + this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileFinished, {protocolId: id, scriptLocation: debuggerLocation, cpuProfile: cpuProfile, title: title}); + } }, /** @@ -85,9 +91,15 @@ WebInspector.CPUProfilerModel.prototype = { consoleProfileStarted: function(id, scriptLocation, title) { // Make sure ProfilesPanel is initialized and CPUProfileType is created. - self.runtime.loadModule("profiler"); - var debuggerLocation = WebInspector.DebuggerModel.Location.fromPayload(this.target(), scriptLocation) - this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileStarted, {protocolId: id, scriptLocation: debuggerLocation, title: title}); + self.runtime.loadModulePromise("profiler").then(dispatchEvent.bind(this)).done(); + /** + * @this {WebInspector.CPUProfilerModel} + */ + function dispatchEvent() + { + var debuggerLocation = WebInspector.DebuggerModel.Location.fromPayload(this.target(), scriptLocation) + this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileStarted, {protocolId: id, scriptLocation: debuggerLocation, title: title}); + } }, /**