Commit 14654062 authored by treib's avatar treib Committed by Commit bot

Cleanup: delete unused local_ntp_util.js

BUG=none
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2578153002
Cr-Commit-Position: refs/heads/master@{#439138}
parent e6567ba9
...@@ -332,7 +332,6 @@ ...@@ -332,7 +332,6 @@
<include name="IDR_LOCAL_NTP_HTML" file="resources\local_ntp\local_ntp.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_LOCAL_NTP_HTML" file="resources\local_ntp\local_ntp.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_LOCAL_NTP_CSS" file="resources\local_ntp\local_ntp.css" flattenhtml="true" type="BINDATA" /> <include name="IDR_LOCAL_NTP_CSS" file="resources\local_ntp\local_ntp.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_LOCAL_NTP_JS" file="resources\local_ntp\local_ntp.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_LOCAL_NTP_JS" file="resources\local_ntp\local_ntp.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_LOCAL_NTP_UTIL_JS" file="resources\local_ntp\local_ntp_util.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_LOCAL_STATE_HTML" file="resources\local_state\local_state.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_LOCAL_STATE_HTML" file="resources\local_state\local_state.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_LOCAL_STATE_JS" file="resources\local_state\local_state.js" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_LOCAL_STATE_JS" file="resources\local_state\local_state.js" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_MOST_VISITED_IFRAME_CSS" file="resources\local_ntp\most_visited_iframe.css" type="BINDATA" /> <include name="IDR_MOST_VISITED_IFRAME_CSS" file="resources\local_ntp\most_visited_iframe.css" type="BINDATA" />
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Utilities for local_ntp.js.
*/
/**
* A counter with a callback that gets executed on the 1-to-0 transition.
*
* @param {function()} callback The callback to be executed.
* @constructor
*/
function Barrier(callback) {
/** @private {function()} */
this.callback_ = callback;
/** @private {number} */
this.count_ = 0;
/** @private {boolean} */
this.isCancelled_ = false;
}
/**
* Increments count of the Barrier.
*/
Barrier.prototype.add = function() {
++this.count_;
};
/**
* Decrements count of the Barrier, and executes callback on 1-to-0 transition.
*/
Barrier.prototype.remove = function() {
if (this.count_ === 0) // Guards against underflow.
return;
--this.count_;
if (!this.isCancelled_ && this.count_ === 0)
this.callback_();
};
/**
* Deactivates the Barrier; the callback will never be executed.
*/
Barrier.prototype.cancel = function() {
this.isCancelled_ = true;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment