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

Side by Side Diff: chrome/browser/extensions/api/storage/setting_sync_data.cc

Issue 1141963002: Remove a bunch of DeepCopy() calls in the chrome.storage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 7 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/storage/setting_sync_data.h" 5 #include "chrome/browser/extensions/api/storage/setting_sync_data.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "sync/api/sync_data.h" 9 #include "sync/api/sync_data.h"
10 #include "sync/protocol/app_setting_specifics.pb.h" 10 #include "sync/protocol/app_setting_specifics.pb.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 const std::string& SettingSyncData::extension_id() const { 76 const std::string& SettingSyncData::extension_id() const {
77 return internal_->extension_id_; 77 return internal_->extension_id_;
78 } 78 }
79 79
80 const std::string& SettingSyncData::key() const { 80 const std::string& SettingSyncData::key() const {
81 return internal_->key_; 81 return internal_->key_;
82 } 82 }
83 83
84 const base::Value& SettingSyncData::value() const { 84 const base::Value& SettingSyncData::value() const {
85 DCHECK(internal_.get()) << "value has been released";
Devlin 2015/05/15 21:59:07 Should these be DCHECKing internal_->value_?
not at google - send to devlin 2015/05/15 23:28:30 yes
85 return *internal_->value_; 86 return *internal_->value_;
86 } 87 }
87 88
89 scoped_ptr<base::Value> SettingSyncData::PassValue() {
90 DCHECK(internal_.get()) << "value has been released";
91 return internal_->value_.Pass();
92 }
93
88 SettingSyncData::Internal::Internal( 94 SettingSyncData::Internal::Internal(
89 syncer::SyncChange::SyncChangeType change_type, 95 syncer::SyncChange::SyncChangeType change_type,
90 const std::string& extension_id, 96 const std::string& extension_id,
91 const std::string& key, 97 const std::string& key,
92 scoped_ptr<base::Value> value) 98 scoped_ptr<base::Value> value)
93 : change_type_(change_type), 99 : change_type_(change_type),
94 extension_id_(extension_id), 100 extension_id_(extension_id),
95 key_(key), 101 key_(key),
96 value_(value.Pass()) { 102 value_(value.Pass()) {
97 DCHECK(value_.get()); 103 DCHECK(value_.get()) << "value cannot be null";
98 } 104 }
99 105
100 SettingSyncData::Internal::~Internal() {} 106 SettingSyncData::Internal::~Internal() {}
101 107
102 } // namespace extensions 108 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698