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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 6932038: avoid dereferencing NULL extension in ExtensionHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflect comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 003f563370f238abb50cd7449cb89f9d2746e4ed..7badebfca008cb1df3d75ec7525b169c527e6843 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -126,6 +126,7 @@ ExtensionHost::ExtensionHost(const Extension* extension,
const GURL& url,
ViewType::Type host_type)
: extension_(extension),
+ extension_id_(extension->id()),
profile_(site_instance->browsing_instance()->profile()),
did_stop_loading_(false),
document_element_available_(false),
@@ -234,8 +235,7 @@ void ExtensionHost::NavigateToURL(const GURL& url) {
// Prevent explicit navigation to another extension id's pages.
// This method is only called by some APIs, so we still need to protect
// DidNavigate below (location = "").
- if (url.SchemeIs(chrome::kExtensionScheme) &&
- url.host() != extension_->id()) {
+ if (url.SchemeIs(chrome::kExtensionScheme) && url.host() != extension_id()) {
// TODO(erikkay) communicate this back to the caller?
return;
}
@@ -259,7 +259,7 @@ void ExtensionHost::Observe(NotificationType type,
switch (type.value) {
case NotificationType::EXTENSION_BACKGROUND_PAGE_READY:
DCHECK(profile_->GetExtensionService()->
- IsBackgroundPageReady(extension_));
+ IsBackgroundPageReady(extension_));
NavigateToURL(url_);
break;
case NotificationType::RENDERER_PROCESS_CREATED:
@@ -342,7 +342,7 @@ void ExtensionHost::DidNavigate(RenderViewHost* render_view_host,
// will leave the host in kind of a bad state with poor UI and errors, but
// it's better than the alternative.
// TODO(erikkay) Perhaps we should display errors in developer mode.
- if (params.url.host() != extension_->id()) {
+ if (params.url.host() != extension_id()) {
extension_function_dispatcher_.reset(NULL);
return;
}
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698