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

Side by Side Diff: storage/common/data_element.h

Issue 1098853003: [BlobAsync] Patch 4: Browser Classes & Logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed duplicate invalid test Created 5 years 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 unified diff | Download patch
« no previous file with comments | « storage/browser/blob/blob_storage_context.cc ('k') | storage/storage_browser.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef STORAGE_COMMON_DATA_ELEMENT_H_ 5 #ifndef STORAGE_COMMON_DATA_ELEMENT_H_
6 #define STORAGE_COMMON_DATA_ELEMENT_H_ 6 #define STORAGE_COMMON_DATA_ELEMENT_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/gtest_prod_util.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/time/time.h" 16 #include "base/time/time.h"
16 #include "storage/common/storage_common_export.h" 17 #include "storage/common/storage_common_export.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace storage { 20 namespace storage {
20 21
21 // Represents a base Web data element. This could be either one of 22 // Represents a base Web data element. This could be either one of
22 // bytes, file or blob data. 23 // bytes, file or blob data.
23 class STORAGE_COMMON_EXPORT DataElement { 24 class STORAGE_COMMON_EXPORT DataElement {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 125
125 // Sets TYPE_FILE_FILESYSTEM with range. 126 // Sets TYPE_FILE_FILESYSTEM with range.
126 void SetToFileSystemUrlRange(const GURL& filesystem_url, 127 void SetToFileSystemUrlRange(const GURL& filesystem_url,
127 uint64 offset, uint64 length, 128 uint64 offset, uint64 length,
128 const base::Time& expected_modification_time); 129 const base::Time& expected_modification_time);
129 130
130 // Sets to TYPE_DISK_CACHE_ENTRY with range. 131 // Sets to TYPE_DISK_CACHE_ENTRY with range.
131 void SetToDiskCacheEntryRange(uint64 offset, uint64 length); 132 void SetToDiskCacheEntryRange(uint64 offset, uint64 length);
132 133
133 private: 134 private:
135 FRIEND_TEST_ALL_PREFIXES(BlobAsyncTransportStrategyTest, TestInvalidParams);
134 friend STORAGE_COMMON_EXPORT void PrintTo(const DataElement& x, 136 friend STORAGE_COMMON_EXPORT void PrintTo(const DataElement& x,
135 ::std::ostream* os); 137 ::std::ostream* os);
136 Type type_; 138 Type type_;
137 std::vector<char> buf_; // For TYPE_BYTES. 139 std::vector<char> buf_; // For TYPE_BYTES.
138 const char* bytes_; // For TYPE_BYTES. 140 const char* bytes_; // For TYPE_BYTES.
139 base::FilePath path_; // For TYPE_FILE. 141 base::FilePath path_; // For TYPE_FILE.
140 GURL filesystem_url_; // For TYPE_FILE_FILESYSTEM. 142 GURL filesystem_url_; // For TYPE_FILE_FILESYSTEM.
141 std::string blob_uuid_; 143 std::string blob_uuid_;
142 uint64 offset_; 144 uint64 offset_;
143 uint64 length_; 145 uint64 length_;
144 base::Time expected_modification_time_; 146 base::Time expected_modification_time_;
145 }; 147 };
146 148
147 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a, 149 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a,
148 const DataElement& b); 150 const DataElement& b);
149 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a, 151 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a,
150 const DataElement& b); 152 const DataElement& b);
151 153
152 } // namespace storage 154 } // namespace storage
153 155
154 #endif // STORAGE_COMMON_DATA_ELEMENT_H_ 156 #endif // STORAGE_COMMON_DATA_ELEMENT_H_
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_storage_context.cc ('k') | storage/storage_browser.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698