OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROME_NET_BENCHMARKING_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROME_NET_BENCHMARKING_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/chrome_net_benchmarking.mojom.h" |
| 11 |
| 12 namespace net { |
| 13 class URLRequestContextGetter; |
| 14 } |
| 15 |
| 16 class Profile; |
| 17 |
| 18 // This class handles Chrome-specific benchmarking IPC messages |
| 19 // for the renderer process. |
| 20 class ChromeNetBenchmarkingImpl |
| 21 : public chrome::mojom::ChromeNetBenchmarking { |
| 22 public: |
| 23 ChromeNetBenchmarkingImpl( |
| 24 Profile* profile, |
| 25 net::URLRequestContextGetter* request_context); |
| 26 ~ChromeNetBenchmarkingImpl() override; |
| 27 |
| 28 static void Create( |
| 29 Profile* profile, |
| 30 net::URLRequestContextGetter* request_context, |
| 31 chrome::mojom::ChromeNetBenchmarkingRequest request); |
| 32 |
| 33 private: |
| 34 // chrome:mojom:ChromeNetBenchmarking. |
| 35 void CloseCurrentConnections() override; |
| 36 void SetCacheMode(bool enabled) override; |
| 37 void ClearCache(const ClearCacheCallback& callback) override; |
| 38 void ClearHostResolverCache() override; |
| 39 void ClearPredictorCache() override; |
| 40 |
| 41 // Returns true if benchmarking is enabled for chrome. |
| 42 bool CheckBenchmarkingEnabled() const; |
| 43 |
| 44 // The Profile associated with our renderer process. This should only be |
| 45 // accessed on the UI thread! |
| 46 // TODO(623967): Store the Predictor* here instead of the Profile. |
| 47 Profile* profile_; |
| 48 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ChromeNetBenchmarkingImpl); |
| 51 }; |
| 52 |
| 53 #endif // CHROME_BROWSER_CHROME_NET_BENCHMARKING_IMPL_H_ |
| 54 |
OLD | NEW |