| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 * @this {WebInspector.DOMNode} | 921 * @this {WebInspector.DOMNode} |
| 922 */ | 922 */ |
| 923 function resolveToObject(fulfill, reject) | 923 function resolveToObject(fulfill, reject) |
| 924 { | 924 { |
| 925 this.resolveToObject(objectGroup, mycallback); | 925 this.resolveToObject(objectGroup, mycallback); |
| 926 function mycallback(object) | 926 function mycallback(object) |
| 927 { | 927 { |
| 928 if (object) | 928 if (object) |
| 929 fulfill(object) | 929 fulfill(object) |
| 930 else | 930 else |
| 931 reject(null); | 931 reject(new Error()); |
| 932 } | 932 } |
| 933 } | 933 } |
| 934 }, | 934 }, |
| 935 | 935 |
| 936 /** | 936 /** |
| 937 * @param {function(?DOMAgent.BoxModel)} callback | 937 * @param {function(?DOMAgent.BoxModel)} callback |
| 938 */ | 938 */ |
| 939 boxModel: function(callback) | 939 boxModel: function(callback) |
| 940 { | 940 { |
| 941 this._agent.getBoxModel(this.id, this._domModel._wrapClientCallback(call
back)); | 941 this._agent.getBoxModel(this.id, this._domModel._wrapClientCallback(call
back)); |
| (...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2205 } | 2205 } |
| 2206 | 2206 |
| 2207 /** | 2207 /** |
| 2208 * @param {!WebInspector.Target} target | 2208 * @param {!WebInspector.Target} target |
| 2209 * @return {?WebInspector.DOMModel} | 2209 * @return {?WebInspector.DOMModel} |
| 2210 */ | 2210 */ |
| 2211 WebInspector.DOMModel.fromTarget = function(target) | 2211 WebInspector.DOMModel.fromTarget = function(target) |
| 2212 { | 2212 { |
| 2213 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); | 2213 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); |
| 2214 } | 2214 } |
| 2215 |
| 2216 /** |
| 2217 * @constructor |
| 2218 * @implements {Runtime.Adapter} |
| 2219 */ |
| 2220 WebInspector.DOMNode.ToRemoteObject = function() |
| 2221 { |
| 2222 } |
| 2223 |
| 2224 WebInspector.DOMNode.ToRemoteObject.prototype = { |
| 2225 /** |
| 2226 * @override |
| 2227 * @param {!Object} from |
| 2228 * @return {!Promise<?Object>} |
| 2229 */ |
| 2230 adapt: function(from) |
| 2231 { |
| 2232 var domNode = /** @type {!WebInspector.DOMNode} */ (from); |
| 2233 return /** @type {!Promise<?Object>} */ (domNode.resolveToObjectPromise(
"leaky")); |
| 2234 } |
| 2235 } |
| OLD | NEW |