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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 NetBenchmarking::NetBenchmarking(Profile* profile, | 44 NetBenchmarking::NetBenchmarking(Profile* profile, |
45 net::URLRequestContextGetter* request_context) | 45 net::URLRequestContextGetter* request_context) |
46 : profile_(profile), request_context_(request_context) {} | 46 : profile_(profile), request_context_(request_context) {} |
47 | 47 |
48 NetBenchmarking::~NetBenchmarking() {} | 48 NetBenchmarking::~NetBenchmarking() {} |
49 | 49 |
50 // static | 50 // static |
51 void NetBenchmarking::Create(Profile* profile, | 51 void NetBenchmarking::Create(Profile* profile, |
52 net::URLRequestContextGetter* request_context, | 52 net::URLRequestContextGetter* request_context, |
| 53 const service_manager::BindSourceInfo& source_info, |
53 chrome::mojom::NetBenchmarkingRequest request) { | 54 chrome::mojom::NetBenchmarkingRequest request) { |
54 mojo::MakeStrongBinding( | 55 mojo::MakeStrongBinding( |
55 base::MakeUnique<NetBenchmarking>(profile, request_context), | 56 base::MakeUnique<NetBenchmarking>(profile, request_context), |
56 std::move(request)); | 57 std::move(request)); |
57 } | 58 } |
58 | 59 |
59 // static | 60 // static |
60 bool NetBenchmarking::CheckBenchmarkingEnabled() { | 61 bool NetBenchmarking::CheckBenchmarkingEnabled() { |
61 const base::CommandLine& command_line = | 62 const base::CommandLine& command_line = |
62 *base::CommandLine::ForCurrentProcess(); | 63 *base::CommandLine::ForCurrentProcess(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ->CloseAllConnections(); | 98 ->CloseAllConnections(); |
98 callback.Run(); | 99 callback.Run(); |
99 } | 100 } |
100 | 101 |
101 void NetBenchmarking::ClearPredictorCache( | 102 void NetBenchmarking::ClearPredictorCache( |
102 const ClearPredictorCacheCallback& callback) { | 103 const ClearPredictorCacheCallback& callback) { |
103 BrowserThread::PostTaskAndReply( | 104 BrowserThread::PostTaskAndReply( |
104 BrowserThread::UI, FROM_HERE, | 105 BrowserThread::UI, FROM_HERE, |
105 base::BindOnce(&ClearPredictorCacheOnUIThread, profile_), callback); | 106 base::BindOnce(&ClearPredictorCacheOnUIThread, profile_), callback); |
106 } | 107 } |
OLD | NEW |