Chromium Code Reviews| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 359 if (!IsInBrowserProcess()) | 359 if (!IsInBrowserProcess()) |
| 360 IPC::Logging::GetInstance()->SetIPCSender(this); | 360 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 361 #endif | 361 #endif |
| 362 | 362 |
| 363 #if defined(OS_WIN) | 363 #if defined(OS_WIN) |
| 364 attachment_broker_.reset(new IPC::AttachmentBrokerUnprivilegedWin()); | 364 attachment_broker_.reset(new IPC::AttachmentBrokerUnprivilegedWin()); |
| 365 #endif | 365 #endif |
| 366 | 366 |
| 367 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); | 367 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); |
| 368 | 368 |
| 369 sync_message_filter_ = | 369 histogram_message_filter_ = new ChildHistogramMessageFilter(); |
|
jam
2015/08/04 23:06:41
why move this code?
Ken Rockot(use gerrit already)
2015/08/04 23:55:44
only to preserve the order of the filters. reverte
| |
| 370 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); | 370 channel_->AddFilter(histogram_message_filter_.get()); |
| 371 | |
| 372 sync_message_filter_ = channel_->AddNewSyncMessageFilter(); | |
| 373 | |
| 371 thread_safe_sender_ = new ThreadSafeSender( | 374 thread_safe_sender_ = new ThreadSafeSender( |
| 372 message_loop_->task_runner(), sync_message_filter_.get()); | 375 message_loop_->task_runner(), sync_message_filter_.get()); |
| 373 | 376 |
| 374 resource_dispatcher_.reset(new ResourceDispatcher( | 377 resource_dispatcher_.reset(new ResourceDispatcher( |
| 375 this, message_loop()->task_runner())); | 378 this, message_loop()->task_runner())); |
| 376 websocket_dispatcher_.reset(new WebSocketDispatcher); | 379 websocket_dispatcher_.reset(new WebSocketDispatcher); |
| 377 file_system_dispatcher_.reset(new FileSystemDispatcher()); | 380 file_system_dispatcher_.reset(new FileSystemDispatcher()); |
| 378 | 381 |
| 379 histogram_message_filter_ = new ChildHistogramMessageFilter(); | |
| 380 resource_message_filter_ = | 382 resource_message_filter_ = |
| 381 new ChildResourceMessageFilter(resource_dispatcher()); | 383 new ChildResourceMessageFilter(resource_dispatcher()); |
| 382 | 384 |
| 383 service_worker_message_filter_ = | 385 service_worker_message_filter_ = |
| 384 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); | 386 new ServiceWorkerMessageFilter(thread_safe_sender_.get()); |
| 385 | 387 |
| 386 quota_message_filter_ = | 388 quota_message_filter_ = |
| 387 new QuotaMessageFilter(thread_safe_sender_.get()); | 389 new QuotaMessageFilter(thread_safe_sender_.get()); |
| 388 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), | 390 quota_dispatcher_.reset(new QuotaDispatcher(thread_safe_sender_.get(), |
| 389 quota_message_filter_.get())); | 391 quota_message_filter_.get())); |
| 390 geofencing_message_filter_ = | 392 geofencing_message_filter_ = |
| 391 new GeofencingMessageFilter(thread_safe_sender_.get()); | 393 new GeofencingMessageFilter(thread_safe_sender_.get()); |
| 392 notification_dispatcher_ = | 394 notification_dispatcher_ = |
| 393 new NotificationDispatcher(thread_safe_sender_.get()); | 395 new NotificationDispatcher(thread_safe_sender_.get()); |
| 394 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); | 396 push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); |
| 395 | 397 |
| 396 channel_->AddFilter(histogram_message_filter_.get()); | |
| 397 channel_->AddFilter(sync_message_filter_.get()); | |
| 398 channel_->AddFilter(resource_message_filter_.get()); | 398 channel_->AddFilter(resource_message_filter_.get()); |
| 399 channel_->AddFilter(quota_message_filter_->GetFilter()); | 399 channel_->AddFilter(quota_message_filter_->GetFilter()); |
| 400 channel_->AddFilter(notification_dispatcher_->GetFilter()); | 400 channel_->AddFilter(notification_dispatcher_->GetFilter()); |
| 401 channel_->AddFilter(push_dispatcher_->GetFilter()); | 401 channel_->AddFilter(push_dispatcher_->GetFilter()); |
| 402 channel_->AddFilter(service_worker_message_filter_->GetFilter()); | 402 channel_->AddFilter(service_worker_message_filter_->GetFilter()); |
| 403 channel_->AddFilter(geofencing_message_filter_->GetFilter()); | 403 channel_->AddFilter(geofencing_message_filter_->GetFilter()); |
| 404 | 404 |
| 405 if (!IsInBrowserProcess()) { | 405 if (!IsInBrowserProcess()) { |
| 406 // In single process mode, browser-side tracing will cover the whole | 406 // In single process mode, browser-side tracing will cover the whole |
| 407 // process including renderers. | 407 // process including renderers. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 | 709 |
| 710 void ChildThreadImpl::OnProcessBackgrounded(bool background) { | 710 void ChildThreadImpl::OnProcessBackgrounded(bool background) { |
| 711 // Set timer slack to maximum on main thread when in background. | 711 // Set timer slack to maximum on main thread when in background. |
| 712 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 712 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 713 if (background) | 713 if (background) |
| 714 timer_slack = base::TIMER_SLACK_MAXIMUM; | 714 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 715 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 715 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace content | 718 } // namespace content |
| OLD | NEW |