Chromium Code Reviews| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 | 184 |
| 185 virtual int ID() OVERRIDE { | 185 virtual int ID() OVERRIDE { |
| 186 return filter()->render_process_id(); | 186 return filter()->render_process_id(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 virtual const content::ResourceContext& GetResourceContext() OVERRIDE { | 189 virtual const content::ResourceContext& GetResourceContext() OVERRIDE { |
| 190 return context_; | 190 return context_; |
| 191 } | 191 } |
| 192 | 192 |
| 193 virtual bool OffTheRecord() OVERRIDE { | 193 virtual bool OffTheRecord() OVERRIDE { |
| 194 return filter()->OffTheRecord(); | 194 if (filter()->OffTheRecord()) |
| 195 return true; | |
| 196 if (content::GetContentClient()->browser()->AllowSaveLocalState(context_)) | |
| 197 return false; | |
| 198 | |
| 199 // For now, only disallow storing data for Flash <http://crbug.com/97319>. | |
| 200 for (size_t i = 0; i < info_.mime_types.size(); ++i) { | |
| 201 if (info_.mime_types[i].mime_type == "application/x-shockwave-flash") | |
|
jam
2011/10/07 16:08:02
nit: please use kFlashPluginSwfMimeType from plugi
Bernhard Bauer
2011/10/07 16:26:19
Done. Thanks for the tip!
| |
| 202 return true; | |
| 203 } | |
| 204 return false; | |
| 195 } | 205 } |
| 196 | 206 |
| 197 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) OVERRIDE { | 207 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) OVERRIDE { |
| 198 info_ = info; | 208 info_ = info; |
| 199 } | 209 } |
| 200 | 210 |
| 201 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE { | 211 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE { |
| 202 DCHECK(host); | 212 DCHECK(host); |
| 203 host_ = host; | 213 host_ = host; |
| 204 } | 214 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 IPC_END_MESSAGE_MAP_EX() | 377 IPC_END_MESSAGE_MAP_EX() |
| 368 | 378 |
| 369 return handled; | 379 return handled; |
| 370 } | 380 } |
| 371 | 381 |
| 372 void RenderMessageFilter::OnDestruct() const { | 382 void RenderMessageFilter::OnDestruct() const { |
| 373 BrowserThread::DeleteOnIOThread::Destruct(this); | 383 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 374 } | 384 } |
| 375 | 385 |
| 376 bool RenderMessageFilter::OffTheRecord() const { | 386 bool RenderMessageFilter::OffTheRecord() const { |
| 377 return incognito_ || | 387 return incognito_; |
| 378 !content::GetContentClient()->browser()->AllowSaveLocalState( | |
| 379 resource_context_); | |
| 380 } | 388 } |
| 381 | 389 |
| 382 void RenderMessageFilter::OnMsgCreateWindow( | 390 void RenderMessageFilter::OnMsgCreateWindow( |
| 383 const ViewHostMsg_CreateWindow_Params& params, | 391 const ViewHostMsg_CreateWindow_Params& params, |
| 384 int* route_id, int64* cloned_session_storage_namespace_id) { | 392 int* route_id, int64* cloned_session_storage_namespace_id) { |
| 385 if (!content::GetContentClient()->browser()->CanCreateWindow( | 393 if (!content::GetContentClient()->browser()->CanCreateWindow( |
| 386 params.opener_url, params.window_container_type, resource_context_)) { | 394 params.opener_url, params.window_container_type, resource_context_)) { |
| 387 *route_id = MSG_ROUTING_NONE; | 395 *route_id = MSG_ROUTING_NONE; |
| 388 return; | 396 return; |
| 389 } | 397 } |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 845 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies); | 853 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies); |
| 846 Send(reply_msg); | 854 Send(reply_msg); |
| 847 } | 855 } |
| 848 | 856 |
| 849 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( | 857 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( |
| 850 OpenChannelToNpapiPluginCallback* client) { | 858 OpenChannelToNpapiPluginCallback* client) { |
| 851 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 859 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 852 DCHECK(ContainsKey(plugin_host_clients_, client)); | 860 DCHECK(ContainsKey(plugin_host_clients_, client)); |
| 853 plugin_host_clients_.erase(client); | 861 plugin_host_clients_.erase(client); |
| 854 } | 862 } |
| OLD | NEW |