blob: 344cc7db5e82d5a4943ab22e93f5e9ccda3b11cc [file] [log] [blame]
// Copyright 2015 The Chromium 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 <stdint.h>
#include <algorithm>
#include <ostream>
#include <vector>
#include "base/basictypes.h"
#include "storage/common/storage_common_export.h"
namespace storage {
// This class is serialized over IPC to send blob item data, or to signal that
// the memory has been populated.
struct STORAGE_COMMON_EXPORT BlobItemBytesResponse {
// not using std::numeric_limits<T>::max() because of non-C++11 builds.
static const size_t kInvalidIndex = SIZE_MAX;
explicit BlobItemBytesResponse(size_t request_number);
char* allocate_mutable_data(size_t size) {
return &inline_data[0];
size_t request_number;
std::vector<char> inline_data;
STORAGE_COMMON_EXPORT void PrintTo(const BlobItemBytesResponse& response,
std::ostream* os);
STORAGE_COMMON_EXPORT bool operator==(const BlobItemBytesResponse& a,
const BlobItemBytesResponse& b);
STORAGE_COMMON_EXPORT bool operator!=(const BlobItemBytesResponse& a,
const BlobItemBytesResponse& b);
} // namespace storage