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

Side by Side Diff: chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: headers Created 4 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 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 "chrome/browser/extensions/api/log_private/log_private_api.h" 5 #include "chrome/browser/extensions/api/log_private/log_private_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 529
530 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); 530 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue());
531 extensions::GrantedFileEntry file_entry = 531 extensions::GrantedFileEntry file_entry =
532 extensions::app_file_handler_util::CreateFileEntry( 532 extensions::app_file_handler_util::CreateFileEntry(
533 Profile::FromBrowserContext(browser_context()), 533 Profile::FromBrowserContext(browser_context()),
534 extension(), 534 extension(),
535 render_frame_host()->GetProcess()->GetID(), 535 render_frame_host()->GetProcess()->GetID(),
536 log_path, 536 log_path,
537 false); 537 false);
538 538
539 base::DictionaryValue* entry = new base::DictionaryValue(); 539 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
540 entry->SetString("fileSystemId", file_entry.filesystem_id); 540 entry->SetString("fileSystemId", file_entry.filesystem_id);
541 entry->SetString("baseName", file_entry.registered_name); 541 entry->SetString("baseName", file_entry.registered_name);
542 entry->SetString("id", file_entry.id); 542 entry->SetString("id", file_entry.id);
543 entry->SetBoolean("isDirectory", false); 543 entry->SetBoolean("isDirectory", false);
544 base::ListValue* entry_list = new base::ListValue(); 544 base::ListValue* entry_list = new base::ListValue();
545 entry_list->Append(entry); 545 entry_list->Append(std::move(entry));
546 response->Set("entries", entry_list); 546 response->Set("entries", entry_list);
547 response->SetBoolean("multiple", false); 547 response->SetBoolean("multiple", false);
548 SetResult(std::move(response)); 548 SetResult(std::move(response));
549 SendResponse(succeeded); 549 SendResponse(succeeded);
550 } 550 }
551 551
552 } // namespace extensions 552 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698