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

Side by Side Diff: tools/ipc_fuzzer/message_lib/message_file_writer.cc

Issue 2972773004: Remove ScopedVector from tools/ipc_fuzzer/. (Closed)
Patch Set: rev Created 3 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <limits.h> 5 #include <limits.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 header.version = FileHeader::kCurrentVersion; 98 header.version = FileHeader::kCurrentVersion;
99 header.message_count = messages_->size(); 99 header.message_count = messages_->size();
100 header.name_count = types_.size(); 100 header.name_count = types_.size();
101 if (!WriteBlob(&header, sizeof(FileHeader))) 101 if (!WriteBlob(&header, sizeof(FileHeader)))
102 return false; 102 return false;
103 return true; 103 return true;
104 } 104 }
105 105
106 bool Writer::WriteMessages() { 106 bool Writer::WriteMessages() {
107 for (size_t i = 0; i < messages_->size(); ++i) { 107 for (size_t i = 0; i < messages_->size(); ++i) {
108 IPC::Message* message = (*messages_)[i]; 108 IPC::Message* message = (*messages_)[i].get();
109 if (!WriteBlob(message->data(), message->size())) 109 if (!WriteBlob(message->data(), message->size()))
110 return false; 110 return false;
111 } 111 }
112 return true; 112 return true;
113 } 113 }
114 114
115 bool Writer::WriteNameTable() { 115 bool Writer::WriteNameTable() {
116 size_t string_table_offset = 0; 116 size_t string_table_offset = 0;
117 NameTableEntry entry; 117 NameTableEntry entry;
118 118
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 } // namespace 160 } // namespace
161 161
162 bool MessageFile::Write(const base::FilePath& path, 162 bool MessageFile::Write(const base::FilePath& path,
163 const MessageVector& messages) { 163 const MessageVector& messages) {
164 Writer writer(path); 164 Writer writer(path);
165 return writer.Write(messages); 165 return writer.Write(messages);
166 } 166 }
167 167
168 } // namespace ipc_fuzzer 168 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_file_reader.cc ('k') | tools/ipc_fuzzer/message_replay/replay_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698