blob: 74bc131b4ed83d00d169deea3f911c3555076171 [file] [log] [blame]
// Copyright (c) 2010 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 "base/hash_tables.h"
#include "base/process.h"
#include "base/ref_counted.h"
class GURL;
class FilePath;
namespace base {
class Time;
namespace net {
class UploadData;
namespace webkit_blob {
class BlobData;
// This class handles the logistics of blob Storage within the browser process.
class BlobStorageController {
void RegisterBlobUrl(const GURL& url, const BlobData* blob_data);
void RegisterBlobUrlFrom(const GURL& url, const GURL& src_url);
void UnregisterBlobUrl(const GURL& url);
BlobData* GetBlobDataFromUrl(const GURL& url);
// If there is any blob reference in the upload data, it will get resolved
// and updated in place.
void ResolveBlobReferencesInUploadData(net::UploadData* upload_data);
friend class ViewBlobInternalsJob;
void AppendStorageItems(BlobData* target_blob_data,
BlobData* src_blob_data,
uint64 offset,
uint64 length);
void AppendFileItem(BlobData* target_blob_data,
const FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time);
typedef base::hash_map<std::string, scoped_refptr<BlobData> > BlobMap;
BlobMap blob_map_;
} // namespace webkit_blob