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

Side by Side Diff: chrome/common/extensions/extension_messages.cc

Issue 14651017: Move RuntimeData and related permissions out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_permissions
Patch Set: Latest master Created 7 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/extension_messages.h" 5 #include "chrome/common/extensions/extension_messages.h"
6 6
7 #include "chrome/common/extensions/extension.h" 7 #include "chrome/common/extensions/extension.h"
8 #include "chrome/common/extensions/extension_constants.h" 8 #include "chrome/common/extensions/extension_constants.h"
9 #include "chrome/common/extensions/manifest.h" 9 #include "chrome/common/extensions/manifest.h"
10 #include "chrome/common/extensions/permissions/permissions_data.h"
10 #include "chrome/common/extensions/permissions/permissions_info.h" 11 #include "chrome/common/extensions/permissions/permissions_info.h"
11 #include "content/public/common/common_param_traits.h" 12 #include "content/public/common/common_param_traits.h"
12 13
13 using extensions::APIPermission; 14 using extensions::APIPermission;
14 using extensions::APIPermissionInfo; 15 using extensions::APIPermissionInfo;
15 using extensions::APIPermissionMap; 16 using extensions::APIPermissionMap;
16 using extensions::APIPermissionSet; 17 using extensions::APIPermissionSet;
17 using extensions::Extension; 18 using extensions::Extension;
18 using extensions::Manifest; 19 using extensions::Manifest;
19 using extensions::PermissionSet; 20 using extensions::PermissionSet;
(...skipping 15 matching lines...) Expand all
35 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()), 36 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()),
36 id(extension->id()), 37 id(extension->id()),
37 creation_flags(extension->creation_flags()) { 38 creation_flags(extension->creation_flags()) {
38 } 39 }
39 40
40 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( 41 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension(
41 std::string* error) const { 42 std::string* error) const {
42 scoped_refptr<Extension> extension = 43 scoped_refptr<Extension> extension =
43 Extension::Create(path, location, *manifest, creation_flags, error); 44 Extension::Create(path, location, *manifest, creation_flags, error);
44 if (extension) { 45 if (extension) {
45 extension->SetActivePermissions( 46 extensions::PermissionsData::SetActivePermissions(
46 new PermissionSet(apis, explicit_hosts, scriptable_hosts)); 47 extension,
48 new PermissionSet(apis, explicit_hosts, scriptable_hosts));
47 } 49 }
48 return extension; 50 return extension;
49 } 51 }
50 52
51 namespace IPC { 53 namespace IPC {
52 54
53 template <> 55 template <>
54 struct ParamTraits<Manifest::Location> { 56 struct ParamTraits<Manifest::Location> {
55 typedef Manifest::Location param_type; 57 typedef Manifest::Location param_type;
56 static void Write(Message* m, const param_type& p) { 58 static void Write(Message* m, const param_type& p) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 ReadParam(m, iter, &p->explicit_hosts) && 206 ReadParam(m, iter, &p->explicit_hosts) &&
205 ReadParam(m, iter, &p->scriptable_hosts); 207 ReadParam(m, iter, &p->scriptable_hosts);
206 } 208 }
207 209
208 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, 210 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p,
209 std::string* l) { 211 std::string* l) {
210 l->append(p.id); 212 l->append(p.id);
211 } 213 }
212 214
213 } // namespace IPC 215 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698