| 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 "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #include "content/browser/renderer_host/pepper_message_filter.h" | 84 #include "content/browser/renderer_host/pepper_message_filter.h" |
| 85 #include "content/browser/renderer_host/render_message_filter.h" | 85 #include "content/browser/renderer_host/render_message_filter.h" |
| 86 #include "content/browser/renderer_host/render_view_host.h" | 86 #include "content/browser/renderer_host/render_view_host.h" |
| 87 #include "content/browser/renderer_host/render_view_host_delegate.h" | 87 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 88 #include "content/browser/renderer_host/render_widget_helper.h" | 88 #include "content/browser/renderer_host/render_widget_helper.h" |
| 89 #include "content/browser/renderer_host/render_widget_host.h" | 89 #include "content/browser/renderer_host/render_widget_host.h" |
| 90 #include "content/browser/renderer_host/resource_message_filter.h" | 90 #include "content/browser/renderer_host/resource_message_filter.h" |
| 91 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 91 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 92 #include "content/browser/speech/speech_input_dispatcher_host.h" | 92 #include "content/browser/speech/speech_input_dispatcher_host.h" |
| 93 #include "content/browser/worker_host/worker_message_filter.h" | 93 #include "content/browser/worker_host/worker_message_filter.h" |
| 94 #include "content/common/resource_messages.h" |
| 94 #include "grit/generated_resources.h" | 95 #include "grit/generated_resources.h" |
| 95 #include "ipc/ipc_logging.h" | 96 #include "ipc/ipc_logging.h" |
| 96 #include "ipc/ipc_message.h" | |
| 97 #include "ipc/ipc_platform_file.h" | 97 #include "ipc/ipc_platform_file.h" |
| 98 #include "ipc/ipc_switches.h" | 98 #include "ipc/ipc_switches.h" |
| 99 #include "media/base/media_switches.h" | 99 #include "media/base/media_switches.h" |
| 100 #include "ui/base/ui_base_switches.h" | 100 #include "ui/base/ui_base_switches.h" |
| 101 #include "webkit/fileapi/file_system_path_manager.h" | 101 #include "webkit/fileapi/file_system_path_manager.h" |
| 102 #include "webkit/plugins/plugin_switches.h" | 102 #include "webkit/plugins/plugin_switches.h" |
| 103 | 103 |
| 104 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 105 #include <objbase.h> | 105 #include <objbase.h> |
| 106 #include "chrome/common/section_util_win.h" | 106 #include "chrome/common/section_util_win.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // right net::URLRequestContext for a request. | 238 // right net::URLRequestContext for a request. |
| 239 class RendererURLRequestContextOverride | 239 class RendererURLRequestContextOverride |
| 240 : public ResourceMessageFilter::URLRequestContextOverride { | 240 : public ResourceMessageFilter::URLRequestContextOverride { |
| 241 public: | 241 public: |
| 242 explicit RendererURLRequestContextOverride(Profile* profile) | 242 explicit RendererURLRequestContextOverride(Profile* profile) |
| 243 : request_context_(profile->GetRequestContext()), | 243 : request_context_(profile->GetRequestContext()), |
| 244 media_request_context_(profile->GetRequestContextForMedia()) { | 244 media_request_context_(profile->GetRequestContextForMedia()) { |
| 245 } | 245 } |
| 246 | 246 |
| 247 virtual net::URLRequestContext* GetRequestContext( | 247 virtual net::URLRequestContext* GetRequestContext( |
| 248 const ViewHostMsg_Resource_Request& resource_request) { | 248 const ResourceHostMsg_Request& resource_request) { |
| 249 URLRequestContextGetter* request_context = request_context_; | 249 URLRequestContextGetter* request_context = request_context_; |
| 250 // If the request has resource type of ResourceType::MEDIA, we use a request | 250 // If the request has resource type of ResourceType::MEDIA, we use a request |
| 251 // context specific to media for handling it because these resources have | 251 // context specific to media for handling it because these resources have |
| 252 // specific needs for caching. | 252 // specific needs for caching. |
| 253 if (resource_request.resource_type == ResourceType::MEDIA) | 253 if (resource_request.resource_type == ResourceType::MEDIA) |
| 254 request_context = media_request_context_; | 254 request_context = media_request_context_; |
| 255 return request_context->GetURLRequestContext(); | 255 return request_context->GetURLRequestContext(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 private: | 258 private: |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 IPC::PlatformFileForTransit file; | 1285 IPC::PlatformFileForTransit file; |
| 1286 #if defined(OS_POSIX) | 1286 #if defined(OS_POSIX) |
| 1287 file = base::FileDescriptor(model_file, false); | 1287 file = base::FileDescriptor(model_file, false); |
| 1288 #elif defined(OS_WIN) | 1288 #elif defined(OS_WIN) |
| 1289 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1289 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
| 1290 false, DUPLICATE_SAME_ACCESS); | 1290 false, DUPLICATE_SAME_ACCESS); |
| 1291 #endif | 1291 #endif |
| 1292 Send(new ViewMsg_SetPhishingModel(file)); | 1292 Send(new ViewMsg_SetPhishingModel(file)); |
| 1293 } | 1293 } |
| 1294 } | 1294 } |
| OLD | NEW |