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

Side by Side Diff: extensions/browser/process_manager.cc

Issue 61063003: Keep NaCl plugins used in app background pages alive when active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment for 'active' instance. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « content/public/browser/browser_ppapi_host.h ('k') | ppapi/proxy/plugin_globals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 content::NotificationService::AllSources()); 196 content::NotificationService::AllSources());
197 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, 197 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED,
198 content::Source<BrowserContext>(original_context)); 198 content::Source<BrowserContext>(original_context));
199 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, 199 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
200 content::Source<BrowserContext>(context)); 200 content::Source<BrowserContext>(context));
201 if (context->IsOffTheRecord()) { 201 if (context->IsOffTheRecord()) {
202 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, 202 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
203 content::Source<BrowserContext>(original_context)); 203 content::Source<BrowserContext>(original_context));
204 } 204 }
205 205
206 // Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than
207 // kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals.
206 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); 208 event_page_idle_time_ = base::TimeDelta::FromSeconds(10);
207 unsigned idle_time_msec = 0; 209 unsigned idle_time_msec = 0;
208 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 210 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
209 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { 211 extensions::switches::kEventPageIdleTime), &idle_time_msec)) {
210 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. 212 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero.
211 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); 213 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec);
212 } 214 }
213 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); 215 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5);
214 unsigned suspending_time_msec = 0; 216 unsigned suspending_time_msec = 0;
215 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 217 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 } 848 }
847 849
848 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { 850 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) {
849 // Keep in sync with duplicate in extension_info_map.cc. 851 // Keep in sync with duplicate in extension_info_map.cc.
850 ExtensionService* service = ExtensionSystem::GetForBrowserContext( 852 ExtensionService* service = ExtensionSystem::GetForBrowserContext(
851 GetBrowserContext())->extension_service(); 853 GetBrowserContext())->extension_service();
852 return extension_util::IsIncognitoEnabled(extension->id(), service); 854 return extension_util::IsIncognitoEnabled(extension->id(), service);
853 } 855 }
854 856
855 } // namespace extensions 857 } // namespace extensions
OLDNEW
« no previous file with comments | « content/public/browser/browser_ppapi_host.h ('k') | ppapi/proxy/plugin_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698