OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.Object} | 33 * @extends {WebInspector.Object} |
34 * @param {!WebInspector.Target} target | |
34 */ | 35 */ |
35 WebInspector.ConsoleModel = function() | 36 WebInspector.ConsoleModel = function(target) |
36 { | 37 { |
37 this._agent = ConsoleAgent; | 38 this._agent = target.connection.agent("Console"); |
aandrey
2014/03/04 10:05:16
this should be typed for the js compiler, so eithe
sergeyv
2014/03/04 12:42:37
Partially done. I encapsulated connection. But, un
| |
38 this.messages = []; | 39 this.messages = []; |
39 this.warnings = 0; | 40 this.warnings = 0; |
40 this.errors = 0; | 41 this.errors = 0; |
41 this._interruptRepeatCount = false; | 42 this._interruptRepeatCount = false; |
42 InspectorBackend.registerConsoleDispatcher(new WebInspector.ConsoleDispatche r(this)); | 43 target.connection.registerDispatcher("Console", new WebInspector.ConsoleDisp atcher(this)); |
aandrey
2014/03/04 10:05:16
encapsulate connection?
sergeyv
2014/03/04 12:42:37
Done.
| |
43 } | 44 } |
44 | 45 |
45 WebInspector.ConsoleModel.Events = { | 46 WebInspector.ConsoleModel.Events = { |
46 ConsoleCleared: "console-cleared", | 47 ConsoleCleared: "console-cleared", |
47 MessageAdded: "console-message-added", | 48 MessageAdded: "console-message-added", |
48 RepeatCountUpdated: "repeat-count-updated" | 49 RepeatCountUpdated: "repeat-count-updated" |
49 } | 50 } |
50 | 51 |
51 WebInspector.ConsoleModel.prototype = { | 52 WebInspector.ConsoleModel.prototype = { |
52 enableAgent: function() | 53 enableAgent: function() |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 { | 329 { |
329 if (!WebInspector.settings.preserveConsoleLog.get()) | 330 if (!WebInspector.settings.preserveConsoleLog.get()) |
330 this._console.clearMessages(); | 331 this._console.clearMessages(); |
331 } | 332 } |
332 } | 333 } |
333 | 334 |
334 /** | 335 /** |
335 * @type {!WebInspector.ConsoleModel} | 336 * @type {!WebInspector.ConsoleModel} |
336 */ | 337 */ |
337 WebInspector.console; | 338 WebInspector.console; |
OLD | NEW |