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

Side by Side Diff: extensions/common/api/sockets/sockets_manifest_handler.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 4
5 #include "extensions/common/api/sockets/sockets_manifest_handler.h" 5 #include "extensions/common/api/sockets/sockets_manifest_handler.h"
6 6
7 #include "extensions/common/api/sockets/sockets_manifest_data.h" 7 #include "extensions/common/api/sockets/sockets_manifest_data.h"
8 #include "extensions/common/api/sockets/sockets_manifest_permission.h" 8 #include "extensions/common/api/sockets/sockets_manifest_permission.h"
9 #include "extensions/common/extension.h" 9 #include "extensions/common/extension.h"
10 #include "extensions/common/manifest_constants.h" 10 #include "extensions/common/manifest_constants.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 SocketsManifestHandler::SocketsManifestHandler() {} 14 SocketsManifestHandler::SocketsManifestHandler() {}
15 15
16 SocketsManifestHandler::~SocketsManifestHandler() {} 16 SocketsManifestHandler::~SocketsManifestHandler() {}
17 17
18 bool SocketsManifestHandler::Parse(Extension* extension, 18 bool SocketsManifestHandler::Parse(Extension* extension,
19 base::string16* error) { 19 base::string16* error) {
20 const base::Value* sockets = NULL; 20 const base::Value* sockets = nullptr;
21 CHECK(extension->manifest()->Get(manifest_keys::kSockets, &sockets)); 21 CHECK(extension->manifest()->Get(manifest_keys::kSockets, &sockets));
22 scoped_ptr<SocketsManifestData> data = 22 scoped_ptr<SocketsManifestData> data =
23 SocketsManifestData::FromValue(*sockets, error); 23 SocketsManifestData::FromValue(*sockets, error);
24 if (!data) 24 if (!data)
25 return false; 25 return false;
26 26
27 extension->SetManifestData(manifest_keys::kSockets, data.release()); 27 extension->SetManifestData(manifest_keys::kSockets, data.release());
28 return true; 28 return true;
29 } 29 }
30 30
31 ManifestPermission* SocketsManifestHandler::CreatePermission() { 31 ManifestPermission* SocketsManifestHandler::CreatePermission() {
32 return new SocketsManifestPermission(); 32 return new SocketsManifestPermission();
33 } 33 }
34 34
35 ManifestPermission* SocketsManifestHandler::CreateInitialRequiredPermission( 35 ManifestPermission* SocketsManifestHandler::CreateInitialRequiredPermission(
36 const Extension* extension) { 36 const Extension* extension) {
37 SocketsManifestData* data = SocketsManifestData::Get(extension); 37 SocketsManifestData* data = SocketsManifestData::Get(extension);
38 if (data) 38 if (data)
39 return data->permission()->Clone(); 39 return data->permission()->Clone();
40 return NULL; 40 return nullptr;
41 } 41 }
42 42
43 const std::vector<std::string> SocketsManifestHandler::Keys() const { 43 const std::vector<std::string> SocketsManifestHandler::Keys() const {
44 return SingleKey(manifest_keys::kSockets); 44 return SingleKey(manifest_keys::kSockets);
45 } 45 }
46 46
47 } // namespace extensions 47 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698