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 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/content_settings.h" | 15 #include "chrome/common/content_settings.h" |
16 #include "content/public/browser/browser_message_filter.h" | 16 #include "content/public/browser/browser_message_filter.h" |
17 #include "third_party/WebKit/public/web/WebCache.h" | 17 #include "third_party/WebKit/public/web/WebCache.h" |
18 | 18 |
19 class CookieSettings; | 19 class CookieSettings; |
20 struct ExtensionHostMsg_APIActionOrEvent_Params; | 20 struct ExtensionHostMsg_APIActionOrEvent_Params; |
21 struct ExtensionHostMsg_DOMAction_Params; | 21 struct ExtensionHostMsg_DOMAction_Params; |
22 struct ExtensionHostMsg_Request_Params; | 22 struct ExtensionHostMsg_Request_Params; |
23 struct ExtensionMsg_ExternalConnectionInfo; | 23 struct ExtensionMsg_ExternalConnectionInfo; |
24 class ExtensionInfoMap; | 24 class ExtensionInfoMap; |
25 class GURL; | 25 class GURL; |
26 | 26 |
27 namespace nacl { | |
28 struct NaClLaunchParams; | |
29 } | |
30 | |
31 namespace net { | 27 namespace net { |
32 class HostResolver; | 28 class HostResolver; |
33 class URLRequestContextGetter; | 29 class URLRequestContextGetter; |
34 } | 30 } |
35 | 31 |
36 // This class filters out incoming Chrome-specific IPC messages for the renderer | 32 // This class filters out incoming Chrome-specific IPC messages for the renderer |
37 // process on the IPC thread. | 33 // process on the IPC thread. |
38 class ChromeRenderMessageFilter : public content::BrowserMessageFilter { | 34 class ChromeRenderMessageFilter : public content::BrowserMessageFilter { |
39 public: | 35 public: |
40 ChromeRenderMessageFilter(int render_process_id, | 36 ChromeRenderMessageFilter(int render_process_id, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 int render_process_id() { return render_process_id_; } | 73 int render_process_id() { return render_process_id_; } |
78 bool off_the_record() { return off_the_record_; } | 74 bool off_the_record() { return off_the_record_; } |
79 net::HostResolver* GetHostResolver(); | 75 net::HostResolver* GetHostResolver(); |
80 | 76 |
81 private: | 77 private: |
82 friend class content::BrowserThread; | 78 friend class content::BrowserThread; |
83 friend class base::DeleteHelper<ChromeRenderMessageFilter>; | 79 friend class base::DeleteHelper<ChromeRenderMessageFilter>; |
84 | 80 |
85 virtual ~ChromeRenderMessageFilter(); | 81 virtual ~ChromeRenderMessageFilter(); |
86 | 82 |
87 #if !defined(DISABLE_NACL) | |
88 void OnLaunchNaCl(const nacl::NaClLaunchParams& launch_params, | |
89 IPC::Message* reply_msg); | |
90 void OnGetReadonlyPnaclFd(const std::string& filename, | |
91 IPC::Message* reply_msg); | |
92 void OnNaClCreateTemporaryFile(IPC::Message* reply_msg); | |
93 void OnNaClErrorStatus(int render_view_id, int error_id); | |
94 void OnOpenNaClExecutable(int render_view_id, | |
95 const GURL& file_url, | |
96 IPC::Message* reply_msg); | |
97 #endif | |
98 void OnDnsPrefetch(const std::vector<std::string>& hostnames); | 83 void OnDnsPrefetch(const std::vector<std::string>& hostnames); |
99 void OnPreconnect(const GURL& url); | 84 void OnPreconnect(const GURL& url); |
100 void OnResourceTypeStats(const WebKit::WebCache::ResourceTypeStats& stats); | 85 void OnResourceTypeStats(const WebKit::WebCache::ResourceTypeStats& stats); |
101 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); | 86 void OnUpdatedCacheStats(const WebKit::WebCache::UsageStats& stats); |
102 void OnFPS(int routing_id, float fps); | 87 void OnFPS(int routing_id, float fps); |
103 void OnV8HeapStats(int v8_memory_allocated, int v8_memory_used); | 88 void OnV8HeapStats(int v8_memory_allocated, int v8_memory_used); |
104 void OnOpenChannelToExtension(int routing_id, | 89 void OnOpenChannelToExtension(int routing_id, |
105 const ExtensionMsg_ExternalConnectionInfo& info, | 90 const ExtensionMsg_ExternalConnectionInfo& info, |
106 const std::string& channel_name, int* port_id); | 91 const std::string& channel_name, int* port_id); |
107 void OpenChannelToExtensionOnUIThread( | 92 void OpenChannelToExtensionOnUIThread( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 195 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
211 // Used to look up permissions at database creation time. | 196 // Used to look up permissions at database creation time. |
212 scoped_refptr<CookieSettings> cookie_settings_; | 197 scoped_refptr<CookieSettings> cookie_settings_; |
213 | 198 |
214 base::WeakPtrFactory<ChromeRenderMessageFilter> weak_ptr_factory_; | 199 base::WeakPtrFactory<ChromeRenderMessageFilter> weak_ptr_factory_; |
215 | 200 |
216 DISALLOW_COPY_AND_ASSIGN(ChromeRenderMessageFilter); | 201 DISALLOW_COPY_AND_ASSIGN(ChromeRenderMessageFilter); |
217 }; | 202 }; |
218 | 203 |
219 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ | 204 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_MESSAGE_FILTER_H_ |
OLD | NEW |