OLD | NEW |
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 Loading... |
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 |
OLD | NEW |