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

Unified Diff: trunk/src/courgette/third_party/bsdiff_apply.cc

Issue 17551004: Revert 207805 "Differential updates for components. We are addin..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/courgette/third_party/bsdiff.h ('k') | trunk/src/extensions/common/crx_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/courgette/third_party/bsdiff_apply.cc
===================================================================
--- trunk/src/courgette/third_party/bsdiff_apply.cc (revision 207822)
+++ trunk/src/courgette/third_party/bsdiff_apply.cc (working copy)
@@ -26,8 +26,6 @@
* Changelog:
* 2009-03-31 - Change to use Streams. Move CRC code to crc.{h,cc}
* --Stephen Adams <sra@chromium.org>
- * 2013-04-10 - Add wrapper method to apply a patch to files directly.
- * --Joshua Pawlicki <waffles@chromium.org>
*/
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
@@ -36,7 +34,6 @@
#include "courgette/third_party/bsdiff.h"
-#include "base/files/memory_mapped_file.h"
#include "courgette/crc.h"
#include "courgette/streams.h"
@@ -171,42 +168,4 @@
return OK;
}
-BSDiffStatus ApplyBinaryPatch(const base::FilePath& old_file_path,
- const base::FilePath& patch_file_path,
- const base::FilePath& new_file_path) {
- // Set up the old stream.
- base::MemoryMappedFile old_file;
- if (!old_file.Initialize(old_file_path)) {
- return READ_ERROR;
- }
- SourceStream old_file_stream;
- old_file_stream.Init(old_file.data(), old_file.length());
-
- // Set up the patch stream.
- base::MemoryMappedFile patch_file;
- if (!patch_file.Initialize(patch_file_path)) {
- return READ_ERROR;
- }
- SourceStream patch_file_stream;
- patch_file_stream.Init(patch_file.data(), patch_file.length());
-
- // Set up the new stream and apply the patch.
- SinkStream new_sink_stream;
- BSDiffStatus status = ApplyBinaryPatch(&old_file_stream,
- &patch_file_stream,
- &new_sink_stream);
- if (status != OK) {
- return status;
- }
-
- // Write the stream to disk.
- int written = file_util::WriteFile(
- new_file_path,
- reinterpret_cast<const char*>(new_sink_stream.Buffer()),
- static_cast<int>(new_sink_stream.Length()));
- if (written != static_cast<int>(new_sink_stream.Length()))
- return WRITE_ERROR;
- return OK;
-}
-
} // namespace
« no previous file with comments | « trunk/src/courgette/third_party/bsdiff.h ('k') | trunk/src/extensions/common/crx_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698