Chromium Code Reviews| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 | 444 |
| 445 return count; | 445 return count; |
| 446 } | 446 } |
| 447 | 447 |
| 448 int ExtensionProcessManager::DecrementLazyKeepaliveCount( | 448 int ExtensionProcessManager::DecrementLazyKeepaliveCount( |
| 449 const Extension* extension) { | 449 const Extension* extension) { |
| 450 if (!extension->has_lazy_background_page()) | 450 if (!extension->has_lazy_background_page()) |
| 451 return 0; | 451 return 0; |
| 452 | 452 |
| 453 int& count = background_page_data_[extension->id()].lazy_keepalive_count; | 453 int& count = background_page_data_[extension->id()].lazy_keepalive_count; |
| 454 DCHECK_GT(count, 0); | 454 // TODO(fsamuel): What to do here? This fires when using WebRequests in |
| 455 // <webview>. | |
|
Matt Perry
2013/02/06 22:40:24
That's not good. These refcount errors are not fun
Fady Samuel
2013/05/15 21:58:53
Fixed. Calling IncrementInFlightEventsOnUI in Even
| |
| 456 //DCHECK_GT(count, 0); | |
| 455 if (--count == 0) { | 457 if (--count == 0) { |
| 456 MessageLoop::current()->PostDelayedTask( | 458 MessageLoop::current()->PostDelayedTask( |
| 457 FROM_HERE, | 459 FROM_HERE, |
| 458 base::Bind(&ExtensionProcessManager::OnLazyBackgroundPageIdle, | 460 base::Bind(&ExtensionProcessManager::OnLazyBackgroundPageIdle, |
| 459 weak_ptr_factory_.GetWeakPtr(), extension->id(), | 461 weak_ptr_factory_.GetWeakPtr(), extension->id(), |
| 460 ++background_page_data_[extension->id()].close_sequence_id), | 462 ++background_page_data_[extension->id()].close_sequence_id), |
| 461 event_page_idle_time_); | 463 event_page_idle_time_); |
| 462 } | 464 } |
| 463 | 465 |
| 464 return count; | 466 return count; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 856 CreateBackgroundHostsForProfileStartup(GetProfile(), | 858 CreateBackgroundHostsForProfileStartup(GetProfile(), |
| 857 this, service->extensions()); | 859 this, service->extensions()); |
| 858 } | 860 } |
| 859 break; | 861 break; |
| 860 } | 862 } |
| 861 default: | 863 default: |
| 862 ExtensionProcessManager::Observe(type, source, details); | 864 ExtensionProcessManager::Observe(type, source, details); |
| 863 break; | 865 break; |
| 864 } | 866 } |
| 865 } | 867 } |
| OLD | NEW |