OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/download/download_types.h" | 15 #include "chrome/browser/download/download_types.h" |
16 #include "chrome/browser/download/download_util.h" | 16 #include "chrome/browser/download/download_util.h" |
17 #include "chrome/browser/prefs/pref_service.h" | |
Jói
2011/06/29 03:37:32
Please don't add a content->pref_service dependenc
Miranda Callahan
2011/06/29 19:55:31
Ok -- thanks for the suggestion, it seems to work
| |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
20 #include "chrome/common/pref_names.h" | |
19 #include "content/browser/browser_thread.h" | 21 #include "content/browser/browser_thread.h" |
20 #include "content/browser/child_process_security_policy.h" | 22 #include "content/browser/child_process_security_policy.h" |
21 #include "content/browser/content_browser_client.h" | 23 #include "content/browser/content_browser_client.h" |
22 #include "content/browser/plugin_process_host.h" | 24 #include "content/browser/plugin_process_host.h" |
23 #include "content/browser/plugin_service.h" | 25 #include "content/browser/plugin_service.h" |
24 #include "content/browser/ppapi_plugin_process_host.h" | 26 #include "content/browser/ppapi_plugin_process_host.h" |
25 #include "content/browser/ppapi_broker_process_host.h" | 27 #include "content/browser/ppapi_broker_process_host.h" |
26 #include "content/browser/renderer_host/browser_render_process_host.h" | 28 #include "content/browser/renderer_host/browser_render_process_host.h" |
27 #include "content/browser/renderer_host/render_view_host_delegate.h" | 29 #include "content/browser/renderer_host/render_view_host_delegate.h" |
28 #include "content/browser/renderer_host/render_widget_helper.h" | 30 #include "content/browser/renderer_host/render_widget_helper.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 public: | 119 public: |
118 OpenChannelToNpapiPluginCallback(RenderMessageFilter* filter, | 120 OpenChannelToNpapiPluginCallback(RenderMessageFilter* filter, |
119 IPC::Message* reply_msg) | 121 IPC::Message* reply_msg) |
120 : RenderMessageCompletionCallback(filter, reply_msg) { | 122 : RenderMessageCompletionCallback(filter, reply_msg) { |
121 } | 123 } |
122 | 124 |
123 virtual int ID() { | 125 virtual int ID() { |
124 return filter()->render_process_id(); | 126 return filter()->render_process_id(); |
125 } | 127 } |
126 | 128 |
129 virtual bool SaveLocalState() { | |
130 return filter()->save_local_state(); | |
131 } | |
132 | |
127 virtual bool OffTheRecord() { | 133 virtual bool OffTheRecord() { |
128 return filter()->incognito(); | 134 return filter()->incognito(); |
129 } | 135 } |
130 | 136 |
131 virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info) { | 137 virtual void SetPluginInfo(const webkit::npapi::WebPluginInfo& info) { |
132 info_ = info; | 138 info_ = info; |
133 } | 139 } |
134 | 140 |
135 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) { | 141 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) { |
136 WriteReplyAndDeleteThis(handle); | 142 WriteReplyAndDeleteThis(handle); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 RenderWidgetHelper* render_widget_helper) | 279 RenderWidgetHelper* render_widget_helper) |
274 : resource_dispatcher_host_( | 280 : resource_dispatcher_host_( |
275 content::GetContentClient()->browser()->GetResourceDispatcherHost()), | 281 content::GetContentClient()->browser()->GetResourceDispatcherHost()), |
276 plugin_service_(plugin_service), | 282 plugin_service_(plugin_service), |
277 profile_(profile), | 283 profile_(profile), |
278 extension_info_map_(profile->GetExtensionInfoMap()), | 284 extension_info_map_(profile->GetExtensionInfoMap()), |
279 request_context_(request_context), | 285 request_context_(request_context), |
280 resource_context_(profile->GetResourceContext()), | 286 resource_context_(profile->GetResourceContext()), |
281 extensions_request_context_(profile->GetRequestContextForExtensions()), | 287 extensions_request_context_(profile->GetRequestContextForExtensions()), |
282 render_widget_helper_(render_widget_helper), | 288 render_widget_helper_(render_widget_helper), |
289 save_local_state_(profile->GetPrefs()->GetBoolean( | |
290 prefs::kClearSiteDataOnExit)), | |
283 incognito_(profile->IsOffTheRecord()), | 291 incognito_(profile->IsOffTheRecord()), |
284 webkit_context_(profile->GetWebKitContext()), | 292 webkit_context_(profile->GetWebKitContext()), |
285 render_process_id_(render_process_id) { | 293 render_process_id_(render_process_id) { |
286 DCHECK(request_context_); | 294 DCHECK(request_context_); |
287 | 295 |
288 profile_->GetPrefs(); | 296 profile_->GetPrefs(); |
289 render_widget_helper_->Init(render_process_id_, resource_dispatcher_host_); | 297 render_widget_helper_->Init(render_process_id_, resource_dispatcher_host_); |
290 } | 298 } |
291 | 299 |
292 RenderMessageFilter::~RenderMessageFilter() { | 300 RenderMessageFilter::~RenderMessageFilter() { |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
852 file_for_transit = base::FileDescriptor(file, true); | 860 file_for_transit = base::FileDescriptor(file, true); |
853 #endif | 861 #endif |
854 } | 862 } |
855 | 863 |
856 IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK( | 864 IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK( |
857 routing_id, error_code, file_for_transit, message_id); | 865 routing_id, error_code, file_for_transit, message_id); |
858 BrowserThread::PostTask( | 866 BrowserThread::PostTask( |
859 BrowserThread::IO, FROM_HERE, NewRunnableMethod( | 867 BrowserThread::IO, FROM_HERE, NewRunnableMethod( |
860 this, &RenderMessageFilter::Send, reply)); | 868 this, &RenderMessageFilter::Send, reply)); |
861 } | 869 } |
OLD | NEW |