Remove the dependency of PasswordStore on BrowserContextKeyedService
[chromium-blink-merge.git] / chrome / browser / chrome_net_benchmarking_message_filter.h
blobf83a9275732b33d0bd8ef747e9a7c1c5de50853f
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.
5 #ifndef CHROME_BROWSER_CHROME_NET_BENCHMARKING_MESSAGE_FILTER_H_
6 #define CHROME_BROWSER_CHROME_NET_BENCHMARKING_MESSAGE_FILTER_H_
8 #include "content/public/browser/browser_message_filter.h"
10 namespace net {
11 class URLRequestContextGetter;
14 class Profile;
16 // This class filters out incoming Chrome-specific benchmarking IPC messages
17 // for the renderer process on the IPC thread.
18 class ChromeNetBenchmarkingMessageFilter
19 : public content::BrowserMessageFilter {
20 public:
21 ChromeNetBenchmarkingMessageFilter(
22 Profile* profile,
23 net::URLRequestContextGetter* request_context);
25 // content::BrowserMessageFilter methods:
26 virtual bool OnMessageReceived(const IPC::Message& message,
27 bool* message_was_ok) OVERRIDE;
29 private:
30 virtual ~ChromeNetBenchmarkingMessageFilter();
32 // Message handlers.
33 void OnCloseCurrentConnections();
34 void OnClearCache(IPC::Message* reply_msg);
35 void OnClearHostResolverCache(int* result);
36 void OnEnableSpdy(bool enable);
37 void OnSetCacheMode(bool enabled);
38 void OnClearPredictorCache(int* result);
40 // Returns true if benchmarking is enabled for chrome.
41 bool CheckBenchmarkingEnabled() const;
43 // The Profile associated with our renderer process. This should only be
44 // accessed on the UI thread!
45 Profile* profile_;
46 scoped_refptr<net::URLRequestContextGetter> request_context_;
48 DISALLOW_COPY_AND_ASSIGN(ChromeNetBenchmarkingMessageFilter);
51 #endif // CHROME_BROWSER_CHROME_NET_BENCHMARKING_MESSAGE_FILTER_H_