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

Unified Diff: minidump/minidump_thread_writer_test.cc

Issue 1483073004: Replace use of .Pass() with crashpad::move(). (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: pass: . Created 5 years, 1 month 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 | « minidump/minidump_thread_writer.cc ('k') | snapshot/test/test_process_snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_thread_writer_test.cc
diff --git a/minidump/minidump_thread_writer_test.cc b/minidump/minidump_thread_writer_test.cc
index 9571f7c2b959c0bdcf2bdde804c8f91adcaa8762..4e3fd5c94adbc7afc5fdb282da26b0313a2f2fa5 100644
--- a/minidump/minidump_thread_writer_test.cc
+++ b/minidump/minidump_thread_writer_test.cc
@@ -37,6 +37,7 @@
#include "snapshot/test/test_thread_snapshot.h"
#include "test/gtest_death_check.h"
#include "util/file/string_file.h"
+#include "util/stdlib/move.h"
namespace crashpad {
namespace test {
@@ -83,7 +84,7 @@ TEST(MinidumpThreadWriter, EmptyThreadList) {
MinidumpFileWriter minidump_file_writer;
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
- minidump_file_writer.AddStream(thread_list_writer.Pass());
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
StringFile string_file;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
@@ -160,10 +161,10 @@ TEST(MinidumpThreadWriter, OneThread_x86_NoStack) {
auto context_x86_writer = make_scoped_ptr(new MinidumpContextX86Writer());
InitializeMinidumpContextX86(context_x86_writer->context(), kSeed);
- thread_writer->SetContext(context_x86_writer.Pass());
+ thread_writer->SetContext(crashpad::move(context_x86_writer));
- thread_list_writer->AddThread(thread_writer.Pass());
- minidump_file_writer.AddStream(thread_list_writer.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer));
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
StringFile string_file;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
@@ -222,15 +223,15 @@ TEST(MinidumpThreadWriter, OneThread_AMD64_Stack) {
auto memory_writer = make_scoped_ptr(
new TestMinidumpMemoryWriter(kMemoryBase, kMemorySize, kMemoryValue));
- thread_writer->SetStack(memory_writer.Pass());
+ thread_writer->SetStack(crashpad::move(memory_writer));
MSVC_SUPPRESS_WARNING(4316); // Object allocated on heap may not be aligned.
auto context_amd64_writer = make_scoped_ptr(new MinidumpContextAMD64Writer());
InitializeMinidumpContextAMD64(context_amd64_writer->context(), kSeed);
- thread_writer->SetContext(context_amd64_writer.Pass());
+ thread_writer->SetContext(crashpad::move(context_amd64_writer));
- thread_list_writer->AddThread(thread_writer.Pass());
- minidump_file_writer.AddStream(thread_list_writer.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer));
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
StringFile string_file;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
@@ -300,13 +301,13 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
auto memory_writer_0 = make_scoped_ptr(
new TestMinidumpMemoryWriter(kMemoryBase0, kMemorySize0, kMemoryValue0));
- thread_writer_0->SetStack(memory_writer_0.Pass());
+ thread_writer_0->SetStack(crashpad::move(memory_writer_0));
auto context_x86_writer_0 = make_scoped_ptr(new MinidumpContextX86Writer());
InitializeMinidumpContextX86(context_x86_writer_0->context(), kSeed0);
- thread_writer_0->SetContext(context_x86_writer_0.Pass());
+ thread_writer_0->SetContext(crashpad::move(context_x86_writer_0));
- thread_list_writer->AddThread(thread_writer_0.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer_0));
const uint32_t kThreadID1 = 2222222;
const uint32_t kSuspendCount1 = 222222;
@@ -327,13 +328,13 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
auto memory_writer_1 = make_scoped_ptr(
new TestMinidumpMemoryWriter(kMemoryBase1, kMemorySize1, kMemoryValue1));
- thread_writer_1->SetStack(memory_writer_1.Pass());
+ thread_writer_1->SetStack(crashpad::move(memory_writer_1));
auto context_x86_writer_1 = make_scoped_ptr(new MinidumpContextX86Writer());
InitializeMinidumpContextX86(context_x86_writer_1->context(), kSeed1);
- thread_writer_1->SetContext(context_x86_writer_1.Pass());
+ thread_writer_1->SetContext(crashpad::move(context_x86_writer_1));
- thread_list_writer->AddThread(thread_writer_1.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer_1));
const uint32_t kThreadID2 = 3333333;
const uint32_t kSuspendCount2 = 333333;
@@ -354,16 +355,16 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
auto memory_writer_2 = make_scoped_ptr(
new TestMinidumpMemoryWriter(kMemoryBase2, kMemorySize2, kMemoryValue2));
- thread_writer_2->SetStack(memory_writer_2.Pass());
+ thread_writer_2->SetStack(crashpad::move(memory_writer_2));
auto context_x86_writer_2 = make_scoped_ptr(new MinidumpContextX86Writer());
InitializeMinidumpContextX86(context_x86_writer_2->context(), kSeed2);
- thread_writer_2->SetContext(context_x86_writer_2.Pass());
+ thread_writer_2->SetContext(crashpad::move(context_x86_writer_2));
- thread_list_writer->AddThread(thread_writer_2.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer_2));
- minidump_file_writer.AddStream(thread_list_writer.Pass());
- minidump_file_writer.AddStream(memory_list_writer.Pass());
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
+ minidump_file_writer.AddStream(crashpad::move(memory_list_writer));
StringFile string_file;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
@@ -600,7 +601,7 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
expect_threads[index].Stack.StartOfMemoryRange);
memory_snapshot->SetSize(expect_threads[index].Stack.Memory.DataSize);
memory_snapshot->SetValue(memory_values[index]);
- thread_snapshot->SetStack(memory_snapshot.Pass());
+ thread_snapshot->SetStack(crashpad::move(memory_snapshot));
}
Traits::InitializeCPUContext(thread_snapshot->MutableContext(),
@@ -610,7 +611,7 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
teb_snapshot->SetAddress(expect_threads[index].Teb);
teb_snapshot->SetSize(kTebSize);
teb_snapshot->SetValue(static_cast<char>('t' + index));
- thread_snapshot->AddExtraMemory(teb_snapshot.Pass());
+ thread_snapshot->AddExtraMemory(crashpad::move(teb_snapshot));
thread_snapshots.push_back(thread_snapshot);
}
@@ -622,8 +623,8 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
thread_list_writer->InitializeFromSnapshot(thread_snapshots, &thread_id_map);
MinidumpFileWriter minidump_file_writer;
- minidump_file_writer.AddStream(thread_list_writer.Pass());
- minidump_file_writer.AddStream(memory_list_writer.Pass());
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
+ minidump_file_writer.AddStream(crashpad::move(memory_list_writer));
StringFile string_file;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
@@ -700,8 +701,8 @@ TEST(MinidumpThreadWriterDeathTest, NoContext) {
auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter());
- thread_list_writer->AddThread(thread_writer.Pass());
- minidump_file_writer.AddStream(thread_list_writer.Pass());
+ thread_list_writer->AddThread(crashpad::move(thread_writer));
+ minidump_file_writer.AddStream(crashpad::move(thread_list_writer));
StringFile string_file;
ASSERT_DEATH_CHECK(minidump_file_writer.WriteEverything(&string_file),
« no previous file with comments | « minidump/minidump_thread_writer.cc ('k') | snapshot/test/test_process_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698