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

Unified Diff: net/proxy/load_state_change_coalescer.h

Issue 1145153004: Split ProxyResolverV8Tracing into an implementation and a wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gypi ('k') | net/proxy/load_state_change_coalescer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/load_state_change_coalescer.h
diff --git a/net/proxy/load_state_change_coalescer.h b/net/proxy/load_state_change_coalescer.h
deleted file mode 100644
index 642538523cf57cf98b43122f64556a337f0997ae..0000000000000000000000000000000000000000
--- a/net/proxy/load_state_change_coalescer.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015 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.
-
-#ifndef NET_PROXY_LOAD_STATE_CHANGE_COALESCER_H_
-#define NET_PROXY_LOAD_STATE_CHANGE_COALESCER_H_
-
-#include "base/cancelable_callback.h"
-#include "base/time/time.h"
-#include "base/timer/timer.h"
-#include "net/base/load_states.h"
-
-namespace net {
-
-// A class that coalesces LoadState changes. When a new LoadState is reported,
-// it becomes the pending LoadState and is queued for |timeout|. If the timeout
-// elapses without another new LoadState, the pending LoadState becomes the
-// committed LoadState and the callback is called with that LoadState. If a new
-// LoadState is reported before the timeout has elapsed, the pending LoadState
-// is discarded and the new LoadState becomes the new pending LoadState, unless
-// it's the same as the committed LoadState, in which case no pending LoadState
-// is queued.
-class LoadStateChangeCoalescer {
- public:
- LoadStateChangeCoalescer(const base::Callback<void(LoadState)>& callback,
- const base::TimeDelta& timeout,
- LoadState initial_load_state);
- ~LoadStateChangeCoalescer();
-
- // Adds a LoadState change to the pipeline. If it isn't coalesced, |callback_|
- // will be called with |load_state| after |timeout_|.
- void LoadStateChanged(LoadState load_state);
-
- private:
- void SendLoadStateChanged();
-
- // The callback to call to report a LoadState change.
- const base::Callback<void(LoadState)> callback_;
-
- // The amount of time for which a LoadState change can be coalesced.
- const base::TimeDelta timeout_;
-
- base::OneShotTimer<LoadStateChangeCoalescer> timer_;
- LoadState committed_load_state_;
- LoadState pending_load_state_;
-
- DISALLOW_COPY_AND_ASSIGN(LoadStateChangeCoalescer);
-};
-
-} // namespace net
-
-#endif // NET_PROXY_LOAD_STATE_CHANGE_COALESCER_H_
« no previous file with comments | « net/net.gypi ('k') | net/proxy/load_state_change_coalescer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698