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

Side by Side Diff: extensions/common/permissions/manifest_permission.cc

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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/permissions/manifest_permission.h" 5 #include "extensions/common/permissions/manifest_permission.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "extensions/common/manifest_handler.h" 8 #include "extensions/common/manifest_handler.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 ManifestPermission::ManifestPermission() {} 14 ManifestPermission::ManifestPermission() {}
15 15
16 ManifestPermission::~ManifestPermission() { } 16 ManifestPermission::~ManifestPermission() { }
17 17
18 ManifestPermission* ManifestPermission::Clone() const { 18 ManifestPermission* ManifestPermission::Clone() const {
19 return Union(this); 19 return Union(this);
20 } 20 }
21 21
22 bool ManifestPermission::Contains(const ManifestPermission* rhs) const { 22 bool ManifestPermission::Contains(const ManifestPermission* rhs) const {
23 return scoped_ptr<ManifestPermission>(Intersect(rhs))->Equal(rhs); 23 return std::unique_ptr<ManifestPermission>(Intersect(rhs))->Equal(rhs);
24 } 24 }
25 25
26 bool ManifestPermission::Equal(const ManifestPermission* rhs) const { 26 bool ManifestPermission::Equal(const ManifestPermission* rhs) const {
27 return ToValue()->Equals(rhs->ToValue().get()); 27 return ToValue()->Equals(rhs->ToValue().get());
28 } 28 }
29 29
30 void ManifestPermission::Write(base::Pickle* m) const { 30 void ManifestPermission::Write(base::Pickle* m) const {
31 base::ListValue singleton; 31 base::ListValue singleton;
32 base::Value* value = ToValue().release(); 32 base::Value* value = ToValue().release();
33 singleton.Append(value); 33 singleton.Append(value);
(...skipping 12 matching lines...) Expand all
46 return false; 46 return false;
47 return FromValue(value); 47 return FromValue(value);
48 } 48 }
49 49
50 void ManifestPermission::Log(std::string* log) const { 50 void ManifestPermission::Log(std::string* log) const {
51 base::JSONWriter::WriteWithOptions( 51 base::JSONWriter::WriteWithOptions(
52 *ToValue(), base::JSONWriter::OPTIONS_PRETTY_PRINT, log); 52 *ToValue(), base::JSONWriter::OPTIONS_PRETTY_PRINT, log);
53 } 53 }
54 54
55 } // namespace extensions 55 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/permissions/manifest_permission.h ('k') | extensions/common/permissions/manifest_permission_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698