| 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 #include "content/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "build/build_config.h" | 33 #include "build/build_config.h" |
| 34 #include "components/tracing/child_trace_message_filter.h" | 34 #include "components/tracing/child_trace_message_filter.h" |
| 35 #include "content/child/child_discardable_shared_memory_manager.h" | 35 #include "content/child/child_discardable_shared_memory_manager.h" |
| 36 #include "content/child/child_gpu_memory_buffer_manager.h" | 36 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 37 #include "content/child/child_histogram_message_filter.h" | 37 #include "content/child/child_histogram_message_filter.h" |
| 38 #include "content/child/child_process.h" | 38 #include "content/child/child_process.h" |
| 39 #include "content/child/child_resource_message_filter.h" | 39 #include "content/child/child_resource_message_filter.h" |
| 40 #include "content/child/child_shared_bitmap_manager.h" | 40 #include "content/child/child_shared_bitmap_manager.h" |
| 41 #include "content/child/fileapi/file_system_dispatcher.h" | 41 #include "content/child/fileapi/file_system_dispatcher.h" |
| 42 #include "content/child/fileapi/webfilesystem_impl.h" | 42 #include "content/child/fileapi/webfilesystem_impl.h" |
| 43 #include "content/child/geofencing/geofencing_message_filter.h" | |
| 44 #include "content/child/memory/child_memory_message_filter.h" | 43 #include "content/child/memory/child_memory_message_filter.h" |
| 45 #include "content/child/mojo/mojo_application.h" | 44 #include "content/child/mojo/mojo_application.h" |
| 46 #include "content/child/notifications/notification_dispatcher.h" | 45 #include "content/child/notifications/notification_dispatcher.h" |
| 47 #include "content/child/power_monitor_broadcast_source.h" | 46 #include "content/child/power_monitor_broadcast_source.h" |
| 48 #include "content/child/push_messaging/push_dispatcher.h" | 47 #include "content/child/push_messaging/push_dispatcher.h" |
| 49 #include "content/child/quota_dispatcher.h" | 48 #include "content/child/quota_dispatcher.h" |
| 50 #include "content/child/quota_message_filter.h" | 49 #include "content/child/quota_message_filter.h" |
| 51 #include "content/child/resource_dispatcher.h" | 50 #include "content/child/resource_dispatcher.h" |
| 52 #include "content/child/service_worker/service_worker_message_filter.h" | 51 #include "content/child/service_worker/service_worker_message_filter.h" |
| 53 #include "content/child/thread_safe_sender.h" | 52 #include "content/child/thread_safe_sender.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 resource_message_filter_ = | 420 resource_message_filter_ = |
| 422 new ChildResourceMessageFilter(resource_dispatcher()); | 421 new ChildResourceMessageFilter(resource_dispatcher()); |
| 423 | 422 |
| 424 service_worker_message_filter_ = | 423 service_worker_message_filter_ = |
| 425 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 424 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
| 426 | 425 |
| 427 quota_message_filter_ = | 426 quota_message_filter_ = |
| 428 new QuotaMessageFilter(thread_safe_sender_.get()); | 427 new QuotaMessageFilter(thread_safe_sender_.get()); |
| 429 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 428 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
| 430 quota_message_filter_.get())); | 429 quota_message_filter_.get())); |
| 431 geofencing_message_filter_ = | |
| 432 new GeofencingMessageFilter(thread_safe_sender_.get()); | |
| 433 notification_dispatcher_ = | 430 notification_dispatcher_ = |
| 434 new NotificationDispatcher(thread_safe_sender_.get()); | 431 new NotificationDispatcher(thread_safe_sender_.get()); |
| 435 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); | 432 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); |
| 436 | 433 |
| 437 channel_->AddFilter(histogram_message_filter_.get()); | 434 channel_->AddFilter(histogram_message_filter_.get()); |
| 438 channel_->AddFilter(resource_message_filter_.get()); | 435 channel_->AddFilter(resource_message_filter_.get()); |
| 439 channel_->AddFilter(quota_message_filter_->GetFilter()); | 436 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 440 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 437 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 441 channel_->AddFilter(push_dispatcher_->GetFilter()); | 438 channel_->AddFilter(push_dispatcher_->GetFilter()); |
| 442 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 439 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 443 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | |
| 444 | 440 |
| 445 if (!IsInBrowserProcess()) { | 441 if (!IsInBrowserProcess()) { |
| 446 // In single process mode, browser-side tracing and memory will cover the | 442 // In single process mode, browser-side tracing and memory will cover the |
| 447 // whole process including renderers. | 443 // whole process including renderers. |
| 448 channel_->AddFilter(new tracing::ChildTraceMessageFilter( | 444 channel_->AddFilter(new tracing::ChildTraceMessageFilter( |
| 449 ChildProcess::current()->io_task_runner())); | 445 ChildProcess::current()->io_task_runner())); |
| 450 channel_->AddFilter(new ChildMemoryMessageFilter()); | 446 channel_->AddFilter(new ChildMemoryMessageFilter()); |
| 451 } | 447 } |
| 452 | 448 |
| 453 // In single process mode we may already have a power monitor | 449 // In single process mode we may already have a power monitor |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 void ChildThreadImpl::EnsureConnected() { | 717 void ChildThreadImpl::EnsureConnected() { |
| 722 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 718 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 723 base::Process::Current().Terminate(0, false); | 719 base::Process::Current().Terminate(0, false); |
| 724 } | 720 } |
| 725 | 721 |
| 726 bool ChildThreadImpl::IsInBrowserProcess() const { | 722 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 727 return browser_process_io_runner_; | 723 return browser_process_io_runner_; |
| 728 } | 724 } |
| 729 | 725 |
| 730 } // namespace content | 726 } // namespace content |
| OLD | NEW |