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

Side by Side Diff: extensions/common/permissions/socket_permission_data.h

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 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
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 #ifndef EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_ 4 #ifndef EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_
5 #define EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_ 5 #define EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "extensions/common/permissions/api_permission.h" 9 #include "extensions/common/permissions/api_permission.h"
10 #include "extensions/common/permissions/socket_permission_entry.h" 10 #include "extensions/common/permissions/socket_permission_entry.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // operators <, == are needed by container std::set and algorithms 48 // operators <, == are needed by container std::set and algorithms
49 // std::set_includes and std::set_differences. 49 // std::set_includes and std::set_differences.
50 bool operator<(const SocketPermissionData& rhs) const; 50 bool operator<(const SocketPermissionData& rhs) const;
51 bool operator==(const SocketPermissionData& rhs) const; 51 bool operator==(const SocketPermissionData& rhs) const;
52 52
53 // Check if |param| (which must be a SocketPermissionData::CheckParam) 53 // Check if |param| (which must be a SocketPermissionData::CheckParam)
54 // matches the spec of |this|. 54 // matches the spec of |this|.
55 bool Check(const APIPermission::CheckParam* param) const; 55 bool Check(const APIPermission::CheckParam* param) const;
56 56
57 // Convert |this| into a base::Value. 57 // Convert |this| into a base::Value.
58 scoped_ptr<base::Value> ToValue() const; 58 std::unique_ptr<base::Value> ToValue() const;
59 59
60 // Populate |this| from a base::Value. 60 // Populate |this| from a base::Value.
61 bool FromValue(const base::Value* value); 61 bool FromValue(const base::Value* value);
62 62
63 // TODO(bryeung): SocketPermissionData should be encoded as a base::Value 63 // TODO(bryeung): SocketPermissionData should be encoded as a base::Value
64 // instead of a string. Until that is done, expose these methods for 64 // instead of a string. Until that is done, expose these methods for
65 // testing. 65 // testing.
66 bool ParseForTest(const std::string& permission) { return Parse(permission); } 66 bool ParseForTest(const std::string& permission) { return Parse(permission); }
67 const std::string& GetAsStringForTest() const { return GetAsString(); } 67 const std::string& GetAsStringForTest() const { return GetAsString(); }
68 68
(...skipping 11 matching lines...) Expand all
80 const std::string& GetAsString() const; 80 const std::string& GetAsString() const;
81 void Reset(); 81 void Reset();
82 82
83 SocketPermissionEntry entry_; 83 SocketPermissionEntry entry_;
84 mutable std::string spec_; 84 mutable std::string spec_;
85 }; 85 };
86 86
87 } // namespace extensions 87 } // namespace extensions
88 88
89 #endif // EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_ 89 #endif // EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_DATA_H_
OLDNEW
« no previous file with comments | « extensions/common/permissions/socket_permission.cc ('k') | extensions/common/permissions/socket_permission_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698