Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js

Issue 1413593008: DevTools: straw man adaptable implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/Runtime.js ('k') | third_party/WebKit/Source/devtools/front_end/sdk/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698