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

Side by Side Diff: content/child/child_thread.cc

Issue 305533006: Control process backgrounding from within the child process on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Disable test. Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/child_thread.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "content/child/child_thread.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) 434 IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown)
435 #if defined(IPC_MESSAGE_LOG_ENABLED) 435 #if defined(IPC_MESSAGE_LOG_ENABLED)
436 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetIPCLoggingEnabled, 436 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetIPCLoggingEnabled,
437 OnSetIPCLoggingEnabled) 437 OnSetIPCLoggingEnabled)
438 #endif 438 #endif
439 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, 439 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus,
440 OnSetProfilerStatus) 440 OnSetProfilerStatus)
441 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, 441 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData,
442 OnGetChildProfilerData) 442 OnGetChildProfilerData)
443 IPC_MESSAGE_HANDLER(ChildProcessMsg_DumpHandles, OnDumpHandles) 443 IPC_MESSAGE_HANDLER(ChildProcessMsg_DumpHandles, OnDumpHandles)
444 #if defined(OS_WIN)
445 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded,
446 OnProcessBackgrounded)
447 #endif
444 #if defined(USE_TCMALLOC) 448 #if defined(USE_TCMALLOC)
445 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetTcmallocStats, OnGetTcmallocStats) 449 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetTcmallocStats, OnGetTcmallocStats)
446 #endif 450 #endif
447 IPC_MESSAGE_UNHANDLED(handled = false) 451 IPC_MESSAGE_UNHANDLED(handled = false)
448 IPC_END_MESSAGE_MAP() 452 IPC_END_MESSAGE_MAP()
449 453
450 if (handled) 454 if (handled)
451 return true; 455 return true;
452 456
453 if (msg.routing_id() == MSG_ROUTING_CONTROL) 457 if (msg.routing_id() == MSG_ROUTING_CONTROL)
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // race conditions if the process refcount is 0 but there's an IPC message 546 // race conditions if the process refcount is 0 but there's an IPC message
543 // inflight that would addref it. 547 // inflight that would addref it.
544 Send(new ChildProcessHostMsg_ShutdownRequest); 548 Send(new ChildProcessHostMsg_ShutdownRequest);
545 } 549 }
546 550
547 void ChildThread::EnsureConnected() { 551 void ChildThread::EnsureConnected() {
548 VLOG(0) << "ChildThread::EnsureConnected()"; 552 VLOG(0) << "ChildThread::EnsureConnected()";
549 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 553 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
550 } 554 }
551 555
556 #if defined(OS_WIN)
557 void ChildThread::OnProcessBackgrounded(bool background) {
558 base::Process::Current().SetProcessBackgrounded(background);
559 }
560 #endif
561
552 } // namespace content 562 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698