| OLD | NEW |
| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 250 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 251 content::Source<BrowserContext>(original_context)); | 251 content::Source<BrowserContext>(original_context)); |
| 252 } | 252 } |
| 253 | 253 |
| 254 // Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than | 254 // Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than |
| 255 // kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals. | 255 // kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals. |
| 256 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); | 256 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); |
| 257 unsigned idle_time_msec = 0; | 257 unsigned idle_time_msec = 0; |
| 258 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 258 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 259 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { | 259 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { |
| 260 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. | 260 CHECK_GT(idle_time_msec, 0u); // OnKeepaliveImpulseCheck requires non zero. |
| 261 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); | 261 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); |
| 262 } | 262 } |
| 263 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); | 263 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); |
| 264 unsigned suspending_time_msec = 0; | 264 unsigned suspending_time_msec = 0; |
| 265 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 265 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 266 extensions::switches::kEventPageSuspendingTime), | 266 extensions::switches::kEventPageSuspendingTime), |
| 267 &suspending_time_msec)) { | 267 &suspending_time_msec)) { |
| 268 event_page_suspending_time_ = | 268 event_page_suspending_time_ = |
| 269 base::TimeDelta::FromMilliseconds(suspending_time_msec); | 269 base::TimeDelta::FromMilliseconds(suspending_time_msec); |
| 270 } | 270 } |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 const Extension* extension = | 931 const Extension* extension = |
| 932 registry->enabled_extensions().GetExtensionOrAppByURL(url); | 932 registry->enabled_extensions().GetExtensionOrAppByURL(url); |
| 933 if (extension && !IncognitoInfo::IsSplitMode(extension)) { | 933 if (extension && !IncognitoInfo::IsSplitMode(extension)) { |
| 934 return original_manager_->GetSiteInstanceForURL(url); | 934 return original_manager_->GetSiteInstanceForURL(url); |
| 935 } | 935 } |
| 936 } | 936 } |
| 937 return ProcessManager::GetSiteInstanceForURL(url); | 937 return ProcessManager::GetSiteInstanceForURL(url); |
| 938 } | 938 } |
| 939 | 939 |
| 940 } // namespace extensions | 940 } // namespace extensions |
| OLD | NEW |