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

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

Issue 6948007: Merge 84502 - avoid dereferencing NULL extension in ExtensionHost (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: 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
===================================================================
--- chrome/browser/extensions/extension_host.cc (revision 84504)
+++ chrome/browser/extensions/extension_host.cc (working copy)
@@ -124,6 +124,7 @@
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),
@@ -233,8 +234,7 @@
// 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;
}
@@ -258,7 +258,7 @@
switch (type.value) {
case NotificationType::EXTENSION_BACKGROUND_PAGE_READY:
DCHECK(profile_->GetExtensionService()->
- IsBackgroundPageReady(extension_));
+ IsBackgroundPageReady(extension_));
NavigateToURL(url_);
break;
case NotificationType::RENDERER_PROCESS_CREATED:
@@ -341,7 +341,7 @@
// 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