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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 956313002: ChromeContentRendererClient should not rely on Dispatcher::is_extension_process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing ifdefs Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index b40e77e78d377c5f3791a04deee6c37cda28a3b9..19c6ff5d4721119147fb42a77ec62141da757693 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -194,11 +194,11 @@ Dispatcher::Dispatcher(DispatcherDelegate* delegate)
webrequest_used_(false) {
const base::CommandLine& command_line =
*(base::CommandLine::ForCurrentProcess());
- is_extension_process_ =
+ set_idle_notifications_ =
command_line.HasSwitch(switches::kExtensionProcess) ||
command_line.HasSwitch(::switches::kSingleProcess);
- if (is_extension_process_) {
+ if (set_idle_notifications_) {
RenderThread::Get()->SetIdleNotificationDelayInMs(
kInitialExtensionIdleHandlerDelayMs);
}
@@ -527,7 +527,7 @@ void Dispatcher::InvokeModuleSystemMethod(content::RenderView* render_view,
// Reset the idle handler each time there's any activity like event or message
// dispatch, for which Invoke is the chokepoint.
- if (is_extension_process_) {
+ if (set_idle_notifications_) {
RenderThread::Get()->ScheduleIdleHandler(
kInitialExtensionIdleHandlerDelayMs);
}
@@ -825,7 +825,7 @@ bool Dispatcher::OnControlMessageReceived(const IPC::Message& message) {
void Dispatcher::WebKitInitialized() {
// For extensions, we want to ensure we call the IdleHandler every so often,
// even if the extension keeps up activity.
- if (is_extension_process_) {
+ if (set_idle_notifications_) {
forced_idle_timer_.reset(new base::RepeatingTimer<content::RenderThread>);
forced_idle_timer_->Start(
FROM_HERE,
@@ -851,7 +851,7 @@ void Dispatcher::WebKitInitialized() {
}
void Dispatcher::IdleNotification() {
- if (is_extension_process_ && forced_idle_timer_) {
+ if (set_idle_notifications_ && forced_idle_timer_) {
// Dampen the forced delay as well if the extension stays idle for long
// periods of time. (forced_idle_timer_ can be NULL after
// OnRenderProcessShutdown has been called.)
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698