Index: extensions/renderer/dispatcher.cc |
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc |
index 13fadad7df52f354a67f706cdad60bcd96cb0787..a5b57b1995a7382d14a4bcfd14b778811342aad4 100644 |
--- a/extensions/renderer/dispatcher.cc |
+++ b/extensions/renderer/dispatcher.cc |
@@ -997,6 +997,7 @@ void Dispatcher::OnActivateExtension(const std::string& extension_id) { |
const Extension* extension = |
RendererExtensionRegistry::Get()->GetByID(extension_id); |
if (!extension) { |
+ NOTREACHED(); |
// Extension was activated but was never loaded. This probably means that |
// the renderer failed to load it (or the browser failed to tell us when it |
// did). Failures shouldn't happen, but instead of crashing there (which |
@@ -1092,8 +1093,11 @@ void Dispatcher::OnLoaded( |
// Dispatcher is attached to a RenderThread. Presumably there is a |
// mismatch there. In theory one would think it's possible for the |
// browser to figure this out itself - but again, cost/benefit. |
- if (!extension_registry->Contains(extension->id())) |
- extension_registry->Insert(extension); |
+ if (!extension_registry->Insert(extension)) { |
+ // TODO(devlin): This may be fixed by crbug.com/528026. Monitor, and |
+ // consider making this a release CHECK. |
+ NOTREACHED(); |
+ } |
} |
// Update the available bindings for all contexts. These may have changed if |
@@ -1160,8 +1164,12 @@ void Dispatcher::OnTransferBlobs(const std::vector<std::string>& blob_uuids) { |
void Dispatcher::OnUnloaded(const std::string& id) { |
// See comment in OnLoaded for why it would be nice, but perhaps incorrect, |
// to CHECK here rather than guarding. |
- if (!RendererExtensionRegistry::Get()->Remove(id)) |
+ // TODO(devlin): This may be fixed by crbug.com/528026. Monitor, and |
+ // consider making this a release CHECK. |
+ if (!RendererExtensionRegistry::Get()->Remove(id)) { |
+ NOTREACHED(); |
return; |
+ } |
active_extension_ids_.erase(id); |