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"
11 class URLRequestContextGetter
;
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
{
21 ChromeNetBenchmarkingMessageFilter(
23 net::URLRequestContextGetter
* request_context
);
25 // content::BrowserMessageFilter methods:
26 virtual bool OnMessageReceived(const IPC::Message
& message
,
27 bool* message_was_ok
) OVERRIDE
;
30 virtual ~ChromeNetBenchmarkingMessageFilter();
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!
46 scoped_refptr
<net::URLRequestContextGetter
> request_context_
;
48 DISALLOW_COPY_AND_ASSIGN(ChromeNetBenchmarkingMessageFilter
);
51 #endif // CHROME_BROWSER_CHROME_NET_BENCHMARKING_MESSAGE_FILTER_H_