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

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

Issue 1057753003: [Extensions] Fix thread-safety bug in PermissionsData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jeffrey's Created 5 years, 8 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 | « no previous file | extensions/common/permissions/permissions_data.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/extension_messages.h" 5 #include "extensions/common/extension_messages.h"
6 6
7 #include "content/public/common/common_param_traits.h" 7 #include "content/public/common/common_param_traits.h"
8 #include "extensions/common/extension.h" 8 #include "extensions/common/extension.h"
9 #include "extensions/common/manifest.h" 9 #include "extensions/common/manifest.h"
10 #include "extensions/common/manifest_handler.h" 10 #include "extensions/common/manifest_handler.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 bool include_tab_permissions) 53 bool include_tab_permissions)
54 : manifest(extension->manifest()->value()->DeepCopy()), 54 : manifest(extension->manifest()->value()->DeepCopy()),
55 location(extension->location()), 55 location(extension->location()),
56 path(extension->path()), 56 path(extension->path()),
57 active_permissions(*extension->permissions_data()->active_permissions()), 57 active_permissions(*extension->permissions_data()->active_permissions()),
58 withheld_permissions( 58 withheld_permissions(
59 *extension->permissions_data()->withheld_permissions()), 59 *extension->permissions_data()->withheld_permissions()),
60 id(extension->id()), 60 id(extension->id()),
61 creation_flags(extension->creation_flags()) { 61 creation_flags(extension->creation_flags()) {
62 if (include_tab_permissions) { 62 if (include_tab_permissions) {
63 const extensions::PermissionsData::TabPermissionsMap& tab_permissions = 63 extensions::PermissionsData::TabPermissionsMap tab_permissions =
64 extension->permissions_data()->tab_specific_permissions(); 64 extension->permissions_data()->CopyTabSpecificPermissionsMap();
65 for (const auto& pair : tab_permissions) { 65 for (const auto& pair : tab_permissions) {
66 tab_specific_permissions[pair.first] = 66 tab_specific_permissions[pair.first] =
67 ExtensionMsg_PermissionSetStruct(*pair.second); 67 ExtensionMsg_PermissionSetStruct(*pair.second);
68 } 68 }
69 } 69 }
70 } 70 }
71 71
72 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( 72 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension(
73 std::string* error) const { 73 std::string* error) const {
74 scoped_refptr<Extension> extension = 74 scoped_refptr<Extension> extension =
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 ReadParam(m, iter, &p->active_permissions) && 318 ReadParam(m, iter, &p->active_permissions) &&
319 ReadParam(m, iter, &p->withheld_permissions); 319 ReadParam(m, iter, &p->withheld_permissions);
320 } 320 }
321 321
322 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, 322 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p,
323 std::string* l) { 323 std::string* l) {
324 l->append(p.id); 324 l->append(p.id);
325 } 325 }
326 326
327 } // namespace IPC 327 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | extensions/common/permissions/permissions_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698