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

Unified Diff: media/gpu/jpeg_decode_accelerator_unittest.cc

Issue 2893953002: Revert of Remove ScopedVector from all other codes in media/ (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/webm/webm_cluster_parser_unittest.cc ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/jpeg_decode_accelerator_unittest.cc
diff --git a/media/gpu/jpeg_decode_accelerator_unittest.cc b/media/gpu/jpeg_decode_accelerator_unittest.cc
index 4f134950e4799b4d7aae523b0b2bd8cdddc54261..4262eb684efd641f142edc9906c3a6adf6e815df 100644
--- a/media/gpu/jpeg_decode_accelerator_unittest.cc
+++ b/media/gpu/jpeg_decode_accelerator_unittest.cc
@@ -18,7 +18,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/ptr_util.h"
+#include "base/memory/scoped_vector.h"
#include "base/path_service.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -324,7 +324,7 @@
// Parsed data of failure image.
std::unique_ptr<TestImageFile> image_data_invalid_;
// Parsed data from command line.
- std::vector<std::unique_ptr<TestImageFile>> image_data_user_;
+ ScopedVector<TestImageFile> image_data_user_;
private:
const base::FilePath::CharType* user_jpeg_filenames_;
@@ -376,7 +376,7 @@
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
for (const auto& filename : filenames) {
base::FilePath input_file = GetTestDataFilePath(filename);
- auto image_data = base::MakeUnique<TestImageFile>(filename);
+ TestImageFile* image_data = new TestImageFile(filename);
ASSERT_NO_FATAL_FAILURE(ReadTestJpegImage(input_file, image_data));
image_data_user_.push_back(image_data);
}
@@ -443,16 +443,15 @@
base::Thread decoder_thread("DecoderThread");
ASSERT_TRUE(decoder_thread.Start());
- std::vector<std::unique_ptr<ClientStateNotification<ClientState>>> notes;
- std::vector<std::unique_ptr<JpegClient>> clients;
+ ScopedVector<ClientStateNotification<ClientState>> notes;
+ ScopedVector<JpegClient> clients;
for (size_t i = 0; i < num_concurrent_decoders; i++) {
- notes.push_back(base::MakeUnique<ClientStateNotification<ClientState>>());
- clients.push_back(
- base::MakeUnique<JpegClient>(test_image_files_, notes.back()));
+ notes.push_back(new ClientStateNotification<ClientState>());
+ clients.push_back(new JpegClient(test_image_files_, notes.back()));
decoder_thread.task_runner()->PostTask(
FROM_HERE, base::Bind(&JpegClient::CreateJpegDecoder,
- base::Unretained(clients.back().get())));
+ base::Unretained(clients.back())));
ASSERT_EQ(notes[i]->Wait(), CS_INITIALIZED);
}
@@ -460,7 +459,7 @@
for (size_t i = 0; i < num_concurrent_decoders; i++) {
decoder_thread.task_runner()->PostTask(
FROM_HERE, base::Bind(&JpegClient::StartDecode,
- base::Unretained(clients[i].get(), index));
+ base::Unretained(clients[i]), index));
}
if (index < expected_status_.size()) {
for (size_t i = 0; i < num_concurrent_decoders; i++) {
@@ -472,7 +471,7 @@
for (size_t i = 0; i < num_concurrent_decoders; i++) {
decoder_thread.task_runner()->PostTask(
FROM_HERE, base::Bind(&JpegClient::DestroyJpegDecoder,
- base::Unretained(clients[i].get())));
+ base::Unretained(clients[i])));
}
decoder_thread.Stop();
}
« no previous file with comments | « media/formats/webm/webm_cluster_parser_unittest.cc ('k') | media/gpu/video_encode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698