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

Side by Side Diff: chrome/browser/extensions/api/permissions/permissions_api_helpers.cc

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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
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/browser/extensions/api/permissions/permissions_api_helpers.h" 5 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 } 54 }
55 55
56 // TODO(rpaquay): We currently don't expose manifest permissions 56 // TODO(rpaquay): We currently don't expose manifest permissions
57 // to apps/extensions via the permissions API. 57 // to apps/extensions via the permissions API.
58 58
59 permissions->origins.reset(new std::vector<std::string>()); 59 permissions->origins.reset(new std::vector<std::string>());
60 for (const URLPattern& pattern : set.explicit_hosts()) 60 for (const URLPattern& pattern : set.explicit_hosts())
61 permissions->origins->push_back(pattern.GetAsString()); 61 permissions->origins->push_back(pattern.GetAsString());
62 62
63 return permissions.Pass(); 63 return permissions;
64 } 64 }
65 65
66 scoped_ptr<const PermissionSet> UnpackPermissionSet( 66 scoped_ptr<const PermissionSet> UnpackPermissionSet(
67 const Permissions& permissions, 67 const Permissions& permissions,
68 bool allow_file_access, 68 bool allow_file_access,
69 std::string* error) { 69 std::string* error) {
70 DCHECK(error); 70 DCHECK(error);
71 APIPermissionSet apis; 71 APIPermissionSet apis;
72 std::vector<std::string>* permissions_list = permissions.permissions.get(); 72 std::vector<std::string>* permissions_list = permissions.permissions.get();
73 if (permissions_list) { 73 if (permissions_list) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 origins.AddPattern(origin); 144 origins.AddPattern(origin);
145 } 145 }
146 } 146 }
147 147
148 return make_scoped_ptr( 148 return make_scoped_ptr(
149 new PermissionSet(apis, manifest_permissions, origins, URLPatternSet())); 149 new PermissionSet(apis, manifest_permissions, origins, URLPatternSet()));
150 } 150 }
151 151
152 } // namespace permissions_api_helpers 152 } // namespace permissions_api_helpers
153 } // namespace extensions 153 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698