| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Channel to the background script. | 6 * Channel to the background script. |
| 7 */ | 7 */ |
| 8 function Channel() { | 8 function Channel() { |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } else if (name == Channel.INTERNAL_REPLY_MESSAGE) { | 102 } else if (name == Channel.INTERNAL_REPLY_MESSAGE) { |
| 103 var callback = this.internalRequestCallbacks_[msg.requestId]; | 103 var callback = this.internalRequestCallbacks_[msg.requestId]; |
| 104 delete this.internalRequestCallbacks_[msg.requestId]; | 104 delete this.internalRequestCallbacks_[msg.requestId]; |
| 105 if (callback) | 105 if (callback) |
| 106 callback(msg.result); | 106 callback(msg.result); |
| 107 } else { | 107 } else { |
| 108 this.invokeMessageCallbacks_(msg); | 108 this.invokeMessageCallbacks_(msg); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 }; | 111 }; |
| 112 |
| 113 /** |
| 114 * Class factory. |
| 115 * @return {Channel} |
| 116 */ |
| 117 Channel.create = function() { |
| 118 return new Channel(); |
| 119 }; |
| OLD | NEW |