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

Side by Side Diff: chrome/browser/chrome_net_benchmarking_impl.h

Issue 2521823008: Migrate chrome_net_benchmarking_message_filter to mojo (Closed)
Patch Set: change ClearPredictorCache to run on UI thread via PostTask Created 4 years 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) 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698