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

Side by Side Diff: chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/sync_file_system/extension_sync_event_ob server.h" 5 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api_he lpers.h" 10 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api_he lpers.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 sync_file_system::SyncFileType file_type, 91 sync_file_system::SyncFileType file_type,
92 sync_file_system::SyncFileStatus status, 92 sync_file_system::SyncFileStatus status,
93 sync_file_system::SyncAction action, 93 sync_file_system::SyncAction action,
94 sync_file_system::SyncDirection direction) { 94 sync_file_system::SyncDirection direction) {
95 std::unique_ptr<base::ListValue> params(new base::ListValue()); 95 std::unique_ptr<base::ListValue> params(new base::ListValue());
96 96
97 std::unique_ptr<base::DictionaryValue> entry( 97 std::unique_ptr<base::DictionaryValue> entry(
98 CreateDictionaryValueForFileSystemEntry(url, file_type)); 98 CreateDictionaryValueForFileSystemEntry(url, file_type));
99 if (!entry) 99 if (!entry)
100 return; 100 return;
101 params->Append(entry.release()); 101 params->Append(std::move(entry));
102 102
103 // Status, SyncAction and any optional notes to go here. 103 // Status, SyncAction and any optional notes to go here.
104 api::sync_file_system::FileStatus status_enum = 104 api::sync_file_system::FileStatus status_enum =
105 SyncFileStatusToExtensionEnum(status); 105 SyncFileStatusToExtensionEnum(status);
106 api::sync_file_system::SyncAction action_enum = 106 api::sync_file_system::SyncAction action_enum =
107 SyncActionToExtensionEnum(action); 107 SyncActionToExtensionEnum(action);
108 api::sync_file_system::SyncDirection direction_enum = 108 api::sync_file_system::SyncDirection direction_enum =
109 SyncDirectionToExtensionEnum(direction); 109 SyncDirectionToExtensionEnum(direction);
110 params->AppendString(api::sync_file_system::ToString(status_enum)); 110 params->AppendString(api::sync_file_system::ToString(status_enum));
111 params->AppendString(api::sync_file_system::ToString(action_enum)); 111 params->AppendString(api::sync_file_system::ToString(action_enum));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 template <> 148 template <>
149 void BrowserContextKeyedAPIFactory< 149 void BrowserContextKeyedAPIFactory<
150 ExtensionSyncEventObserver>::DeclareFactoryDependencies() { 150 ExtensionSyncEventObserver>::DeclareFactoryDependencies() {
151 DependsOn(sync_file_system::SyncFileSystemServiceFactory::GetInstance()); 151 DependsOn(sync_file_system::SyncFileSystemServiceFactory::GetInstance());
152 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 152 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
153 } 153 }
154 154
155 } // namespace extensions 155 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698