| 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 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "content/browser/renderer_host/media/video_capture_host.h" | 70 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 71 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" | 71 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
| 72 #include "content/browser/renderer_host/pepper/pepper_file_message_filter.h" | 72 #include "content/browser/renderer_host/pepper/pepper_file_message_filter.h" |
| 73 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 73 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
| 74 #include "content/browser/renderer_host/quota_dispatcher_host.h" | 74 #include "content/browser/renderer_host/quota_dispatcher_host.h" |
| 75 #include "content/browser/renderer_host/render_message_filter.h" | 75 #include "content/browser/renderer_host/render_message_filter.h" |
| 76 #include "content/browser/renderer_host/render_view_host_delegate.h" | 76 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 77 #include "content/browser/renderer_host/render_view_host_impl.h" | 77 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 78 #include "content/browser/renderer_host/render_widget_helper.h" | 78 #include "content/browser/renderer_host/render_widget_helper.h" |
| 79 #include "content/browser/renderer_host/resource_message_filter.h" | 79 #include "content/browser/renderer_host/resource_message_filter.h" |
| 80 #include "content/browser/renderer_host/resource_scheduler.h" |
| 81 #include "content/browser/renderer_host/resource_scheduler_filter.h" |
| 80 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 82 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 81 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 83 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
| 82 #include "content/browser/resolve_proxy_msg_helper.h" | 84 #include "content/browser/resolve_proxy_msg_helper.h" |
| 83 #include "content/browser/storage_partition_impl.h" | 85 #include "content/browser/storage_partition_impl.h" |
| 84 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" | 86 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" |
| 85 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 87 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
| 86 #include "content/browser/trace_message_filter.h" | 88 #include "content/browser/trace_message_filter.h" |
| 87 #include "content/browser/worker_host/worker_storage_partition.h" | 89 #include "content/browser/worker_host/worker_storage_partition.h" |
| 88 #include "content/browser/worker_host/worker_message_filter.h" | 90 #include "content/browser/worker_host/worker_message_filter.h" |
| 89 #include "content/common/child_process_host_impl.h" | 91 #include "content/common/child_process_host_impl.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 480 |
| 479 fast_shutdown_started_ = false; | 481 fast_shutdown_started_ = false; |
| 480 } | 482 } |
| 481 | 483 |
| 482 is_initialized_ = true; | 484 is_initialized_ = true; |
| 483 return true; | 485 return true; |
| 484 } | 486 } |
| 485 | 487 |
| 486 void RenderProcessHostImpl::CreateMessageFilters() { | 488 void RenderProcessHostImpl::CreateMessageFilters() { |
| 487 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 489 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 490 channel_->AddFilter(new ResourceSchedulerFilter(GetID())); |
| 488 MediaObserver* media_observer = | 491 MediaObserver* media_observer = |
| 489 GetContentClient()->browser()->GetMediaObserver(); | 492 GetContentClient()->browser()->GetMediaObserver(); |
| 490 // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages | 493 // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages |
| 491 // from guests. | 494 // from guests. |
| 492 if (IsGuest()) { | 495 if (IsGuest()) { |
| 493 scoped_refptr<BrowserPluginMessageFilter> bp_message_filter( | 496 scoped_refptr<BrowserPluginMessageFilter> bp_message_filter( |
| 494 new BrowserPluginMessageFilter( | 497 new BrowserPluginMessageFilter( |
| 495 GetID(), | 498 GetID(), |
| 496 GetBrowserContext())); | 499 GetBrowserContext())); |
| 497 channel_->AddFilter(bp_message_filter); | 500 channel_->AddFilter(bp_message_filter); |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 child_process_launcher_.reset(); | 1445 child_process_launcher_.reset(); |
| 1443 channel_.reset(); | 1446 channel_.reset(); |
| 1444 gpu_message_filter_ = NULL; | 1447 gpu_message_filter_ = NULL; |
| 1445 | 1448 |
| 1446 IDMap<RenderWidgetHost>::iterator iter(&render_widget_hosts_); | 1449 IDMap<RenderWidgetHost>::iterator iter(&render_widget_hosts_); |
| 1447 while (!iter.IsAtEnd()) { | 1450 while (!iter.IsAtEnd()) { |
| 1448 RenderWidgetHostImpl::From(iter.GetCurrentValue())->OnMessageReceived( | 1451 RenderWidgetHostImpl::From(iter.GetCurrentValue())->OnMessageReceived( |
| 1449 ViewHostMsg_RenderViewGone(iter.GetCurrentKey(), | 1452 ViewHostMsg_RenderViewGone(iter.GetCurrentKey(), |
| 1450 static_cast<int>(status), | 1453 static_cast<int>(status), |
| 1451 exit_code)); | 1454 exit_code)); |
| 1455 ResourceDispatcherHostImpl::Get()->scheduler()->OnDestroy( |
| 1456 GetID(), iter.GetCurrentKey()); |
| 1452 iter.Advance(); | 1457 iter.Advance(); |
| 1453 } | 1458 } |
| 1454 | 1459 |
| 1455 ClearTransportDIBCache(); | 1460 ClearTransportDIBCache(); |
| 1456 | 1461 |
| 1457 // this object is not deleted at this point and may be reused later. | 1462 // this object is not deleted at this point and may be reused later. |
| 1458 // TODO(darin): clean this up | 1463 // TODO(darin): clean this up |
| 1459 } | 1464 } |
| 1460 | 1465 |
| 1461 int RenderProcessHostImpl::GetActiveViewCount() { | 1466 int RenderProcessHostImpl::GetActiveViewCount() { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 int32 gpu_process_host_id) { | 1587 int32 gpu_process_host_id) { |
| 1583 TRACE_EVENT0("renderer_host", | 1588 TRACE_EVENT0("renderer_host", |
| 1584 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1589 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1585 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1590 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1586 gpu_process_host_id, | 1591 gpu_process_host_id, |
| 1587 false, | 1592 false, |
| 1588 0); | 1593 0); |
| 1589 } | 1594 } |
| 1590 | 1595 |
| 1591 } // namespace content | 1596 } // namespace content |
| OLD | NEW |