| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 * Dictionary of constants (initialized by browser). | 6 * Dictionary of constants (initialized by browser). |
| 7 */ | 7 */ |
| 8 var LogEventType = null; | 8 var LogEventType = null; |
| 9 var LogEventPhase = null; | 9 var LogEventPhase = null; |
| 10 var LogSourceType = null; | 10 var LogSourceType = null; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 this.badProxiesObservers_, 'onBadProxiesChanged', badProxies); | 202 this.badProxiesObservers_, 'onBadProxiesChanged', badProxies); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 BrowserBridge.prototype.receivedHostResolverCache = | 205 BrowserBridge.prototype.receivedHostResolverCache = |
| 206 function(hostResolverCache) { | 206 function(hostResolverCache) { |
| 207 this.dispatchToObserversFromPoll_( | 207 this.dispatchToObserversFromPoll_( |
| 208 this.hostResolverCacheObservers_, 'onHostResolverCacheChanged', | 208 this.hostResolverCacheObservers_, 'onHostResolverCacheChanged', |
| 209 hostResolverCache); | 209 hostResolverCache); |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 BrowserBridge.prototype.receivedPassiveLogEntries = function(entries) { |
| 213 for (var i = 0; i < entries.length; ++i) |
| 214 this.receivedLogEntry(entries[i]); |
| 215 }; |
| 216 |
| 212 //------------------------------------------------------------------------------ | 217 //------------------------------------------------------------------------------ |
| 213 | 218 |
| 214 /** | 219 /** |
| 215 * Adds a listener of log entries. |observer| will be called back when new log | 220 * Adds a listener of log entries. |observer| will be called back when new log |
| 216 * data arrives, through: | 221 * data arrives, through: |
| 217 * | 222 * |
| 218 * observer.onLogEntryAdded(logEntry) | 223 * observer.onLogEntryAdded(logEntry) |
| 219 */ | 224 */ |
| 220 BrowserBridge.prototype.addLogObserver = function(observer) { | 225 BrowserBridge.prototype.addLogObserver = function(observer) { |
| 221 this.logObservers_.push(observer); | 226 this.logObservers_.push(observer); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // If the data hasn't changed since last time, no need to notify observers. | 301 // If the data hasn't changed since last time, no need to notify observers. |
| 297 if (prevData && JSON.stringify(prevData) == JSON.stringify(data)) | 302 if (prevData && JSON.stringify(prevData) == JSON.stringify(data)) |
| 298 return; | 303 return; |
| 299 | 304 |
| 300 this.prevPollData_[method] = data; | 305 this.prevPollData_[method] = data; |
| 301 | 306 |
| 302 // Ok, notify the observers of the change. | 307 // Ok, notify the observers of the change. |
| 303 for (var i = 0; i < observerList.length; ++i) | 308 for (var i = 0; i < observerList.length; ++i) |
| 304 observerList[i][method](data); | 309 observerList[i][method](data); |
| 305 }; | 310 }; |
| OLD | NEW |