OLD | NEW |
---|---|
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 #ifndef CHROME_BROWSER_NET_NETWORK_STATS_H_ | 5 #ifndef CHROME_BROWSER_NET_NETWORK_STATS_H_ |
6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_ | 6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/bind.h" | |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/string_util.h" | 15 #include "base/string_util.h" |
15 #include "base/time.h" | 16 #include "base/time.h" |
16 #include "chrome/browser/io_thread.h" | 17 #include "chrome/browser/io_thread.h" |
17 #include "net/base/address_list.h" | 18 #include "net/base/address_list.h" |
18 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
19 #include "net/base/host_port_pair.h" | 20 #include "net/base/host_port_pair.h" |
20 #include "net/base/host_resolver.h" | 21 #include "net/base/host_resolver.h" |
21 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 net::OldCompletionCallbackImpl<NetworkStats> write_callback_; | 187 net::OldCompletionCallbackImpl<NetworkStats> write_callback_; |
187 | 188 |
188 // Callback to call when echo protocol is successefully finished or whenever | 189 // Callback to call when echo protocol is successefully finished or whenever |
189 // there is an error (this allows unittests to wait until echo protocol's | 190 // there is an error (this allows unittests to wait until echo protocol's |
190 // round trip is finished). | 191 // round trip is finished). |
191 net::OldCompletionCallback* finished_callback_; | 192 net::OldCompletionCallback* finished_callback_; |
192 | 193 |
193 // The time when the session was started. | 194 // The time when the session was started. |
194 base::TimeTicks start_time_; | 195 base::TimeTicks start_time_; |
195 | 196 |
196 // We use this factory to create timeout tasks for socket's ReadData. | 197 // We use this factory to create timeout tasks for socket's ReadData. |
wtc
2011/11/17 08:16:21
Is this comment still accurate?
| |
197 ScopedRunnableMethodFactory<NetworkStats> timers_factory_; | 198 base::WeakPtrFactory<NetworkStats> weak_factory_; |
198 }; | 199 }; |
199 | 200 |
200 class UDPStatsClient : public NetworkStats { | 201 class UDPStatsClient : public NetworkStats { |
201 public: | 202 public: |
202 // Constructs an UDPStatsClient object that collects metrics for UDP | 203 // Constructs an UDPStatsClient object that collects metrics for UDP |
203 // connectivity. | 204 // connectivity. |
204 UDPStatsClient(); | 205 UDPStatsClient(); |
205 virtual ~UDPStatsClient(); | 206 virtual ~UDPStatsClient(); |
206 | 207 |
207 protected: | 208 protected: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 // This collects the network connectivity stats for UDP and TCP for small | 259 // This collects the network connectivity stats for UDP and TCP for small |
259 // percentage of users who are participating in the experiment. All users must | 260 // percentage of users who are participating in the experiment. All users must |
260 // have enabled "UMA upload". This method gets called only if UMA upload to the | 261 // have enabled "UMA upload". This method gets called only if UMA upload to the |
261 // server has succeeded. | 262 // server has succeeded. |
262 void CollectNetworkStats(const std::string& network_stats_server_url, | 263 void CollectNetworkStats(const std::string& network_stats_server_url, |
263 IOThread* io_thread); | 264 IOThread* io_thread); |
264 | 265 |
265 } // namespace chrome_browser_net | 266 } // namespace chrome_browser_net |
266 | 267 |
267 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ | 268 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ |
OLD | NEW |