| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #include "content/browser/renderer_host/render_view_host_impl.h" | 79 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 80 #include "content/browser/renderer_host/render_widget_helper.h" | 80 #include "content/browser/renderer_host/render_widget_helper.h" |
| 81 #include "content/browser/renderer_host/resource_message_filter.h" | 81 #include "content/browser/renderer_host/resource_message_filter.h" |
| 82 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 82 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 83 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 83 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
| 84 #include "content/browser/resolve_proxy_msg_helper.h" | 84 #include "content/browser/resolve_proxy_msg_helper.h" |
| 85 #include "content/browser/storage_partition_impl.h" | 85 #include "content/browser/storage_partition_impl.h" |
| 86 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" | 86 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" |
| 87 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 87 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
| 88 #include "content/browser/trace_message_filter.h" | 88 #include "content/browser/trace_message_filter.h" |
| 89 #include "content/browser/worker_host/worker_storage_partition.h" |
| 89 #include "content/browser/worker_host/worker_message_filter.h" | 90 #include "content/browser/worker_host/worker_message_filter.h" |
| 90 #include "content/common/child_process_host_impl.h" | 91 #include "content/common/child_process_host_impl.h" |
| 91 #include "content/common/child_process_messages.h" | 92 #include "content/common/child_process_messages.h" |
| 92 #include "content/common/gpu/gpu_messages.h" | 93 #include "content/common/gpu/gpu_messages.h" |
| 93 #include "content/common/resource_messages.h" | 94 #include "content/common/resource_messages.h" |
| 94 #include "content/common/view_messages.h" | 95 #include "content/common/view_messages.h" |
| 95 #include "content/public/browser/browser_context.h" | 96 #include "content/public/browser/browser_context.h" |
| 96 #include "content/public/browser/content_browser_client.h" | 97 #include "content/public/browser/content_browser_client.h" |
| 97 #include "content/public/browser/notification_service.h" | 98 #include "content/public/browser/notification_service.h" |
| 98 #include "content/public/browser/render_process_host_factory.h" | 99 #include "content/public/browser/render_process_host_factory.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 this)); | 504 this)); |
| 504 | 505 |
| 505 fast_shutdown_started_ = false; | 506 fast_shutdown_started_ = false; |
| 506 } | 507 } |
| 507 | 508 |
| 508 is_initialized_ = true; | 509 is_initialized_ = true; |
| 509 return true; | 510 return true; |
| 510 } | 511 } |
| 511 | 512 |
| 512 void RenderProcessHostImpl::CreateMessageFilters() { | 513 void RenderProcessHostImpl::CreateMessageFilters() { |
| 514 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 513 MediaObserver* media_observer = | 515 MediaObserver* media_observer = |
| 514 GetContentClient()->browser()->GetMediaObserver(); | 516 GetContentClient()->browser()->GetMediaObserver(); |
| 515 scoped_refptr<RenderMessageFilter> render_message_filter( | 517 scoped_refptr<RenderMessageFilter> render_message_filter( |
| 516 new RenderMessageFilter( | 518 new RenderMessageFilter( |
| 517 GetID(), | 519 GetID(), |
| 518 PluginServiceImpl::GetInstance(), | 520 PluginServiceImpl::GetInstance(), |
| 519 GetBrowserContext(), | 521 GetBrowserContext(), |
| 520 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), | 522 GetBrowserContext()->GetRequestContextForRenderProcess(GetID()), |
| 521 widget_helper_, | 523 widget_helper_, |
| 522 media_observer, | 524 media_observer, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 #elif defined(OS_WIN) | 587 #elif defined(OS_WIN) |
| 586 channel_->AddFilter(new FontCacheDispatcher()); | 588 channel_->AddFilter(new FontCacheDispatcher()); |
| 587 #endif | 589 #endif |
| 588 | 590 |
| 589 SocketStreamDispatcherHost* socket_stream_dispatcher_host = | 591 SocketStreamDispatcherHost* socket_stream_dispatcher_host = |
| 590 new SocketStreamDispatcherHost(GetID(), | 592 new SocketStreamDispatcherHost(GetID(), |
| 591 new RendererURLRequestContextSelector(browser_context, GetID()), | 593 new RendererURLRequestContextSelector(browser_context, GetID()), |
| 592 resource_context); | 594 resource_context); |
| 593 channel_->AddFilter(socket_stream_dispatcher_host); | 595 channel_->AddFilter(socket_stream_dispatcher_host); |
| 594 | 596 |
| 595 channel_->AddFilter(new WorkerMessageFilter(GetID(), resource_context, | 597 channel_->AddFilter( |
| 596 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 598 new WorkerMessageFilter( |
| 597 base::Unretained(widget_helper_.get())))); | 599 GetID(), |
| 600 resource_context, |
| 601 WorkerStoragePartition( |
| 602 storage_partition_impl_->GetAppCacheService(), |
| 603 storage_partition_impl_->GetFileSystemContext(), |
| 604 storage_partition_impl_->GetDatabaseTracker(), |
| 605 storage_partition_impl_->GetIndexedDBContext()), |
| 606 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 607 base::Unretained(widget_helper_.get())))); |
| 598 | 608 |
| 599 #if defined(ENABLE_WEBRTC) | 609 #if defined(ENABLE_WEBRTC) |
| 600 channel_->AddFilter(new P2PSocketDispatcherHost(resource_context)); | 610 channel_->AddFilter(new P2PSocketDispatcherHost(resource_context)); |
| 601 #endif | 611 #endif |
| 602 | 612 |
| 603 channel_->AddFilter(new TraceMessageFilter()); | 613 channel_->AddFilter(new TraceMessageFilter()); |
| 604 channel_->AddFilter(new ResolveProxyMsgHelper( | 614 channel_->AddFilter(new ResolveProxyMsgHelper( |
| 605 browser_context->GetRequestContextForRenderProcess(GetID()))); | 615 browser_context->GetRequestContextForRenderProcess(GetID()))); |
| 606 channel_->AddFilter(new QuotaDispatcherHost( | 616 channel_->AddFilter(new QuotaDispatcherHost( |
| 607 GetID(), | 617 GetID(), |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 int32 route_id, | 1542 int32 route_id, |
| 1533 int32 gpu_process_host_id) { | 1543 int32 gpu_process_host_id) { |
| 1534 TRACE_EVENT0("renderer_host", | 1544 TRACE_EVENT0("renderer_host", |
| 1535 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1545 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1536 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1546 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1537 gpu_process_host_id, | 1547 gpu_process_host_id, |
| 1538 0); | 1548 0); |
| 1539 } | 1549 } |
| 1540 | 1550 |
| 1541 } // namespace content | 1551 } // namespace content |
| OLD | NEW |