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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "content/browser/worker_host/worker_message_filter.h" | 78 #include "content/browser/worker_host/worker_message_filter.h" |
79 #include "content/common/child_process_info.h" | 79 #include "content/common/child_process_info.h" |
80 #include "content/common/child_process_messages.h" | 80 #include "content/common/child_process_messages.h" |
81 #include "content/common/gpu/gpu_messages.h" | 81 #include "content/common/gpu/gpu_messages.h" |
82 #include "content/public/browser/notification_service.h" | 82 #include "content/public/browser/notification_service.h" |
83 #include "content/common/resource_messages.h" | 83 #include "content/common/resource_messages.h" |
84 #include "content/common/view_messages.h" | 84 #include "content/common/view_messages.h" |
85 #include "content/public/browser/content_browser_client.h" | 85 #include "content/public/browser/content_browser_client.h" |
86 #include "content/public/common/content_constants.h" | 86 #include "content/public/common/content_constants.h" |
87 #include "content/public/common/content_switches.h" | 87 #include "content/public/common/content_switches.h" |
| 88 #include "content/public/common/process_type.h" |
88 #include "content/public/common/result_codes.h" | 89 #include "content/public/common/result_codes.h" |
89 #include "content/renderer/render_process_impl.h" | 90 #include "content/renderer/render_process_impl.h" |
90 #include "content/renderer/render_thread_impl.h" | 91 #include "content/renderer/render_thread_impl.h" |
91 #include "ipc/ipc_logging.h" | 92 #include "ipc/ipc_logging.h" |
92 #include "ipc/ipc_platform_file.h" | 93 #include "ipc/ipc_platform_file.h" |
93 #include "ipc/ipc_switches.h" | 94 #include "ipc/ipc_switches.h" |
94 #include "media/base/media_switches.h" | 95 #include "media/base/media_switches.h" |
95 #include "net/url_request/url_request_context_getter.h" | 96 #include "net/url_request/url_request_context_getter.h" |
96 #include "ui/base/ui_base_switches.h" | 97 #include "ui/base/ui_base_switches.h" |
97 #include "ui/gfx/gl/gl_switches.h" | 98 #include "ui/gfx/gl/gl_switches.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 scoped_refptr<RenderMessageFilter> render_message_filter( | 450 scoped_refptr<RenderMessageFilter> render_message_filter( |
450 new RenderMessageFilter( | 451 new RenderMessageFilter( |
451 GetID(), | 452 GetID(), |
452 PluginService::GetInstance(), | 453 PluginService::GetInstance(), |
453 GetBrowserContext(), | 454 GetBrowserContext(), |
454 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), | 455 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), |
455 widget_helper_)); | 456 widget_helper_)); |
456 channel_->AddFilter(render_message_filter); | 457 channel_->AddFilter(render_message_filter); |
457 | 458 |
458 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 459 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
459 GetID(), ChildProcessInfo::RENDER_PROCESS, | 460 GetID(), content::PROCESS_TYPE_RENDERER, |
460 &GetBrowserContext()->GetResourceContext(), | 461 &GetBrowserContext()->GetResourceContext(), |
461 new RendererURLRequestContextSelector(GetBrowserContext(), GetID()), | 462 new RendererURLRequestContextSelector(GetBrowserContext(), GetID()), |
462 content::GetContentClient()->browser()->GetResourceDispatcherHost()); | 463 content::GetContentClient()->browser()->GetResourceDispatcherHost()); |
463 | 464 |
464 channel_->AddFilter(resource_message_filter); | 465 channel_->AddFilter(resource_message_filter); |
465 channel_->AddFilter(new AudioInputRendererHost( | 466 channel_->AddFilter(new AudioInputRendererHost( |
466 &GetBrowserContext()->GetResourceContext())); | 467 &GetBrowserContext()->GetResourceContext())); |
467 channel_->AddFilter( | 468 channel_->AddFilter( |
468 new AudioRendererHost(&GetBrowserContext()->GetResourceContext())); | 469 new AudioRendererHost(&GetBrowserContext()->GetResourceContext())); |
469 channel_->AddFilter( | 470 channel_->AddFilter( |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { | 1311 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
1311 // Only honor the request if appropriate persmissions are granted. | 1312 // Only honor the request if appropriate persmissions are granted. |
1312 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) | 1313 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) |
1313 content::GetContentClient()->browser()->OpenItem(path); | 1314 content::GetContentClient()->browser()->OpenItem(path); |
1314 } | 1315 } |
1315 | 1316 |
1316 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1317 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1317 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 1318 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
1318 MHTMLGenerated(job_id, data_size); | 1319 MHTMLGenerated(job_id, data_size); |
1319 } | 1320 } |
OLD | NEW |