Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: content/child/process_background_message_filter.cc

Issue 441003002: Revert r286729 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/process_background_message_filter.h ('k') | content/content_child.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/process_background_message_filter.cc
diff --git a/content/child/process_background_message_filter.cc b/content/child/process_background_message_filter.cc
deleted file mode 100644
index ee19d039b2a45c0bad61ea2cd45f4f55259cd8c8..0000000000000000000000000000000000000000
--- a/content/child/process_background_message_filter.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/child/process_background_message_filter.h"
-
-#include "base/process/process.h"
-#include "base/thread_task_runner_handle.h"
-#include "content/common/child_process_messages.h"
-
-namespace content {
-
-ProcessBackgroundMessageFilter::ProcessBackgroundMessageFilter()
- : main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
-}
-
-ProcessBackgroundMessageFilter::~ProcessBackgroundMessageFilter() {}
-
-bool ProcessBackgroundMessageFilter::OnMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(ProcessBackgroundMessageFilter, message)
- IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded,
- OnProcessBackgrounded)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void ProcessBackgroundMessageFilter::SetTimerSlack(bool background) {
- DCHECK(thread_checker_.CalledOnValidThread());
- // Set timer slack to maximum on main thread when in background.
- base::MessageLoop::current()->SetTimerSlack(
- background ? base::TIMER_SLACK_MAXIMUM : base::TIMER_SLACK_NONE);
-}
-
-void ProcessBackgroundMessageFilter::OnProcessBackgrounded(bool background) {
- DCHECK(base::MessageLoopForIO::IsCurrent());
- // Post to the main thread to set the timer slack.
- main_thread_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(
- &ProcessBackgroundMessageFilter::SetTimerSlack, this, background));
-}
-
-} // namespace content
« no previous file with comments | « content/child/process_background_message_filter.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698