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

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

Issue 2454073003: Allow backgrounding processes on Mac (Closed)
Patch Set: Remove unnecessary forward declare 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
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 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 channel_->Unpause(false /* flush */); 2798 channel_->Unpause(false /* flush */);
2799 2799
2800 if (child_connection_) { 2800 if (child_connection_) {
2801 child_connection_->SetProcessHandle( 2801 child_connection_->SetProcessHandle(
2802 child_process_launcher_->GetProcess().Handle()); 2802 child_process_launcher_->GetProcess().Handle());
2803 } 2803 }
2804 2804
2805 // Not all platforms launch processes in the same backgrounded state. Make 2805 // Not all platforms launch processes in the same backgrounded state. Make
2806 // sure |is_process_backgrounded_| reflects this platform's initial process 2806 // sure |is_process_backgrounded_| reflects this platform's initial process
2807 // state. 2807 // state.
2808 #if defined(OS_MACOSX)
2809 is_process_backgrounded_ =
2810 child_process_launcher_->GetProcess().IsProcessBackgrounded(
2811 MachBroker::GetInstance());
2812 #else
2808 is_process_backgrounded_ = 2813 is_process_backgrounded_ =
2809 child_process_launcher_->GetProcess().IsProcessBackgrounded(); 2814 child_process_launcher_->GetProcess().IsProcessBackgrounded();
2815 #endif // defined(OS_MACOSX)
2810 2816
2811 // Disable updating process priority on startup for now as it incorrectly 2817 // Disable updating process priority on startup for now as it incorrectly
shrike 2016/10/31 17:26:05 It seems like this comment should stay at its curr
lgrey 2016/10/31 19:22:02 This was from git cl format. Is it OK to override
shrike 2016/10/31 20:32:36 As long as your change follows the spec it should
Nico 2016/11/01 02:07:27 `git cl format` aligns comments in front of a prep
2812 // results in backgrounding foreground navigations until their first commit 2818 // results in backgrounding foreground navigations until their first commit
2813 // is made. A better long term solution would be to be aware of the tab's 2819 // is made. A better long term solution would be to be aware of the tab's
2814 // visibility at this point. https://crbug.com/560446. 2820 // visibility at this point. https://crbug.com/560446.
2815 // Except on Android for now because of https://crbug.com/601184 :-(. 2821 // Except on Android for now because of https://crbug.com/601184 :-(.
2816 #if defined(OS_ANDROID) 2822 #if defined(OS_ANDROID)
2817 UpdateProcessPriority(); 2823 UpdateProcessPriority();
2818 #endif 2824 #endif
2819 2825
2820 // Share histograms between the renderer and this process. 2826 // Share histograms between the renderer and this process.
2821 CreateSharedRendererHistogramAllocator(); 2827 CreateSharedRendererHistogramAllocator();
2822 } 2828 }
2823 2829
2824 // NOTE: This needs to be before flushing queued messages, because 2830 // NOTE: This needs to be before flushing queued messages, because
2825 // ExtensionService uses this notification to initialize the renderer process 2831 // ExtensionService uses this notification to initialize the renderer process
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 bad_message::ReceivedBadMessage(render_process_id, 2990 bad_message::ReceivedBadMessage(render_process_id,
2985 bad_message::RPH_MOJO_PROCESS_ERROR); 2991 bad_message::RPH_MOJO_PROCESS_ERROR);
2986 } 2992 }
2987 2993
2988 void RenderProcessHostImpl::CreateURLLoaderFactory( 2994 void RenderProcessHostImpl::CreateURLLoaderFactory(
2989 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { 2995 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) {
2990 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); 2996 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request));
2991 } 2997 }
2992 2998
2993 } // namespace content 2999 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698