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

Unified Diff: webkit/common/blob/blob_data.h

Issue 524983002: Move fileapi-related files from webkit/common/ to storage/common/ and set up redirect headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 6 years, 3 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 | « webkit/common/BUILD.gn ('k') | webkit/common/blob/blob_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/common/blob/blob_data.h
diff --git a/webkit/common/blob/blob_data.h b/webkit/common/blob/blob_data.h
index 691867964ba89d6b70ab47926fb0f33eb2f3dacd..25d1fa231d58e624ef2c2eb7bca2cb92fcf5c20a 100644
--- a/webkit/common/blob/blob_data.h
+++ b/webkit/common/blob/blob_data.h
@@ -1,98 +1,5 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 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.
-#ifndef WEBKIT_COMMON_BLOB_BLOB_DATA_H_
-#define WEBKIT_COMMON_BLOB_BLOB_DATA_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/files/file_path.h"
-#include "base/memory/ref_counted.h"
-#include "base/time/time.h"
-#include "url/gurl.h"
-#include "webkit/common/blob/shareable_file_reference.h"
-#include "webkit/common/data_element.h"
-#include "webkit/common/storage_common_export.h"
-
-namespace storage {
-
-class STORAGE_COMMON_EXPORT BlobData
- : public base::RefCounted<BlobData> {
- public:
- typedef storage::DataElement Item;
-
- // TODO(michaeln): remove the empty ctor when we fully transition to uuids.
- BlobData();
- explicit BlobData(const std::string& uuid);
-
- void AppendData(const std::string& data) {
- AppendData(data.c_str(), data.size());
- }
-
- void AppendData(const char* data, size_t length);
-
- void AppendFile(const base::FilePath& file_path, uint64 offset, uint64 length,
- const base::Time& expected_modification_time);
- void AppendBlob(const std::string& uuid, uint64 offset, uint64 length);
- void AppendFileSystemFile(const GURL& url, uint64 offset, uint64 length,
- const base::Time& expected_modification_time);
-
- void AttachShareableFileReference(ShareableFileReference* reference) {
- shareable_files_.push_back(reference);
- }
-
- const std::string& uuid() const { return uuid_; }
- const std::vector<Item>& items() const { return items_; }
- const std::string& content_type() const { return content_type_; }
- void set_content_type(const std::string& content_type) {
- content_type_ = content_type;
- }
-
- const std::string& content_disposition() const {
- return content_disposition_;
- }
- void set_content_disposition(const std::string& content_disposition) {
- content_disposition_ = content_disposition;
- }
-
- int64 GetMemoryUsage() const;
-
- private:
- friend class base::RefCounted<BlobData>;
- virtual ~BlobData();
-
- std::string uuid_;
- std::string content_type_;
- std::string content_disposition_;
- std::vector<Item> items_;
- std::vector<scoped_refptr<ShareableFileReference> > shareable_files_;
-
- DISALLOW_COPY_AND_ASSIGN(BlobData);
-};
-
-#if defined(UNIT_TEST)
-inline bool operator==(const BlobData& a, const BlobData& b) {
- if (a.content_type() != b.content_type())
- return false;
- if (a.content_disposition() != b.content_disposition())
- return false;
- if (a.items().size() != b.items().size())
- return false;
- for (size_t i = 0; i < a.items().size(); ++i) {
- if (a.items()[i] != b.items()[i])
- return false;
- }
- return true;
-}
-
-inline bool operator!=(const BlobData& a, const BlobData& b) {
- return !(a == b);
-}
-#endif // defined(UNIT_TEST)
-
-} // namespace storage
-
-#endif // WEBKIT_COMMON_BLOB_BLOB_DATA_H_
+#include "storage/common/blob/blob_data.h"
« no previous file with comments | « webkit/common/BUILD.gn ('k') | webkit/common/blob/blob_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698