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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/file_system_provider/provided_file_system.h" 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 OnAddWatcherRequested::kEventName || 76 OnAddWatcherRequested::kEventName ||
77 event->event_name == extensions::api::file_system_provider:: 77 event->event_name == extensions::api::file_system_provider::
78 OnRemoveWatcherRequested::kEventName || 78 OnRemoveWatcherRequested::kEventName ||
79 event->event_name == extensions::api::file_system_provider:: 79 event->event_name == extensions::api::file_system_provider::
80 OnOpenFileRequested::kEventName || 80 OnOpenFileRequested::kEventName ||
81 event->event_name == extensions::api::file_system_provider:: 81 event->event_name == extensions::api::file_system_provider::
82 OnCloseFileRequested::kEventName); 82 OnCloseFileRequested::kEventName);
83 83
84 if (reply_result_ == base::File::FILE_OK) { 84 if (reply_result_ == base::File::FILE_OK) {
85 base::ListValue value_as_list; 85 base::ListValue value_as_list;
86 value_as_list.Set(0, new base::Value(kFileSystemId)); 86 value_as_list.Set(0, base::MakeUnique<base::Value>(kFileSystemId));
87 value_as_list.Set(1, new base::Value(request_id)); 87 value_as_list.Set(1, base::MakeUnique<base::Value>(request_id));
88 value_as_list.Set(2, new base::Value(0) /* execution_time */); 88 value_as_list.Set(2,
89 base::MakeUnique<base::Value>(0) /* execution_time */);
89 90
90 using extensions::api::file_system_provider_internal:: 91 using extensions::api::file_system_provider_internal::
91 OperationRequestedSuccess::Params; 92 OperationRequestedSuccess::Params;
92 std::unique_ptr<Params> params(Params::Create(value_as_list)); 93 std::unique_ptr<Params> params(Params::Create(value_as_list));
93 ASSERT_TRUE(params.get()); 94 ASSERT_TRUE(params.get());
94 file_system_->GetRequestManager()->FulfillRequest( 95 file_system_->GetRequestManager()->FulfillRequest(
95 request_id, 96 request_id,
96 RequestValue::CreateForOperationSuccess(std::move(params)), 97 RequestValue::CreateForOperationSuccess(std::move(params)),
97 false /* has_more */); 98 false /* has_more */);
98 } else { 99 } else {
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 917
917 ASSERT_EQ(1u, close_log.size()); 918 ASSERT_EQ(1u, close_log.size());
918 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, close_log[0]); 919 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, close_log[0]);
919 EXPECT_EQ(0u, opened_files.size()); 920 EXPECT_EQ(0u, opened_files.size());
920 921
921 provided_file_system_->RemoveObserver(&observer); 922 provided_file_system_->RemoveObserver(&observer);
922 } 923 }
923 924
924 } // namespace file_system_provider 925 } // namespace file_system_provider
925 } // namespace chromeos 926 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698