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

Side by Side Diff: chrome/browser/resources/net_internals/browser_bridge.js

Issue 7564029: Use javascript strict mode throughout a number of net-internals files. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 * This class provides a "bridge" for communicating between the javascript and 6 * This class provides a "bridge" for communicating between the javascript and
7 * the browser. 7 * the browser.
8 */ 8 */
9 var BrowserBridge = (function() {
10 'use strict';
9 11
10 var BrowserBridge = (function() {
11 /** 12 /**
12 * Delay in milliseconds between updates of certain browser information. 13 * Delay in milliseconds between updates of certain browser information.
13 */ 14 */
14 const POLL_INTERVAL_MS = 5000; 15 var POLL_INTERVAL_MS = 5000;
15 16
16 /** 17 /**
17 * @constructor 18 * @constructor
18 */ 19 */
19 function BrowserBridge() { 20 function BrowserBridge() {
21 assertFirstConstructorCall(BrowserBridge);
22
20 // List of observers for various bits of browser state. 23 // List of observers for various bits of browser state.
21 this.connectionTestsObservers_ = []; 24 this.connectionTestsObservers_ = [];
22 this.hstsObservers_ = []; 25 this.hstsObservers_ = [];
23 this.httpThrottlingObservers_ = []; 26 this.httpThrottlingObservers_ = [];
24 this.constantsObservers_ = []; 27 this.constantsObservers_ = [];
25 28
26 this.pollableDataHelpers_ = {}; 29 this.pollableDataHelpers_ = {};
27 this.pollableDataHelpers_.proxySettings = 30 this.pollableDataHelpers_.proxySettings =
28 new PollableDataHelper('onProxySettingsChanged', 31 new PollableDataHelper('onProxySettingsChanged',
29 this.sendGetProxySettings.bind(this)); 32 this.sendGetProxySettings.bind(this));
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 */ 477 */
475 addPrerenderInfoObserver: function(observer) { 478 addPrerenderInfoObserver: function(observer) {
476 this.pollableDataHelpers_.prerenderInfo.addObserver(observer); 479 this.pollableDataHelpers_.prerenderInfo.addObserver(observer);
477 }, 480 },
478 481
479 /** 482 /**
480 * If |force| is true, calls all startUpdate functions. Otherwise, just 483 * If |force| is true, calls all startUpdate functions. Otherwise, just
481 * runs updates with active observers. 484 * runs updates with active observers.
482 */ 485 */
483 checkForUpdatedInfo: function(force) { 486 checkForUpdatedInfo: function(force) {
484 for (name in this.pollableDataHelpers_) { 487 for (var name in this.pollableDataHelpers_) {
485 var helper = this.pollableDataHelpers_[name]; 488 var helper = this.pollableDataHelpers_[name];
486 if (force || helper.hasActiveObserver()) 489 if (force || helper.hasActiveObserver())
487 helper.startUpdate(); 490 helper.startUpdate();
488 } 491 }
489 }, 492 },
490 493
491 /** 494 /**
492 * Calls all startUpdate functions and, if |callback| is non-null, 495 * Calls all startUpdate functions and, if |callback| is non-null,
493 * calls it with the results of all updates. 496 * calls it with the results of all updates.
494 */ 497 */
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 helper.removeObserver(this); 626 helper.removeObserver(this);
624 --this.observingCount_; 627 --this.observingCount_;
625 this.updatedData_[name] = data; 628 this.updatedData_[name] = data;
626 if (this.observingCount_ == 0) 629 if (this.observingCount_ == 0)
627 this.callback_(this.updatedData_); 630 this.callback_(this.updatedData_);
628 } 631 }
629 }; 632 };
630 633
631 return BrowserBridge; 634 return BrowserBridge;
632 })(); 635 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/capture_view.js » ('j') | chrome/browser/resources/net_internals/util.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698