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

Side by Side Diff: courgette/third_party/bsdiff_apply.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /*- 1 /*-
2 * Copyright 2003,2004 Colin Percival 2 * Copyright 2003,2004 Colin Percival
3 * All rights reserved 3 * All rights reserved
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted providing that the following conditions 6 * modification, are permitted providing that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // Set up the new stream and apply the patch. 193 // Set up the new stream and apply the patch.
194 SinkStream new_sink_stream; 194 SinkStream new_sink_stream;
195 BSDiffStatus status = ApplyBinaryPatch(&old_file_stream, 195 BSDiffStatus status = ApplyBinaryPatch(&old_file_stream,
196 &patch_file_stream, 196 &patch_file_stream,
197 &new_sink_stream); 197 &new_sink_stream);
198 if (status != OK) { 198 if (status != OK) {
199 return status; 199 return status;
200 } 200 }
201 201
202 // Write the stream to disk. 202 // Write the stream to disk.
203 int written = file_util::WriteFile( 203 int written = base::WriteFile(
204 new_file_path, 204 new_file_path,
205 reinterpret_cast<const char*>(new_sink_stream.Buffer()), 205 reinterpret_cast<const char*>(new_sink_stream.Buffer()),
206 static_cast<int>(new_sink_stream.Length())); 206 static_cast<int>(new_sink_stream.Length()));
207 if (written != static_cast<int>(new_sink_stream.Length())) 207 if (written != static_cast<int>(new_sink_stream.Length()))
208 return WRITE_ERROR; 208 return WRITE_ERROR;
209 return OK; 209 return OK;
210 } 210 }
211 211
212 } // namespace 212 } // namespace
OLDNEW
« no previous file with comments | « courgette/ensemble_apply.cc ('k') | extensions/browser/value_store/leveldb_value_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698