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

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

Issue 6932038: avoid dereferencing NULL extension in ExtensionHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/browser_window.h" 7 #include "chrome/browser/ui/browser_window.h"
8 #include "content/browser/browsing_instance.h" 8 #include "content/browser/browsing_instance.h"
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 #include "chrome/browser/extensions/extension_host_mac.h" 10 #include "chrome/browser/extensions/extension_host_mac.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 break; 285 break;
286 } 286 }
287 287
288 case NotificationType::EXTENSION_UNLOADED: { 288 case NotificationType::EXTENSION_UNLOADED: {
289 const Extension* extension = 289 const Extension* extension =
290 Details<UnloadedExtensionInfo>(details)->extension; 290 Details<UnloadedExtensionInfo>(details)->extension;
291 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); 291 for (ExtensionHostSet::iterator iter = background_hosts_.begin();
292 iter != background_hosts_.end(); ++iter) { 292 iter != background_hosts_.end(); ++iter) {
293 ExtensionHost* host = *iter; 293 ExtensionHost* host = *iter;
294 if (host->extension()->id() == extension->id()) { 294 if (host->extension() == NULL ||
Matt Perry 2011/05/05 17:17:59 This seems a little dangerous to me. Here's an alt
295 host->extension()->id() == extension->id()) {
295 delete host; 296 delete host;
296 // |host| should deregister itself from our structures. 297 // |host| should deregister itself from our structures.
297 DCHECK(background_hosts_.find(host) == background_hosts_.end()); 298 DCHECK(background_hosts_.find(host) == background_hosts_.end());
298 break; 299 break;
299 } 300 }
300 } 301 }
301 break; 302 break;
302 } 303 }
303 304
304 case NotificationType::EXTENSION_HOST_DESTROYED: { 305 case NotificationType::EXTENSION_HOST_DESTROYED: {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 if (service && service->is_ready()) 453 if (service && service->is_ready())
453 CreateBackgroundHosts(this, service->extensions()); 454 CreateBackgroundHosts(this, service->extensions());
454 } 455 }
455 break; 456 break;
456 } 457 }
457 default: 458 default:
458 ExtensionProcessManager::Observe(type, source, details); 459 ExtensionProcessManager::Observe(type, source, details);
459 break; 460 break;
460 } 461 }
461 } 462 }
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