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

Unified Diff: chrome/common/extensions/extension_messages.cc

Issue 7619011: Simplify ExtensionMsg_Loaded_Params message interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_messages.cc
diff --git a/chrome/common/extensions/extension_messages.cc b/chrome/common/extensions/extension_messages.cc
index fe88896287fa805f6745be8bba3f72b4d6467200..60f04e00bb67d256a097364565018fcab2c924f8 100644
--- a/chrome/common/extensions/extension_messages.cc
+++ b/chrome/common/extensions/extension_messages.cc
@@ -8,30 +8,29 @@
#include "content/common/common_param_traits.h"
ExtensionMsg_Loaded_Params::ExtensionMsg_Loaded_Params()
- : location(Extension::INVALID) {
-}
+ : location(Extension::INVALID) {}
-ExtensionMsg_Loaded_Params::~ExtensionMsg_Loaded_Params() {
-}
+ExtensionMsg_Loaded_Params::~ExtensionMsg_Loaded_Params() {}
ExtensionMsg_Loaded_Params::ExtensionMsg_Loaded_Params(
const ExtensionMsg_Loaded_Params& other)
: manifest(other.manifest->DeepCopy()),
location(other.location),
path(other.path),
+ apis(other.apis),
+ explicit_hosts(other.explicit_hosts),
+ scriptable_hosts(other.scriptable_hosts),
id(other.id),
- creation_flags(other.creation_flags) {
-}
+ creation_flags(other.creation_flags) {}
ExtensionMsg_Loaded_Params::ExtensionMsg_Loaded_Params(
- const Extension* extension,
- const ExtensionPermissionSet* active)
+ const Extension* extension)
: manifest(new DictionaryValue()),
location(extension->location()),
path(extension->path()),
- apis(active->apis()),
- explicit_hosts(active->explicit_hosts()),
- scriptable_hosts(active->scriptable_hosts()),
+ apis(extension->GetActivePermissions()->apis()),
+ explicit_hosts(extension->GetActivePermissions()->explicit_hosts()),
+ scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()),
id(extension->id()),
creation_flags(extension->creation_flags()) {
// As we need more bits of extension data in the renderer, add more keys to
@@ -65,15 +64,13 @@ scoped_refptr<Extension>
&error));
if (!extension.get())
LOG(ERROR) << "Error deserializing extension: " << error;
+ else
+ extension->SetActivePermissions(
+ new ExtensionPermissionSet(apis, explicit_hosts, scriptable_hosts));
return extension;
}
-const ExtensionPermissionSet*
- ExtensionMsg_Loaded_Params::GetActivePermissions() const {
- return new ExtensionPermissionSet(apis, explicit_hosts, scriptable_hosts);
-}
-
namespace IPC {
template <>
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698