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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 63 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
64 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 64 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
65 #include "content/browser/loader/resource_message_filter.h" | 65 #include "content/browser/loader/resource_message_filter.h" |
66 #include "content/browser/loader/resource_scheduler_filter.h" | 66 #include "content/browser/loader/resource_scheduler_filter.h" |
67 #include "content/browser/media/capture/audio_mirroring_manager.h" | 67 #include "content/browser/media/capture/audio_mirroring_manager.h" |
68 #include "content/browser/media/media_internals.h" | 68 #include "content/browser/media/media_internals.h" |
69 #include "content/browser/media/midi_host.h" | 69 #include "content/browser/media/midi_host.h" |
70 #include "content/browser/message_port_message_filter.h" | 70 #include "content/browser/message_port_message_filter.h" |
71 #include "content/browser/mime_registry_message_filter.h" | 71 #include "content/browser/mime_registry_message_filter.h" |
72 #include "content/browser/mojo/mojo_application_host.h" | 72 #include "content/browser/mojo/mojo_application_host.h" |
73 #include "content/browser/notification_message_filter.h" | 73 #include "content/browser/notifications/notification_message_filter.h" |
74 #include "content/browser/profiler_message_filter.h" | 74 #include "content/browser/profiler_message_filter.h" |
75 #include "content/browser/push_messaging_message_filter.h" | 75 #include "content/browser/push_messaging_message_filter.h" |
76 #include "content/browser/quota_dispatcher_host.h" | 76 #include "content/browser/quota_dispatcher_host.h" |
77 #include "content/browser/renderer_host/clipboard_message_filter.h" | 77 #include "content/browser/renderer_host/clipboard_message_filter.h" |
78 #include "content/browser/renderer_host/database_message_filter.h" | 78 #include "content/browser/renderer_host/database_message_filter.h" |
79 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 79 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
80 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" | 80 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" |
81 #include "content/browser/renderer_host/gpu_message_filter.h" | 81 #include "content/browser/renderer_host/gpu_message_filter.h" |
82 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 82 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
83 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 83 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 AddFilter(p2p_socket_dispatcher_host_.get()); | 842 AddFilter(p2p_socket_dispatcher_host_.get()); |
843 #endif | 843 #endif |
844 | 844 |
845 AddFilter(new TraceMessageFilter()); | 845 AddFilter(new TraceMessageFilter()); |
846 AddFilter(new ResolveProxyMsgHelper( | 846 AddFilter(new ResolveProxyMsgHelper( |
847 browser_context->GetRequestContextForRenderProcess(GetID()))); | 847 browser_context->GetRequestContextForRenderProcess(GetID()))); |
848 AddFilter(new QuotaDispatcherHost( | 848 AddFilter(new QuotaDispatcherHost( |
849 GetID(), | 849 GetID(), |
850 storage_partition_impl_->GetQuotaManager(), | 850 storage_partition_impl_->GetQuotaManager(), |
851 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 851 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
852 AddFilter(new NotificationMessageFilter( | 852 |
| 853 notification_message_filter_ = new NotificationMessageFilter( |
853 GetID(), | 854 GetID(), |
854 resource_context)); | 855 resource_context, |
| 856 browser_context); |
| 857 AddFilter(notification_message_filter_.get()); |
| 858 |
855 AddFilter(new GamepadBrowserMessageFilter()); | 859 AddFilter(new GamepadBrowserMessageFilter()); |
856 AddFilter(new DeviceLightMessageFilter()); | 860 AddFilter(new DeviceLightMessageFilter()); |
857 AddFilter(new DeviceMotionMessageFilter()); | 861 AddFilter(new DeviceMotionMessageFilter()); |
858 AddFilter(new DeviceOrientationMessageFilter()); | 862 AddFilter(new DeviceOrientationMessageFilter()); |
859 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 863 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
860 AddFilter(new HistogramMessageFilter()); | 864 AddFilter(new HistogramMessageFilter()); |
861 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) | 865 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) |
862 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 866 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
863 switches::kEnableMemoryBenchmarking)) | 867 switches::kEnableMemoryBenchmarking)) |
864 AddFilter(new MemoryBenchmarkMessageFilter()); | 868 AddFilter(new MemoryBenchmarkMessageFilter()); |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 | 2240 |
2237 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2241 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2238 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2242 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2239 DCHECK_GT(worker_ref_count_, 0); | 2243 DCHECK_GT(worker_ref_count_, 0); |
2240 --worker_ref_count_; | 2244 --worker_ref_count_; |
2241 if (worker_ref_count_ == 0) | 2245 if (worker_ref_count_ == 0) |
2242 Cleanup(); | 2246 Cleanup(); |
2243 } | 2247 } |
2244 | 2248 |
2245 } // namespace content | 2249 } // namespace content |
OLD | NEW |