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

Unified Diff: mi_exe_stub/x86_encoder/bcj.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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 | « mi_exe_stub/tar.cc ('k') | mi_exe_stub/x86_encoder/bcj2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mi_exe_stub/x86_encoder/bcj.cc
diff --git a/mi_exe_stub/x86_encoder/bcj.cc b/mi_exe_stub/x86_encoder/bcj.cc
deleted file mode 100644
index 9d0d19ae8e3d5e258a2d6984f3d22fdbae07b5de..0000000000000000000000000000000000000000
--- a/mi_exe_stub/x86_encoder/bcj.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-//
-// BCJ encodes a file to increase its compressibility.
-
-#include <windows.h>
-#include <shellapi.h>
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "third_party/smartany/scoped_any.h"
-
-extern "C" {
-#include "third_party/lzma/v4_65/files/C/Bra.h"
-}
-
-int wmain(int argc, WCHAR* argv[], WCHAR* env[]) {
- UNREFERENCED_PARAMETER(env);
-
- if (argc < 3) {
- return 1;
- }
-
- // argv[1] is the input file, argv[2] is the output file.
- scoped_hfile file(::CreateFile(argv[1], GENERIC_READ, 0,
- NULL, OPEN_EXISTING, 0, NULL));
- if (!valid(file)) {
- return 2;
- }
-
- LARGE_INTEGER file_size_data;
- if (!::GetFileSizeEx(get(file), &file_size_data)) {
- return 3;
- }
-
- DWORD file_size = static_cast<DWORD>(file_size_data.QuadPart);
- scoped_array<uint8> buffer(new uint8[file_size]);
- DWORD bytes_read = 0;
- if (!::ReadFile(get(file), buffer.get(), file_size, &bytes_read, NULL) ||
- bytes_read != file_size) {
- return 4;
- }
-
- uint32 conversion_state;
- x86_Convert_Init(conversion_state);
- // processed might be less than bytes read. This is apparently OK, although
- // I don't understand why!
- uint32 processed = x86_Convert(buffer.get(),
- bytes_read,
- 0,
- &conversion_state,
- 1 /* encoding */);
-
- reset(file, ::CreateFile(argv[2], GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0,
- NULL));
- if (!valid(file)) {
- return 6;
- }
-
- DWORD bytes_written = 0;
- if (!::WriteFile(get(file), buffer.get(), bytes_read, &bytes_written, NULL)) {
- return 7;
- }
-
- return 0;
-}
« no previous file with comments | « mi_exe_stub/tar.cc ('k') | mi_exe_stub/x86_encoder/bcj2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698