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

Side by Side Diff: extensions/common/api/declarative/declarative_manifest_handler.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/declarative/declarative_manifest_handler.h" 5 #include "extensions/common/api/declarative/declarative_manifest_handler.h"
6 6
7 #include "extensions/common/api/declarative/declarative_manifest_data.h" 7 #include "extensions/common/api/declarative/declarative_manifest_data.h"
8 #include "extensions/common/extension.h" 8 #include "extensions/common/extension.h"
9 #include "extensions/common/manifest_constants.h" 9 #include "extensions/common/manifest_constants.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 DeclarativeManifestHandler::DeclarativeManifestHandler() { 13 DeclarativeManifestHandler::DeclarativeManifestHandler() {
14 } 14 }
15 15
16 DeclarativeManifestHandler::~DeclarativeManifestHandler() { 16 DeclarativeManifestHandler::~DeclarativeManifestHandler() {
17 } 17 }
18 18
19 bool DeclarativeManifestHandler::Parse(Extension* extension, 19 bool DeclarativeManifestHandler::Parse(Extension* extension,
20 base::string16* error) { 20 base::string16* error) {
21 const base::Value* event_rules = NULL; 21 const base::Value* event_rules = NULL;
22 CHECK(extension->manifest()->Get(manifest_keys::kEventRules, &event_rules)); 22 CHECK(extension->manifest()->Get(manifest_keys::kEventRules, &event_rules));
23 scoped_ptr<DeclarativeManifestData> data = 23 std::unique_ptr<DeclarativeManifestData> data =
24 DeclarativeManifestData::FromValue(*event_rules, error); 24 DeclarativeManifestData::FromValue(*event_rules, error);
25 if (!data) 25 if (!data)
26 return false; 26 return false;
27 27
28 extension->SetManifestData(manifest_keys::kEventRules, data.release()); 28 extension->SetManifestData(manifest_keys::kEventRules, data.release());
29 return true; 29 return true;
30 } 30 }
31 31
32 const std::vector<std::string> DeclarativeManifestHandler::Keys() const { 32 const std::vector<std::string> DeclarativeManifestHandler::Keys() const {
33 return SingleKey(manifest_keys::kEventRules); 33 return SingleKey(manifest_keys::kEventRules);
34 } 34 }
35 35
36 } // namespace extensions 36 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698