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

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

Issue 6932038: avoid dereferencing NULL extension in ExtensionHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed reduntant 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 | « no previous file | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.h
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h
index 1a23d207e2550d51aff1eb8c067d50d17b90da7b..2674b31d6d478b531f98e75fe2d68e286366b291 100644
--- a/chrome/browser/extensions/extension_host.h
+++ b/chrome/browser/extensions/extension_host.h
@@ -14,6 +14,7 @@
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h"
+#include "chrome/common/extensions/extension.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/common/notification_registrar.h"
@@ -26,7 +27,6 @@
#endif
class Browser;
-class Extension;
class FileSelectHelper;
class RenderProcessHost;
class RenderWidgetHostView;
@@ -37,7 +37,7 @@ struct WebPreferences;
// This class is the browser component of an extension component's RenderView.
// It handles setting up the renderer process, if needed, with special
// privileges available to extensions. It may have a view to be shown in the
-// in the browser UI, or it may be hidden.
+// browser UI, or it may be hidden.
class ExtensionHost : public RenderViewHostDelegate,
public RenderViewHostDelegate::View,
public ExtensionFunctionDispatcher::Delegate,
@@ -72,6 +72,10 @@ class ExtensionHost : public RenderViewHostDelegate,
void CreateView(Browser* browser);
const Extension* extension() const { return extension_; }
+ const std::string& id() const {
Matt Perry 2011/05/06 18:19:36 I think this should be named extension_id (and the
Denis Lagno 2011/05/06 19:50:33 Done.
+ DCHECK(extension_ == NULL || extension_->id() == id_);
Matt Perry 2011/05/06 18:19:36 nit: this is overkill IMO. I'd leave it out.
Denis Lagno 2011/05/06 19:50:33 Done.
+ return id_;
+ }
RenderViewHost* render_view_host() const { return render_view_host_; }
RenderProcessHost* render_process_host() const;
SiteInstance* site_instance() const;
@@ -241,6 +245,9 @@ class ExtensionHost : public RenderViewHostDelegate,
// The extension that we're hosting in this view.
const Extension* extension_;
+ // Id of extension that we're hosting in this view.
+ std::string id_;
akalin 2011/05/06 18:40:31 may as well make this const
Denis Lagno 2011/05/06 19:50:33 Done.
+
// The profile that this host is tied to.
Profile* profile_;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698