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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1133143003: [Android] Suspend shared timers for hidden renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_remove_suspend
Patch Set: Use ContentRendererClient Created 5 years, 3 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 (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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 } 1162 }
1163 1163
1164 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { 1164 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
1165 #if defined(ENABLE_EXTENSIONS) 1165 #if defined(ENABLE_EXTENSIONS)
1166 return !IsStandaloneExtensionProcess(); 1166 return !IsStandaloneExtensionProcess();
1167 #else 1167 #else
1168 return true; 1168 return true;
1169 #endif 1169 #endif
1170 } 1170 }
1171 1171
1172 bool ChromeContentRendererClient::
1173 AllowTimerSuspensionWhenProcessBackgrounded() {
1174 #if defined(OS_ANDROID)
1175 return true;
1176 #else
1177 return false;
1178 #endif
1179 }
1180
1172 bool ChromeContentRendererClient::AllowPopup() { 1181 bool ChromeContentRendererClient::AllowPopup() {
1173 #if defined(ENABLE_EXTENSIONS) 1182 #if defined(ENABLE_EXTENSIONS)
1174 extensions::ScriptContext* current_context = 1183 extensions::ScriptContext* current_context =
1175 extension_dispatcher_->script_context_set().GetCurrent(); 1184 extension_dispatcher_->script_context_set().GetCurrent();
1176 if (!current_context || !current_context->extension()) 1185 if (!current_context || !current_context->extension())
1177 return false; 1186 return false;
1178 // See http://crbug.com/117446 for the subtlety of this check. 1187 // See http://crbug.com/117446 for the subtlety of this check.
1179 switch (current_context->context_type()) { 1188 switch (current_context->context_type()) {
1180 case extensions::Feature::UNSPECIFIED_CONTEXT: 1189 case extensions::Feature::UNSPECIFIED_CONTEXT:
1181 case extensions::Feature::WEB_PAGE_CONTEXT: 1190 case extensions::Feature::WEB_PAGE_CONTEXT:
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 context, url); 1651 context, url);
1643 #endif 1652 #endif
1644 } 1653 }
1645 1654
1646 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( 1655 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread(
1647 const GURL& url) { 1656 const GURL& url) {
1648 #if defined(ENABLE_EXTENSIONS) 1657 #if defined(ENABLE_EXTENSIONS)
1649 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(url); 1658 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(url);
1650 #endif 1659 #endif
1651 } 1660 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | components/scheduler/renderer/renderer_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698