OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Provides communication interface to remote v8 debugger. See | 6 * @fileoverview Provides communication interface to remote v8 debugger. See |
7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol | 7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol |
8 */ | 8 */ |
9 goog.provide('devtools.DebuggerAgent'); | 9 goog.provide('devtools.DebuggerAgent'); |
10 | 10 |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 604 |
605 | 605 |
606 /** | 606 /** |
607 * Handles current profiler status. | 607 * Handles current profiler status. |
608 */ | 608 */ |
609 devtools.DebuggerAgent.prototype.didIsProfilingStarted_ = function( | 609 devtools.DebuggerAgent.prototype.didIsProfilingStarted_ = function( |
610 is_started) { | 610 is_started) { |
611 if (is_started && !this.isProfilingStarted_) { | 611 if (is_started && !this.isProfilingStarted_) { |
612 // Start to query log data. | 612 // Start to query log data. |
613 RemoteDebuggerAgent.GetLogLines(this.lastProfileLogPosition_); | 613 RemoteDebuggerAgent.GetLogLines(this.lastProfileLogPosition_); |
| 614 } else if (!is_started && this.isProfilingStarted_) { |
| 615 // Display a temporary icon / message indicating that the profile |
| 616 // is being processed. |
| 617 var processingIcon = new WebInspector.SidebarTreeElement( |
| 618 "profile-sidebar-tree-item", "Processing...", "", null, false); |
| 619 var profilesSidebar = WebInspector.panels.profiles.sidebarTree; |
| 620 profilesSidebar.appendChild(processingIcon); |
| 621 var profilerProcessor = this.profilerProcessor_; |
| 622 // Set a callback for adding a profile that removes the temporary element |
| 623 // and restores plain "addProfile" callback. |
| 624 profilerProcessor.setNewProfileCallback(function (profile) { |
| 625 profilesSidebar.removeChild(processingIcon); |
| 626 WebInspector.addProfile(profile); |
| 627 profilerProcessor.setNewProfileCallback( |
| 628 goog.bind(WebInspector.addProfile, WebInspector)); |
| 629 }); |
614 } | 630 } |
615 this.isProfilingStarted_ = is_started; | 631 this.isProfilingStarted_ = is_started; |
616 // Update button. | 632 // Update button. |
617 WebInspector.setRecordingProfile(is_started); | 633 WebInspector.setRecordingProfile(is_started); |
618 if (is_started) { | 634 if (is_started) { |
619 // Monitor profiler state. It can stop itself on buffer fill-up. | 635 // Monitor profiler state. It can stop itself on buffer fill-up. |
620 setTimeout(function() { RemoteDebuggerAgent.IsProfilingStarted(); }, 1000); | 636 setTimeout(function() { RemoteDebuggerAgent.IsProfilingStarted(); }, 1000); |
621 } | 637 } |
622 }; | 638 }; |
623 | 639 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 | 1169 |
1154 | 1170 |
1155 /** | 1171 /** |
1156 * @param {number} handle Object handle. | 1172 * @param {number} handle Object handle. |
1157 * @return {?Object} Returns the object with the handle if it was sent in this | 1173 * @return {?Object} Returns the object with the handle if it was sent in this |
1158 * message(some objects referenced by handles may be missing in the message). | 1174 * message(some objects referenced by handles may be missing in the message). |
1159 */ | 1175 */ |
1160 devtools.DebuggerMessage.prototype.lookup = function(handle) { | 1176 devtools.DebuggerMessage.prototype.lookup = function(handle) { |
1161 return this.refs_[handle]; | 1177 return this.refs_[handle]; |
1162 }; | 1178 }; |
OLD | NEW |