OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/net_benchmarking.h" | 5 #include "chrome/browser/net_benchmarking.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" |
14 #include "chrome/browser/net/predictor.h" | 15 #include "chrome/browser/net/predictor.h" |
15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/net_benchmarking.mojom.h" | 18 #include "chrome/common/net_benchmarking.mojom.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "mojo/public/cpp/bindings/strong_binding.h" | 20 #include "mojo/public/cpp/bindings/strong_binding.h" |
20 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
21 #include "net/disk_cache/disk_cache.h" | 22 #include "net/disk_cache/disk_cache.h" |
22 #include "net/dns/host_cache.h" | 23 #include "net/dns/host_cache.h" |
23 #include "net/dns/host_resolver.h" | 24 #include "net/dns/host_resolver.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ->CloseAllConnections(); | 97 ->CloseAllConnections(); |
97 callback.Run(); | 98 callback.Run(); |
98 } | 99 } |
99 | 100 |
100 void NetBenchmarking::ClearPredictorCache( | 101 void NetBenchmarking::ClearPredictorCache( |
101 const ClearPredictorCacheCallback& callback) { | 102 const ClearPredictorCacheCallback& callback) { |
102 BrowserThread::PostTaskAndReply( | 103 BrowserThread::PostTaskAndReply( |
103 BrowserThread::UI, FROM_HERE, | 104 BrowserThread::UI, FROM_HERE, |
104 base::Bind(&ClearPredictorCacheOnUIThread, profile_), callback); | 105 base::Bind(&ClearPredictorCacheOnUIThread, profile_), callback); |
105 } | 106 } |
OLD | NEW |