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

Side by Side Diff: content/browser/net/network_quality_observer_impl.h

Issue 2857093002: Expose changes in the network quality to the renderers (Closed)
Patch Set: ps Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
nasko 2017/05/08 18:27:45 No "(c)".
tbansal1 2017/05/08 19:50:19 Done. I am not sure where I copied this from.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_NET_NETWORK_QUALITY_OBSERVER_IMPL_H_
6 #define CONTENT_BROWSER_NET_NETWORK_QUALITY_OBSERVER_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/threading/thread_checker.h"
10 #include "content/common/content_export.h"
11 #include "content/public/browser/network_quality_observer_factory.h"
12 #include "net/nqe/network_quality.h"
13 #include "net/nqe/network_quality_estimator.h"
14
15 namespace content {
16
17 // Listens for changes to the network quality and manages sending updates to
18 // each RenderProcess via mojo.
19 class CONTENT_EXPORT NetworkQualityObserverImpl
20 : public net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver {
21 public:
22 explicit NetworkQualityObserverImpl(
23 net::NetworkQualityEstimator* network_quality_estimator);
24
25 ~NetworkQualityObserverImpl() override;
26
27 private:
28 class UIObserver;
nasko 2017/05/08 18:27:45 UIObserver implies that it is observing some user
tbansal1 2017/05/08 19:50:19 Done.
29
30 // net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver
31 // implementation:
32 void OnRTTOrThroughputEstimatesComputed(
33 base::TimeDelta http_rtt,
34 base::TimeDelta transport_rtt,
35 int32_t downstream_throughput_kbps) override;
RyanSturm 2017/05/08 17:37:20 #include <stdint.h> Not sure if you have to becaus
tbansal1 2017/05/08 19:50:19 Done.
36
37 // |ui_oberver_| is owned by |this|, and interacts with
38 // the render processes. It is created on the IO thread but afterwards, should
39 // only be accessed on the UI thread.
40 std::unique_ptr<UIObserver> ui_oberver_;
RyanSturm 2017/05/08 17:37:20 #include <memory>
tbansal1 2017/05/08 19:50:19 Done.
41
42 net::NetworkQualityEstimator* network_quality_estimator_;
nasko 2017/05/08 18:27:45 Can you include a comment on how the lifetime of t
tbansal1 2017/05/08 19:50:19 Done.
43
44 // The network quality when the |ui_oberver_| was last notified.
45 net::nqe::internal::NetworkQuality last_notified_network_quality_;
46
47 base::ThreadChecker thread_checker_;
48
49 DISALLOW_COPY_AND_ASSIGN(NetworkQualityObserverImpl);
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_BROWSER_NET_NETWORK_QUALITY_OBSERVER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698