| OLD | NEW | 
|     1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |     1 // Copyright (c) 2012 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 #if defined(OS_WIN) |    10 #if defined(OS_WIN) | 
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   107 #include "webkit/glue/resource_type.h" |   107 #include "webkit/glue/resource_type.h" | 
|   108 #include "webkit/plugins/plugin_switches.h" |   108 #include "webkit/plugins/plugin_switches.h" | 
|   109  |   109  | 
|   110 #if defined(OS_WIN) |   110 #if defined(OS_WIN) | 
|   111 #include "base/synchronization/waitable_event.h" |   111 #include "base/synchronization/waitable_event.h" | 
|   112 #include "content/common/font_cache_dispatcher_win.h" |   112 #include "content/common/font_cache_dispatcher_win.h" | 
|   113 #endif |   113 #endif | 
|   114  |   114  | 
|   115 #include "third_party/skia/include/core/SkBitmap.h" |   115 #include "third_party/skia/include/core/SkBitmap.h" | 
|   116  |   116  | 
 |   117 using content::BrowserContext; | 
|   117 using content::BrowserMessageFilter; |   118 using content::BrowserMessageFilter; | 
|   118 using content::BrowserThread; |   119 using content::BrowserThread; | 
|   119 using content::ChildProcessHost; |   120 using content::ChildProcessHost; | 
|   120 using content::ChildProcessHostImpl; |   121 using content::ChildProcessHostImpl; | 
|   121 using content::UserMetricsAction; |   122 using content::UserMetricsAction; | 
|   122 using content::WebUIControllerFactory; |   123 using content::WebUIControllerFactory; | 
|   123  |   124  | 
|   124 extern bool g_exited_main_message_loop; |   125 extern bool g_exited_main_message_loop; | 
|   125  |   126  | 
|   126 // This class creates the IO thread for the renderer when running in |   127 // This class creates the IO thread for the renderer when running in | 
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   453  |   454  | 
|   454   ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |   455   ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 
|   455       GetID(), content::PROCESS_TYPE_RENDERER, resource_context, |   456       GetID(), content::PROCESS_TYPE_RENDERER, resource_context, | 
|   456       new RendererURLRequestContextSelector(browser_context, GetID())); |   457       new RendererURLRequestContextSelector(browser_context, GetID())); | 
|   457  |   458  | 
|   458   channel_->AddFilter(resource_message_filter); |   459   channel_->AddFilter(resource_message_filter); | 
|   459   channel_->AddFilter(new AudioInputRendererHost(resource_context)); |   460   channel_->AddFilter(new AudioInputRendererHost(resource_context)); | 
|   460   channel_->AddFilter(new AudioRendererHost(resource_context)); |   461   channel_->AddFilter(new AudioRendererHost(resource_context)); | 
|   461   channel_->AddFilter(new VideoCaptureHost(resource_context)); |   462   channel_->AddFilter(new VideoCaptureHost(resource_context)); | 
|   462   channel_->AddFilter(new AppCacheDispatcherHost( |   463   channel_->AddFilter(new AppCacheDispatcherHost( | 
|   463       browser_context->GetAppCacheService(), GetID())); |   464       BrowserContext::GetAppCacheService(browser_context), GetID())); | 
|   464   channel_->AddFilter(new ClipboardMessageFilter()); |   465   channel_->AddFilter(new ClipboardMessageFilter()); | 
|   465   channel_->AddFilter(new DOMStorageMessageFilter(GetID(), |   466   channel_->AddFilter(new DOMStorageMessageFilter(GetID(), | 
|   466       browser_context->GetWebKitContext())); |   467       BrowserContext::GetWebKitContext(browser_context))); | 
|   467   channel_->AddFilter(new IndexedDBDispatcherHost(GetID(), |   468   channel_->AddFilter(new IndexedDBDispatcherHost(GetID(), | 
|   468       browser_context->GetWebKitContext())); |   469       BrowserContext::GetWebKitContext(browser_context))); | 
|   469   channel_->AddFilter(GeolocationDispatcherHost::New( |   470   channel_->AddFilter(GeolocationDispatcherHost::New( | 
|   470       GetID(), browser_context->GetGeolocationPermissionContext())); |   471       GetID(), browser_context->GetGeolocationPermissionContext())); | 
|   471   channel_->AddFilter(new GpuMessageFilter(GetID(), widget_helper_.get())); |   472   channel_->AddFilter(new GpuMessageFilter(GetID(), widget_helper_.get())); | 
|   472   channel_->AddFilter(new media_stream::MediaStreamDispatcherHost( |   473   channel_->AddFilter(new media_stream::MediaStreamDispatcherHost( | 
|   473       resource_context, GetID())); |   474       resource_context, GetID())); | 
|   474   channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context)); |   475   channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context)); | 
|   475   channel_->AddFilter(new PepperMessageFilter(GetID(), resource_context)); |   476   channel_->AddFilter(new PepperMessageFilter(GetID(), resource_context)); | 
|   476   channel_->AddFilter(new speech_input::SpeechInputDispatcherHost( |   477   channel_->AddFilter(new speech_input::SpeechInputDispatcherHost( | 
|   477       GetID(), browser_context->GetRequestContext(), |   478       GetID(), browser_context->GetRequestContext(), | 
|   478       browser_context->GetSpeechInputPreferences(), resource_context)); |   479       browser_context->GetSpeechInputPreferences(), resource_context)); | 
|   479   channel_->AddFilter(new FileSystemDispatcherHost( |   480   channel_->AddFilter(new FileSystemDispatcherHost( | 
|   480       browser_context->GetRequestContext(), |   481       browser_context->GetRequestContext(), | 
|   481       browser_context->GetFileSystemContext())); |   482       BrowserContext::GetFileSystemContext(browser_context))); | 
|   482   channel_->AddFilter(new device_orientation::MessageFilter()); |   483   channel_->AddFilter(new device_orientation::MessageFilter()); | 
|   483   channel_->AddFilter(new BlobMessageFilter(GetID(), |   484   channel_->AddFilter(new BlobMessageFilter(GetID(), | 
|   484         browser_context->GetBlobStorageContext())); |   485         BrowserContext::GetBlobStorageContext(browser_context))); | 
|   485   channel_->AddFilter(new FileUtilitiesMessageFilter(GetID())); |   486   channel_->AddFilter(new FileUtilitiesMessageFilter(GetID())); | 
|   486   channel_->AddFilter(new MimeRegistryMessageFilter()); |   487   channel_->AddFilter(new MimeRegistryMessageFilter()); | 
|   487   channel_->AddFilter(new DatabaseMessageFilter( |   488   channel_->AddFilter(new DatabaseMessageFilter( | 
|   488       browser_context->GetDatabaseTracker())); |   489       BrowserContext::GetDatabaseTracker(browser_context))); | 
|   489 #if defined(OS_MACOSX) |   490 #if defined(OS_MACOSX) | 
|   490   channel_->AddFilter(new TextInputClientMessageFilter(GetID())); |   491   channel_->AddFilter(new TextInputClientMessageFilter(GetID())); | 
|   491 #elif defined(OS_WIN) |   492 #elif defined(OS_WIN) | 
|   492   channel_->AddFilter(new FontCacheDispatcher()); |   493   channel_->AddFilter(new FontCacheDispatcher()); | 
|   493 #endif |   494 #endif | 
|   494  |   495  | 
|   495   SocketStreamDispatcherHost* socket_stream_dispatcher_host = |   496   SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 
|   496       new SocketStreamDispatcherHost( |   497       new SocketStreamDispatcherHost( | 
|   497           new RendererURLRequestContextSelector(browser_context, GetID()), |   498           new RendererURLRequestContextSelector(browser_context, GetID()), | 
|   498                                                 resource_context); |   499                                                 resource_context); | 
|   499   channel_->AddFilter(socket_stream_dispatcher_host); |   500   channel_->AddFilter(socket_stream_dispatcher_host); | 
|   500  |   501  | 
|   501   channel_->AddFilter(new WorkerMessageFilter(GetID(), resource_context, |   502   channel_->AddFilter(new WorkerMessageFilter(GetID(), resource_context, | 
|   502       base::Bind(&RenderWidgetHelper::GetNextRoutingID, |   503       base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 
|   503                  base::Unretained(widget_helper_.get())))); |   504                  base::Unretained(widget_helper_.get())))); | 
|   504  |   505  | 
|   505 #if defined(ENABLE_P2P_APIS) |   506 #if defined(ENABLE_P2P_APIS) | 
|   506   channel_->AddFilter(new content::P2PSocketDispatcherHost(resource_context)); |   507   channel_->AddFilter(new content::P2PSocketDispatcherHost(resource_context)); | 
|   507 #endif |   508 #endif | 
|   508  |   509  | 
|   509   channel_->AddFilter(new TraceMessageFilter()); |   510   channel_->AddFilter(new TraceMessageFilter()); | 
|   510   channel_->AddFilter(new ResolveProxyMsgHelper( |   511   channel_->AddFilter(new ResolveProxyMsgHelper( | 
|   511       browser_context->GetRequestContextForRenderProcess(GetID()))); |   512       browser_context->GetRequestContextForRenderProcess(GetID()))); | 
|   512   channel_->AddFilter(new QuotaDispatcherHost(GetID(), |   513   channel_->AddFilter(new QuotaDispatcherHost( | 
|   513       browser_context->GetQuotaManager(), |   514       GetID(), | 
 |   515       content::BrowserContext::GetQuotaManager(browser_context), | 
|   514       content::GetContentClient()->browser()->CreateQuotaPermissionContext())); |   516       content::GetContentClient()->browser()->CreateQuotaPermissionContext())); | 
|   515   channel_->AddFilter(new content::GamepadBrowserMessageFilter(this)); |   517   channel_->AddFilter(new content::GamepadBrowserMessageFilter(this)); | 
|   516   channel_->AddFilter(new ProfilerMessageFilter()); |   518   channel_->AddFilter(new ProfilerMessageFilter()); | 
|   517 } |   519 } | 
|   518  |   520  | 
|   519 int RenderProcessHostImpl::GetNextRoutingID() { |   521 int RenderProcessHostImpl::GetNextRoutingID() { | 
|   520   return widget_helper_->GetNextRoutingID(); |   522   return widget_helper_->GetNextRoutingID(); | 
|   521 } |   523 } | 
|   522  |   524  | 
|   523 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) { |   525 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) { | 
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1291   // Only honor the request if appropriate persmissions are granted. |  1293   // Only honor the request if appropriate persmissions are granted. | 
|  1292   if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), |  1294   if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), | 
|  1293                                                                  path)) |  1295                                                                  path)) | 
|  1294     content::GetContentClient()->browser()->OpenItem(path); |  1296     content::GetContentClient()->browser()->OpenItem(path); | 
|  1295 } |  1297 } | 
|  1296  |  1298  | 
|  1297 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |  1299 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 
|  1298   content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |  1300   content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 
|  1299       MHTMLGenerated(job_id, data_size); |  1301       MHTMLGenerated(job_id, data_size); | 
|  1300 } |  1302 } | 
| OLD | NEW |