OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 /** | |
6 * @constructor | |
7 * @extends {WebInspector.SDKModel} | |
8 * @param {!WebInspector.Target} target | |
9 */ | |
10 WebInspector.DOMBreakpointsModel = function(target) | |
11 { | |
12 WebInspector.SDKModel.call(this, WebInspector.DOMBreakpointsModel, target); | |
13 this._agent = target.domdebuggerAgent(); | |
14 }; | |
15 | |
16 WebInspector.DOMBreakpointsModel.Marker = "breakpoint-marker"; | |
17 | |
18 WebInspector.DOMBreakpointsModel.prototype = { | |
19 /** | |
lushnikov
2016/07/30 01:24:42
you might also want to add domBreakpoints() getter
chenwilliam
2016/08/06 00:28:21
Done.
| |
20 * @param {number} nodeId | |
21 * @param {!DOMDebuggerAgent.DOMBreakpointType} type | |
22 */ | |
23 setDOMBreakpoint: function(nodeId, type) | |
24 { | |
25 this._agent.setDOMBreakpoint(nodeId, type); | |
26 }, | |
27 | |
28 /** | |
29 * @param {number} nodeId | |
30 * @param {!DOMDebuggerAgent.DOMBreakpointType} type | |
31 */ | |
32 removeDOMBreakpoint: function(nodeId, type) | |
33 { | |
34 this._agent.removeDOMBreakpoint(nodeId, type); | |
35 }, | |
36 | |
37 /** | |
38 * @param {!WebInspector.DOMNode} node | |
39 * @param {?boolean} value | |
40 */ | |
41 setMarker: function(node, value) | |
42 { | |
43 node.setMarker(WebInspector.DOMBreakpointsModel.Marker, value); | |
lushnikov
2016/07/30 01:24:42
We shouldn't expose this method. We should call no
chenwilliam
2016/08/06 00:28:21
Done.
| |
44 }, | |
45 | |
46 __proto__: WebInspector.SDKModel.prototype | |
47 }; | |
48 | |
49 /** | |
50 * @param {number} nodeId | |
51 * @param {!DOMDebuggerAgent.DOMBreakpointType} type | |
52 * @return {string} | |
53 */ | |
54 WebInspector.DOMBreakpointsModel.createBreakpointId = function(nodeId, type) | |
lushnikov
2016/07/30 01:24:42
this should be a part of DOMBreakpointsSidebarPane
chenwilliam
2016/08/06 00:28:21
I've changed it so the use of createBreakpointId i
| |
55 { | |
56 return `${nodeId}:${type}`; | |
57 }; | |
58 | |
59 /** | |
60 * @param {!WebInspector.Target} target | |
61 * @return {?WebInspector.DOMBreakpointsModel} | |
62 */ | |
63 WebInspector.DOMBreakpointsModel.fromTarget = function(target) | |
lushnikov
2016/07/30 01:24:42
let's inline this unless it is needed
chenwilliam
2016/08/06 00:28:21
Done.
| |
64 { | |
65 return /** @type {?WebInspector.DOMBreakpointsModel} */ (target.model(WebIns pector.DOMBreakpointsModel)); | |
66 }; | |
67 | |
68 /** | |
69 * @param {!WebInspector.DOMNode} node | |
70 * @return {!WebInspector.DOMBreakpointsModel} | |
71 */ | |
72 WebInspector.DOMBreakpointsModel.fromNode = function(node) | |
73 { | |
74 return /** @type {!WebInspector.DOMBreakpointsModel} */ (WebInspector.DOMBre akpointsModel.fromTarget(node.target())); | |
75 }; | |
OLD | NEW |