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

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: MakeUnique 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>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/json/json_writer.h" 14 #include "base/json/json_writer.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/memory/ptr_util.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "chrome/browser/browser_process.h" 19 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/download/download_prefs.h" 20 #include "chrome/browser/download/download_prefs.h"
20 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" 21 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
21 #include "chrome/browser/extensions/api/log_private/filter_handler.h" 22 #include "chrome/browser/extensions/api/log_private/filter_handler.h"
22 #include "chrome/browser/extensions/api/log_private/log_parser.h" 23 #include "chrome/browser/extensions/api/log_private/log_parser.h"
23 #include "chrome/browser/extensions/api/log_private/syslog_parser.h" 24 #include "chrome/browser/extensions/api/log_private/syslog_parser.h"
24 #include "chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h" 25 #include "chrome/browser/feedback/system_logs/scrubbed_system_logs_fetcher.h"
25 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
26 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 530
530 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); 531 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue());
531 extensions::GrantedFileEntry file_entry = 532 extensions::GrantedFileEntry file_entry =
532 extensions::app_file_handler_util::CreateFileEntry( 533 extensions::app_file_handler_util::CreateFileEntry(
533 Profile::FromBrowserContext(browser_context()), 534 Profile::FromBrowserContext(browser_context()),
534 extension(), 535 extension(),
535 render_frame_host()->GetProcess()->GetID(), 536 render_frame_host()->GetProcess()->GetID(),
536 log_path, 537 log_path,
537 false); 538 false);
538 539
539 base::DictionaryValue* entry = new base::DictionaryValue(); 540 auto entry = base::MakeUnique<base::DictionaryValue>();
540 entry->SetString("fileSystemId", file_entry.filesystem_id); 541 entry->SetString("fileSystemId", file_entry.filesystem_id);
541 entry->SetString("baseName", file_entry.registered_name); 542 entry->SetString("baseName", file_entry.registered_name);
542 entry->SetString("id", file_entry.id); 543 entry->SetString("id", file_entry.id);
543 entry->SetBoolean("isDirectory", false); 544 entry->SetBoolean("isDirectory", false);
544 base::ListValue* entry_list = new base::ListValue(); 545 base::ListValue* entry_list = new base::ListValue();
545 entry_list->Append(entry); 546 entry_list->Append(std::move(entry));
546 response->Set("entries", entry_list); 547 response->Set("entries", entry_list);
547 response->SetBoolean("multiple", false); 548 response->SetBoolean("multiple", false);
548 SetResult(std::move(response)); 549 SetResult(std::move(response));
549 SendResponse(succeeded); 550 SendResponse(succeeded);
550 } 551 }
551 552
552 } // namespace extensions 553 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698