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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 */ | 1008 */ |
1009 _wrapClientCallback: function(callback) | 1009 _wrapClientCallback: function(callback) |
1010 { | 1010 { |
1011 if (!callback) | 1011 if (!callback) |
1012 return; | 1012 return; |
1013 /** | 1013 /** |
1014 * @param {?Protocol.Error} error | 1014 * @param {?Protocol.Error} error |
1015 * @param {!T=} result | 1015 * @param {!T=} result |
1016 * @template T | 1016 * @template T |
1017 */ | 1017 */ |
1018 return function(error, result) | 1018 var wrapper = function(error, result) |
1019 { | 1019 { |
1020 // Caller is responsible for handling the actual error. | 1020 // Caller is responsible for handling the actual error. |
1021 callback(error ? null : result); | 1021 callback(error ? null : result); |
1022 } | 1022 }; |
| 1023 return wrapper; |
1023 }, | 1024 }, |
1024 | 1025 |
1025 /** | 1026 /** |
1026 * @param {function(function(?Protocol.Error, !T=)=)} func | 1027 * @param {function(function(?Protocol.Error, !T=)=)} func |
1027 * @param {function(!T)=} callback | 1028 * @param {function(!T)=} callback |
1028 * @template T | 1029 * @template T |
1029 */ | 1030 */ |
1030 _dispatchWhenDocumentAvailable: function(func, callback) | 1031 _dispatchWhenDocumentAvailable: function(func, callback) |
1031 { | 1032 { |
1032 var callbackWrapper = this._wrapClientCallback(callback); | 1033 var callbackWrapper = this._wrapClientCallback(callback); |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) | 1858 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) |
1858 { | 1859 { |
1859 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); | 1860 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); |
1860 } | 1861 } |
1861 } | 1862 } |
1862 | 1863 |
1863 /** | 1864 /** |
1864 * @type {!WebInspector.DOMModel} | 1865 * @type {!WebInspector.DOMModel} |
1865 */ | 1866 */ |
1866 WebInspector.domModel; | 1867 WebInspector.domModel; |
OLD | NEW |