chromium/third_party/puffin/src/puffpatch.cc

// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "puffin/src/include/puffin/puffpatch.h"

#include <inttypes.h>

#include <algorithm>
#include <string>
#include <utility>
#include <vector>

#include "base/containers/span.h"
#include "base/numerics/byte_conversions.h"
#include "zucchini/patch_reader.h"
#include "zucchini/zucchini.h"

#include "puffin/memory_stream.h"
#include "puffin/src/include/puffin/brotli_util.h"
#include "puffin/src/include/puffin/common.h"
#include "puffin/src/include/puffin/file_stream.h"
#include "puffin/src/include/puffin/huffer.h"
#include "puffin/src/include/puffin/puffer.h"
#include "puffin/src/include/puffin/stream.h"
#include "puffin/src/logging.h"
#include "puffin/src/puffin.pb.h"
#include "puffin/src/puffin_stream.h"

string;
unique_ptr;
vector;

namespace puffin {

const char kMagic[] =;
const size_t kMagicLength =;

namespace {

template <typename T>
void CopyRpfToVector(
    const google::protobuf::RepeatedPtrField<metadata::BitExtent>& from,
    T* to,
    size_t coef) {}

Status DecodePatch(const uint8_t* patch,
                   size_t patch_length,
                   size_t* bsdiff_patch_offset,
                   size_t* bsdiff_patch_size,
                   vector<BitExtent>* src_deflates,
                   vector<BitExtent>* dst_deflates,
                   vector<ByteExtent>* src_puffs,
                   vector<ByteExtent>* dst_puffs,
                   uint64_t* src_puff_size,
                   uint64_t* dst_puff_size,
                   metadata::PatchHeader_PatchType* patch_type) {}

Status ApplyZucchiniPatch(UniqueStreamPtr src_stream,
                          size_t src_size,
                          const uint8_t* patch_start,
                          size_t patch_size,
                          UniqueStreamPtr dst_stream) {}

}  // namespace

Status PuffPatch(UniqueStreamPtr src,
                 UniqueStreamPtr dst,
                 const uint8_t* patch,
                 size_t patch_length,
                 size_t max_cache_size) {}

Status ApplyPuffPatch(const base::FilePath& input_path,
                      const base::FilePath& patch_path,
                      const base::FilePath& output_path) {}

Status ApplyPuffPatch(base::File input_file,
                      base::File patch_file,
                      base::File output_file) {}

}  // namespace puffin