OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_RESOURCE_MSG_FILTER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_ |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "app/clipboard/clipboard.h" | 15 #include "app/clipboard/clipboard.h" |
16 #include "app/gfx/native_widget_types.h" | 16 #include "app/gfx/native_widget_types.h" |
17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
18 #include "base/gfx/rect.h" | 18 #include "base/gfx/rect.h" |
19 #include "base/process.h" | 19 #include "base/process.h" |
20 #include "base/ref_counted.h" | 20 #include "base/ref_counted.h" |
21 #include "base/shared_memory.h" | 21 #include "base/shared_memory.h" |
22 #include "base/string16.h" | 22 #include "base/string16.h" |
23 #include "base/task.h" | 23 #include "base/task.h" |
24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/browser/chrome_thread.h" |
25 #include "chrome/browser/net/resolve_proxy_msg_helper.h" | 26 #include "chrome/browser/net/resolve_proxy_msg_helper.h" |
26 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 27 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
27 #include "chrome/common/nacl_types.h" | 28 #include "chrome/common/nacl_types.h" |
28 #include "chrome/common/notification_registrar.h" | 29 #include "chrome/common/notification_registrar.h" |
29 #include "chrome/common/transport_dib.h" | 30 #include "chrome/common/transport_dib.h" |
30 #include "ipc/ipc_channel_proxy.h" | 31 #include "ipc/ipc_channel_proxy.h" |
31 #include "webkit/api/public/WebCache.h" | 32 #include "webkit/api/public/WebCache.h" |
32 | 33 |
33 class AppCacheDispatcherHost; | 34 class AppCacheDispatcherHost; |
34 class AudioRendererHost; | 35 class AudioRendererHost; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual ~ResourceMessageFilter(); | 91 virtual ~ResourceMessageFilter(); |
91 | 92 |
92 void Init(); | 93 void Init(); |
93 | 94 |
94 // IPC::ChannelProxy::MessageFilter methods: | 95 // IPC::ChannelProxy::MessageFilter methods: |
95 virtual void OnFilterAdded(IPC::Channel* channel); | 96 virtual void OnFilterAdded(IPC::Channel* channel); |
96 virtual void OnChannelConnected(int32 peer_pid); | 97 virtual void OnChannelConnected(int32 peer_pid); |
97 virtual void OnChannelError(); | 98 virtual void OnChannelError(); |
98 virtual void OnChannelClosing(); | 99 virtual void OnChannelClosing(); |
99 virtual bool OnMessageReceived(const IPC::Message& message); | 100 virtual bool OnMessageReceived(const IPC::Message& message); |
| 101 virtual void OnDestruct(); |
100 | 102 |
101 // ResourceDispatcherHost::Receiver methods: | 103 // ResourceDispatcherHost::Receiver methods: |
102 virtual bool Send(IPC::Message* message); | 104 virtual bool Send(IPC::Message* message); |
103 virtual URLRequestContext* GetRequestContext( | 105 virtual URLRequestContext* GetRequestContext( |
104 uint32 request_id, | 106 uint32 request_id, |
105 const ViewHostMsg_Resource_Request& request_data); | 107 const ViewHostMsg_Resource_Request& request_data); |
106 | 108 |
107 SpellChecker* spellchecker() { return spellchecker_.get(); } | 109 SpellChecker* spellchecker() { return spellchecker_.get(); } |
108 ResourceDispatcherHost* resource_dispatcher_host() { | 110 ResourceDispatcherHost* resource_dispatcher_host() { |
109 return resource_dispatcher_host_; | 111 return resource_dispatcher_host_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Cache fonts for the renderer. See ResourceMessageFilter::OnLoadFont | 145 // Cache fonts for the renderer. See ResourceMessageFilter::OnLoadFont |
144 // implementation for more details | 146 // implementation for more details |
145 void OnLoadFont(LOGFONT font); | 147 void OnLoadFont(LOGFONT font); |
146 #endif | 148 #endif |
147 | 149 |
148 #if !defined(OS_MACOSX) | 150 #if !defined(OS_MACOSX) |
149 // Not handled in the IO thread on Mac. | 151 // Not handled in the IO thread on Mac. |
150 void OnGetScreenInfo(gfx::NativeViewId window, IPC::Message* reply); | 152 void OnGetScreenInfo(gfx::NativeViewId window, IPC::Message* reply); |
151 #endif | 153 #endif |
152 void OnGetPlugins(bool refresh, IPC::Message* reply_msg); | 154 void OnGetPlugins(bool refresh, IPC::Message* reply_msg); |
153 static void OnGetPluginsOnFileThread(ResourceMessageFilter* filter, | 155 void OnGetPluginsOnFileThread(bool refresh, IPC::Message* reply_msg); |
154 bool refresh, | |
155 IPC::Message* reply_msg); | |
156 void OnPluginsLoaded(IPC::Message* reply_msg); | |
157 void OnGetPluginPath(const GURL& url, | 156 void OnGetPluginPath(const GURL& url, |
158 const GURL& policy_url, | 157 const GURL& policy_url, |
159 const std::string& mime_type, | 158 const std::string& mime_type, |
160 FilePath* filename, | 159 FilePath* filename, |
161 std::string* actual_mime_type); | 160 std::string* actual_mime_type); |
162 void OnOpenChannelToPlugin(const GURL& url, | 161 void OnOpenChannelToPlugin(const GURL& url, |
163 const std::string& mime_type, | 162 const std::string& mime_type, |
164 const std::wstring& locale, | 163 const std::wstring& locale, |
165 IPC::Message* reply_msg); | 164 IPC::Message* reply_msg); |
166 void OnLaunchNaCl(const std::wstring& url, | 165 void OnLaunchNaCl(const std::wstring& url, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const std::string& target_extension_id, | 276 const std::string& target_extension_id, |
278 const std::string& channel_name, int* port_id); | 277 const std::string& channel_name, int* port_id); |
279 void OnOpenChannelToTab(int routing_id, int tab_id, | 278 void OnOpenChannelToTab(int routing_id, int tab_id, |
280 const std::string& extension_id, | 279 const std::string& extension_id, |
281 const std::string& channel_name, int* port_id); | 280 const std::string& channel_name, int* port_id); |
282 | 281 |
283 void OnCloseIdleConnections(); | 282 void OnCloseIdleConnections(); |
284 void OnSetCacheMode(bool enabled); | 283 void OnSetCacheMode(bool enabled); |
285 | 284 |
286 void OnGetFileSize(const FilePath& path, IPC::Message* reply_msg); | 285 void OnGetFileSize(const FilePath& path, IPC::Message* reply_msg); |
287 void ReplyGetFileSize(int64 result, void* param); | 286 void OnGetFileSizeOnFileThread(const FilePath& path, IPC::Message* reply_msg); |
288 void OnKeygen(uint32 key_size_index, const std::string& challenge_string, | 287 void OnKeygen(uint32 key_size_index, const std::string& challenge_string, |
289 const GURL& url, std::string* signed_public_key); | 288 const GURL& url, std::string* signed_public_key); |
290 #if defined(OS_LINUX) | 289 #if defined(OS_LINUX) |
291 void SendDelayedReply(IPC::Message* reply_msg); | 290 void SendDelayedReply(IPC::Message* reply_msg); |
292 void DoOnGetScreenInfo(gfx::NativeViewId view, IPC::Message* reply_msg); | 291 void DoOnGetScreenInfo(gfx::NativeViewId view, IPC::Message* reply_msg); |
293 void DoOnGetWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg); | 292 void DoOnGetWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg); |
294 void DoOnGetRootWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg); | 293 void DoOnGetRootWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg); |
295 void DoOnClipboardIsFormatAvailable(Clipboard::FormatType format, | 294 void DoOnClipboardIsFormatAvailable(Clipboard::FormatType format, |
296 Clipboard::Buffer buffer, | 295 Clipboard::Buffer buffer, |
297 IPC::Message* reply_msg); | 296 IPC::Message* reply_msg); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // Whether this process is used for off the record tabs. | 385 // Whether this process is used for off the record tabs. |
387 bool off_the_record_; | 386 bool off_the_record_; |
388 | 387 |
389 // A callback to create a routing id for the associated renderer process. | 388 // A callback to create a routing id for the associated renderer process. |
390 scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; | 389 scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; |
391 | 390 |
392 DISALLOW_COPY_AND_ASSIGN(ResourceMessageFilter); | 391 DISALLOW_COPY_AND_ASSIGN(ResourceMessageFilter); |
393 }; | 392 }; |
394 | 393 |
395 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_ | 394 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_MSG_FILTER_H_ |
OLD | NEW |