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

Side by Side Diff: snapshot/test/test_process_snapshot.h

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 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
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/test/test_thread_snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 14 matching lines...) Expand all
25 25
26 #include "base/basictypes.h" 26 #include "base/basictypes.h"
27 #include "base/memory/scoped_ptr.h" 27 #include "base/memory/scoped_ptr.h"
28 #include "snapshot/exception_snapshot.h" 28 #include "snapshot/exception_snapshot.h"
29 #include "snapshot/memory_map_region_snapshot.h" 29 #include "snapshot/memory_map_region_snapshot.h"
30 #include "snapshot/memory_snapshot.h" 30 #include "snapshot/memory_snapshot.h"
31 #include "snapshot/module_snapshot.h" 31 #include "snapshot/module_snapshot.h"
32 #include "snapshot/process_snapshot.h" 32 #include "snapshot/process_snapshot.h"
33 #include "snapshot/system_snapshot.h" 33 #include "snapshot/system_snapshot.h"
34 #include "snapshot/thread_snapshot.h" 34 #include "snapshot/thread_snapshot.h"
35 #include "util/stdlib/move.h"
35 #include "util/misc/uuid.h" 36 #include "util/misc/uuid.h"
36 #include "util/stdlib/pointer_container.h" 37 #include "util/stdlib/pointer_container.h"
37 38
38 namespace crashpad { 39 namespace crashpad {
39 namespace test { 40 namespace test {
40 41
41 //! \brief A test ProcessSnapshot that can carry arbitrary data for testing 42 //! \brief A test ProcessSnapshot that can carry arbitrary data for testing
42 //! purposes. 43 //! purposes.
43 class TestProcessSnapshot final : public ProcessSnapshot { 44 class TestProcessSnapshot final : public ProcessSnapshot {
44 public: 45 public:
(...skipping 19 matching lines...) Expand all
64 void SetClientID(const UUID& client_id) { client_id_ = client_id; } 65 void SetClientID(const UUID& client_id) { client_id_ = client_id; }
65 void SetAnnotationsSimpleMap( 66 void SetAnnotationsSimpleMap(
66 const std::map<std::string, std::string>& annotations_simple_map) { 67 const std::map<std::string, std::string>& annotations_simple_map) {
67 annotations_simple_map_ = annotations_simple_map; 68 annotations_simple_map_ = annotations_simple_map;
68 } 69 }
69 70
70 //! \brief Sets the system snapshot to be returned by System(). 71 //! \brief Sets the system snapshot to be returned by System().
71 //! 72 //!
72 //! \param[in] system The system snapshot that System() will return. The 73 //! \param[in] system The system snapshot that System() will return. The
73 //! TestProcessSnapshot object takes ownership of \a system. 74 //! TestProcessSnapshot object takes ownership of \a system.
74 void SetSystem(scoped_ptr<SystemSnapshot> system) { system_ = system.Pass(); } 75 void SetSystem(scoped_ptr<SystemSnapshot> system) {
76 system_ = crashpad::move(system);
77 }
75 78
76 //! \brief Adds a thread snapshot to be returned by Threads(). 79 //! \brief Adds a thread snapshot to be returned by Threads().
77 //! 80 //!
78 //! \param[in] thread The thread snapshot that will be included in Threads(). 81 //! \param[in] thread The thread snapshot that will be included in Threads().
79 //! The TestProcessSnapshot object takes ownership of \a thread. 82 //! The TestProcessSnapshot object takes ownership of \a thread.
80 void AddThread(scoped_ptr<ThreadSnapshot> thread) { 83 void AddThread(scoped_ptr<ThreadSnapshot> thread) {
81 threads_.push_back(thread.release()); 84 threads_.push_back(thread.release());
82 } 85 }
83 86
84 //! \brief Adds a module snapshot to be returned by Modules(). 87 //! \brief Adds a module snapshot to be returned by Modules().
85 //! 88 //!
86 //! \param[in] module The module snapshot that will be included in Modules(). 89 //! \param[in] module The module snapshot that will be included in Modules().
87 //! The TestProcessSnapshot object takes ownership of \a module. 90 //! The TestProcessSnapshot object takes ownership of \a module.
88 void AddModule(scoped_ptr<ModuleSnapshot> module) { 91 void AddModule(scoped_ptr<ModuleSnapshot> module) {
89 modules_.push_back(module.release()); 92 modules_.push_back(module.release());
90 } 93 }
91 94
92 //! \brief Sets the exception snapshot to be returned by Exception(). 95 //! \brief Sets the exception snapshot to be returned by Exception().
93 //! 96 //!
94 //! \param[in] exception The exception snapshot that Exception() will return. 97 //! \param[in] exception The exception snapshot that Exception() will return.
95 //! The TestProcessSnapshot object takes ownership of \a exception. 98 //! The TestProcessSnapshot object takes ownership of \a exception.
96 void SetException(scoped_ptr<ExceptionSnapshot> exception) { 99 void SetException(scoped_ptr<ExceptionSnapshot> exception) {
97 exception_ = exception.Pass(); 100 exception_ = crashpad::move(exception);
98 } 101 }
99 102
100 //! \brief Adds a memory map region snapshot to be returned by MemoryMap(). 103 //! \brief Adds a memory map region snapshot to be returned by MemoryMap().
101 //! 104 //!
102 //! \param[in] region The memory map region snapshot that will be included in 105 //! \param[in] region The memory map region snapshot that will be included in
103 //! MemoryMap(). The TestProcessSnapshot object takes ownership of \a 106 //! MemoryMap(). The TestProcessSnapshot object takes ownership of \a
104 //! region. 107 //! region.
105 void AddMemoryMapRegion(scoped_ptr<MemoryMapRegionSnapshot> region) { 108 void AddMemoryMapRegion(scoped_ptr<MemoryMapRegionSnapshot> region) {
106 memory_map_.push_back(region.release()); 109 memory_map_.push_back(region.release());
107 } 110 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 std::vector<HandleSnapshot> handles_; 162 std::vector<HandleSnapshot> handles_;
160 PointerVector<MemorySnapshot> extra_memory_; 163 PointerVector<MemorySnapshot> extra_memory_;
161 164
162 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); 165 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot);
163 }; 166 };
164 167
165 } // namespace test 168 } // namespace test
166 } // namespace crashpad 169 } // namespace crashpad
167 170
168 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ 171 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/test/test_thread_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698