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

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

Issue 2650753002: Implement renderer importance API for WebView (Closed)
Patch Set: clean up unused local Created 3 years, 10 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
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 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { 2799 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) {
2800 SetSuddenTerminationAllowed(enabled); 2800 SetSuddenTerminationAllowed(enabled);
2801 } 2801 }
2802 2802
2803 void RenderProcessHostImpl::UpdateProcessPriority() { 2803 void RenderProcessHostImpl::UpdateProcessPriority() {
2804 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) { 2804 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) {
2805 is_process_backgrounded_ = false; 2805 is_process_backgrounded_ = false;
2806 return; 2806 return;
2807 } 2807 }
2808 2808
2809 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2810 switches::kDisableRendererPriorityManagement)) {
2811 return;
2812 }
2813
2809 // We background a process as soon as it hosts no active audio streams and no 2814 // We background a process as soon as it hosts no active audio streams and no
2810 // visible widgets -- the callers must call this function whenever we 2815 // visible widgets -- the callers must call this function whenever we
2811 // transition in/out of those states. 2816 // transition in/out of those states.
2812 const bool should_background = 2817 const bool should_background =
2813 visible_widgets_ == 0 && !audio_renderer_host_->HasActiveAudio() && 2818 visible_widgets_ == 0 && !audio_renderer_host_->HasActiveAudio() &&
2814 !base::CommandLine::ForCurrentProcess()->HasSwitch( 2819 !base::CommandLine::ForCurrentProcess()->HasSwitch(
2815 switches::kDisableRendererBackgrounding); 2820 switches::kDisableRendererBackgrounding);
2816 2821
2817 // TODO(sebsg): Remove this ifdef when https://crbug.com/537671 is fixed. 2822 // TODO(sebsg): Remove this ifdef when https://crbug.com/537671 is fixed.
2818 #if !defined(OS_ANDROID) 2823 #if !defined(OS_ANDROID)
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3052 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3057 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3053 3058
3054 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3059 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3055 // Capture the error message in a crash key value. 3060 // Capture the error message in a crash key value.
3056 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3061 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3057 bad_message::ReceivedBadMessage(render_process_id, 3062 bad_message::ReceivedBadMessage(render_process_id,
3058 bad_message::RPH_MOJO_PROCESS_ERROR); 3063 bad_message::RPH_MOJO_PROCESS_ERROR);
3059 } 3064 }
3060 3065
3061 } // namespace content 3066 } // namespace content
OLDNEW
« no previous file with comments | « android_webview/native/aw_renderer_priority_manager.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698