Commit e9629d77 authored by mihaip@chromium.org's avatar mihaip@chromium.org

Make the manifest_ member of Extension into a scoped_ptr.

Forwarded declared classes can be used as template parameters.

R=aa@chromium.org


Review URL: https://chromiumcodereview.appspot.com/10836088

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150130 0039d316-1c4b-4281-b951-d872f2087c98
parent f231cddb
...@@ -1278,7 +1278,7 @@ bool Extension::LoadLaunchContainer(string16* error) { ...@@ -1278,7 +1278,7 @@ bool Extension::LoadLaunchContainer(string16* error) {
launch_container_ == extension_misc::LAUNCH_WINDOW; launch_container_ == extension_misc::LAUNCH_WINDOW;
// Validate the container width if present. // Validate the container width if present.
if (!ReadLaunchDimension(manifest_, if (!ReadLaunchDimension(manifest_.get(),
keys::kLaunchWidth, keys::kLaunchWidth,
&launch_width_, &launch_width_,
can_specify_initial_size, can_specify_initial_size,
...@@ -1286,7 +1286,7 @@ bool Extension::LoadLaunchContainer(string16* error) { ...@@ -1286,7 +1286,7 @@ bool Extension::LoadLaunchContainer(string16* error) {
return false; return false;
// Validate container height if present. // Validate container height if present.
if (!ReadLaunchDimension(manifest_, if (!ReadLaunchDimension(manifest_.get(),
keys::kLaunchHeight, keys::kLaunchHeight,
&launch_height_, &launch_height_,
can_specify_initial_size, can_specify_initial_size,
...@@ -2912,8 +2912,6 @@ Extension::Extension(const FilePath& path, ...@@ -2912,8 +2912,6 @@ Extension::Extension(const FilePath& path,
} }
Extension::~Extension() { Extension::~Extension() {
if (manifest_)
delete manifest_;
} }
ExtensionResource Extension::GetResource( ExtensionResource Extension::GetResource(
......
...@@ -662,7 +662,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> { ...@@ -662,7 +662,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
const GURL& update_url() const { return update_url_; } const GURL& update_url() const { return update_url_; }
const ExtensionIconSet& icons() const { return icons_; } const ExtensionIconSet& icons() const { return icons_; }
const extensions::Manifest* manifest() const { const extensions::Manifest* manifest() const {
return manifest_; return manifest_.get();
} }
const std::string default_locale() const { return default_locale_; } const std::string default_locale() const { return default_locale_; }
const URLOverrideMap& GetChromeURLOverrides() const { const URLOverrideMap& GetChromeURLOverrides() const {
...@@ -1069,15 +1069,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> { ...@@ -1069,15 +1069,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
GURL update_url_; GURL update_url_;
// The manifest from which this extension was created. // The manifest from which this extension was created.
// scoped_ptr<Manifest> manifest_;
// NOTE: This is an owned pointer, but can't use scoped_ptr because that would
// require manifest.h, which would in turn create a circulate dependency
// between extension.h and manifest.h.
//
// TODO(aa): Pull Extension::Type and Extension::Location out into their own
// files so that manifest.h can rely on them and not get all of extension.h
// too, and then change this back to a scoped_ptr.
extensions::Manifest* manifest_;
// A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs
// which override the handling of those URLs. (see ExtensionOverrideUI). // which override the handling of those URLs. (see ExtensionOverrideUI).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment