OLD | NEW |
---|---|
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/browser/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 | 422 |
423 return count; | 423 return count; |
424 } | 424 } |
425 | 425 |
426 int ExtensionProcessManager::DecrementLazyKeepaliveCount( | 426 int ExtensionProcessManager::DecrementLazyKeepaliveCount( |
427 const Extension* extension) { | 427 const Extension* extension) { |
428 if (!BackgroundInfo::HasLazyBackgroundPage(extension)) | 428 if (!BackgroundInfo::HasLazyBackgroundPage(extension)) |
429 return 0; | 429 return 0; |
430 | 430 |
431 int& count = background_page_data_[extension->id()].lazy_keepalive_count; | 431 int& count = background_page_data_[extension->id()].lazy_keepalive_count; |
432 // TODO(fsamuel): What to do here? This fires when using WebRequests in | |
433 // <webview>. | |
Matt Perry
2013/05/16 21:16:38
still?
Fady Samuel
2013/05/17 03:02:33
No, this has been fixed. This is a stale comment.
| |
432 DCHECK_GT(count, 0); | 434 DCHECK_GT(count, 0); |
433 if (--count == 0) { | 435 if (--count == 0) { |
434 MessageLoop::current()->PostDelayedTask( | 436 MessageLoop::current()->PostDelayedTask( |
435 FROM_HERE, | 437 FROM_HERE, |
436 base::Bind(&ExtensionProcessManager::OnLazyBackgroundPageIdle, | 438 base::Bind(&ExtensionProcessManager::OnLazyBackgroundPageIdle, |
437 weak_ptr_factory_.GetWeakPtr(), extension->id(), | 439 weak_ptr_factory_.GetWeakPtr(), extension->id(), |
438 ++background_page_data_[extension->id()].close_sequence_id), | 440 ++background_page_data_[extension->id()].close_sequence_id), |
439 event_page_idle_time_); | 441 event_page_idle_time_); |
440 } | 442 } |
441 | 443 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
893 if (service && service->is_ready()) | 895 if (service && service->is_ready()) |
894 CreateBackgroundHostsForProfileStartup(); | 896 CreateBackgroundHostsForProfileStartup(); |
895 } | 897 } |
896 break; | 898 break; |
897 } | 899 } |
898 default: | 900 default: |
899 ExtensionProcessManager::Observe(type, source, details); | 901 ExtensionProcessManager::Observe(type, source, details); |
900 break; | 902 break; |
901 } | 903 } |
902 } | 904 } |
OLD | NEW |