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

Side by Side Diff: chrome/browser/extensions/extension_process_manager.cc

Issue 10141003: Fix bug with transient pages where they would stay alive permanently due to a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 "chrome/browser/extensions/extension_event_router.h" 8 #include "chrome/browser/extensions/extension_event_router.h"
9 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 void ExtensionProcessManager::OnUnloadAck(const std::string& extension_id) { 447 void ExtensionProcessManager::OnUnloadAck(const std::string& extension_id) {
448 ExtensionHost* host = GetBackgroundHostForExtension(extension_id); 448 ExtensionHost* host = GetBackgroundHostForExtension(extension_id);
449 if (host) 449 if (host)
450 CloseBackgroundHost(host); 450 CloseBackgroundHost(host);
451 } 451 }
452 452
453 void ExtensionProcessManager::OnNetworkRequestStarted( 453 void ExtensionProcessManager::OnNetworkRequestStarted(
454 RenderViewHost* render_view_host) { 454 RenderViewHost* render_view_host) {
455 ExtensionHost* host = GetBackgroundHostForExtension( 455 ExtensionHost* host = GetBackgroundHostForExtension(
456 GetExtensionID(render_view_host)); 456 GetExtensionID(render_view_host));
457 if (host) 457 if (host && host->render_view_host() == render_view_host)
458 IncrementLazyKeepaliveCount(host->extension()); 458 IncrementLazyKeepaliveCount(host->extension());
459 } 459 }
460 460
461 void ExtensionProcessManager::OnNetworkRequestDone( 461 void ExtensionProcessManager::OnNetworkRequestDone(
462 RenderViewHost* render_view_host) { 462 RenderViewHost* render_view_host) {
463 ExtensionHost* host = GetBackgroundHostForExtension( 463 ExtensionHost* host = GetBackgroundHostForExtension(
464 GetExtensionID(render_view_host)); 464 GetExtensionID(render_view_host));
465 if (host) 465 if (host && host->render_view_host() == render_view_host)
466 DecrementLazyKeepaliveCount(host->extension()); 466 DecrementLazyKeepaliveCount(host->extension());
467 } 467 }
468 468
469 void ExtensionProcessManager::Observe( 469 void ExtensionProcessManager::Observe(
470 int type, 470 int type,
471 const content::NotificationSource& source, 471 const content::NotificationSource& source,
472 const content::NotificationDetails& details) { 472 const content::NotificationDetails& details) {
473 switch (type) { 473 switch (type) {
474 case chrome::NOTIFICATION_EXTENSIONS_READY: { 474 case chrome::NOTIFICATION_EXTENSIONS_READY: {
475 CreateBackgroundHostsForProfileStartup(this, 475 CreateBackgroundHostsForProfileStartup(this,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 if (service && service->is_ready()) 685 if (service && service->is_ready())
686 CreateBackgroundHostsForProfileStartup(this, service->extensions()); 686 CreateBackgroundHostsForProfileStartup(this, service->extensions());
687 } 687 }
688 break; 688 break;
689 } 689 }
690 default: 690 default:
691 ExtensionProcessManager::Observe(type, source, details); 691 ExtensionProcessManager::Observe(type, source, details);
692 break; 692 break;
693 } 693 }
694 } 694 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698