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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2454073003: Allow backgrounding processes on Mac (Closed)
Patch Set: Address review comments Created 4 years, 1 month 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
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 channel_->Unpause(false /* flush */); 2797 channel_->Unpause(false /* flush */);
2798 2798
2799 if (child_connection_) { 2799 if (child_connection_) {
2800 child_connection_->SetProcessHandle( 2800 child_connection_->SetProcessHandle(
2801 child_process_launcher_->GetProcess().Handle()); 2801 child_process_launcher_->GetProcess().Handle());
2802 } 2802 }
2803 2803
2804 // Not all platforms launch processes in the same backgrounded state. Make 2804 // Not all platforms launch processes in the same backgrounded state. Make
2805 // sure |is_process_backgrounded_| reflects this platform's initial process 2805 // sure |is_process_backgrounded_| reflects this platform's initial process
2806 // state. 2806 // state.
2807 #if defined(OS_MACOSX)
2808 is_process_backgrounded_ =
2809 child_process_launcher_->GetProcess().IsProcessBackgrounded(
2810 MachBroker::GetInstance());
2811 #else
2807 is_process_backgrounded_ = 2812 is_process_backgrounded_ =
2808 child_process_launcher_->GetProcess().IsProcessBackgrounded(); 2813 child_process_launcher_->GetProcess().IsProcessBackgrounded();
2814 #endif // defined(OS_MACOSX)
2809 2815
2810 // Disable updating process priority on startup for now as it incorrectly 2816 // Disable updating process priority on startup for now as it incorrectly
2811 // results in backgrounding foreground navigations until their first commit 2817 // results in backgrounding foreground navigations until their first commit
2812 // is made. A better long term solution would be to be aware of the tab's 2818 // is made. A better long term solution would be to be aware of the tab's
2813 // visibility at this point. https://crbug.com/560446. 2819 // visibility at this point. https://crbug.com/560446.
2814 // Except on Android for now because of https://crbug.com/601184 :-(. 2820 // Except on Android for now because of https://crbug.com/601184 :-(.
2815 #if defined(OS_ANDROID) 2821 #if defined(OS_ANDROID)
2816 UpdateProcessPriority(); 2822 UpdateProcessPriority();
2817 #endif 2823 #endif
2818 2824
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 bad_message::ReceivedBadMessage(render_process_id, 2989 bad_message::ReceivedBadMessage(render_process_id,
2984 bad_message::RPH_MOJO_PROCESS_ERROR); 2990 bad_message::RPH_MOJO_PROCESS_ERROR);
2985 } 2991 }
2986 2992
2987 void RenderProcessHostImpl::CreateURLLoaderFactory( 2993 void RenderProcessHostImpl::CreateURLLoaderFactory(
2988 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { 2994 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) {
2989 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); 2995 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request));
2990 } 2996 }
2991 2997
2992 } // namespace content 2998 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698