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

Side by Side Diff: minidump/minidump_memory_writer.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 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_memory_info_writer_test.cc ('k') | minidump/minidump_memory_writer_test.cc » ('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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #include "minidump/minidump_memory_writer.h" 15 #include "minidump/minidump_memory_writer.h"
16 16
17 #include "base/auto_reset.h" 17 #include "base/auto_reset.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "snapshot/memory_snapshot.h" 19 #include "snapshot/memory_snapshot.h"
20 #include "util/file/file_writer.h" 20 #include "util/file/file_writer.h"
21 #include "util/stdlib/move.h"
21 #include "util/numeric/safe_assignment.h" 22 #include "util/numeric/safe_assignment.h"
22 23
23 namespace crashpad { 24 namespace crashpad {
24 namespace { 25 namespace {
25 26
26 class SnapshotMinidumpMemoryWriter final : public MinidumpMemoryWriter, 27 class SnapshotMinidumpMemoryWriter final : public MinidumpMemoryWriter,
27 public MemorySnapshot::Delegate { 28 public MemorySnapshot::Delegate {
28 public: 29 public:
29 explicit SnapshotMinidumpMemoryWriter(const MemorySnapshot* memory_snapshot) 30 explicit SnapshotMinidumpMemoryWriter(const MemorySnapshot* memory_snapshot)
30 : MinidumpMemoryWriter(), 31 : MinidumpMemoryWriter(),
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 MinidumpMemoryListWriter::~MinidumpMemoryListWriter() { 171 MinidumpMemoryListWriter::~MinidumpMemoryListWriter() {
171 } 172 }
172 173
173 void MinidumpMemoryListWriter::AddFromSnapshot( 174 void MinidumpMemoryListWriter::AddFromSnapshot(
174 const std::vector<const MemorySnapshot*>& memory_snapshots) { 175 const std::vector<const MemorySnapshot*>& memory_snapshots) {
175 DCHECK_EQ(state(), kStateMutable); 176 DCHECK_EQ(state(), kStateMutable);
176 177
177 for (const MemorySnapshot* memory_snapshot : memory_snapshots) { 178 for (const MemorySnapshot* memory_snapshot : memory_snapshots) {
178 scoped_ptr<MinidumpMemoryWriter> memory = 179 scoped_ptr<MinidumpMemoryWriter> memory =
179 MinidumpMemoryWriter::CreateFromSnapshot(memory_snapshot); 180 MinidumpMemoryWriter::CreateFromSnapshot(memory_snapshot);
180 AddMemory(memory.Pass()); 181 AddMemory(crashpad::move(memory));
181 } 182 }
182 } 183 }
183 184
184 void MinidumpMemoryListWriter::AddMemory( 185 void MinidumpMemoryListWriter::AddMemory(
185 scoped_ptr<MinidumpMemoryWriter> memory_writer) { 186 scoped_ptr<MinidumpMemoryWriter> memory_writer) {
186 DCHECK_EQ(state(), kStateMutable); 187 DCHECK_EQ(state(), kStateMutable);
187 188
188 AddExtraMemory(memory_writer.get()); 189 AddExtraMemory(memory_writer.get());
189 children_.push_back(memory_writer.release()); 190 children_.push_back(memory_writer.release());
190 } 191 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 252 }
252 253
253 return file_writer->WriteIoVec(&iovecs); 254 return file_writer->WriteIoVec(&iovecs);
254 } 255 }
255 256
256 MinidumpStreamType MinidumpMemoryListWriter::StreamType() const { 257 MinidumpStreamType MinidumpMemoryListWriter::StreamType() const {
257 return kMinidumpStreamTypeMemoryList; 258 return kMinidumpStreamTypeMemoryList;
258 } 259 }
259 260
260 } // namespace crashpad 261 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_memory_info_writer_test.cc ('k') | minidump/minidump_memory_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698