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

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

Issue 2006053004: Relanding: Deduplicating code performing WebHTTPBody::Element conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing dbg-only crash when bytes() is called on empty storage::DataElement. Created 4 years, 7 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 unified diff | Download patch
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 24 matching lines...) Expand all
35 TYPE_BLOB, 35 TYPE_BLOB,
36 TYPE_FILE_FILESYSTEM, 36 TYPE_FILE_FILESYSTEM,
37 TYPE_DISK_CACHE_ENTRY, 37 TYPE_DISK_CACHE_ENTRY,
38 }; 38 };
39 39
40 DataElement(); 40 DataElement();
41 DataElement(const DataElement& other); 41 DataElement(const DataElement& other);
42 ~DataElement(); 42 ~DataElement();
43 43
44 Type type() const { return type_; } 44 Type type() const { return type_; }
45 const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; } 45 const char* bytes() const { return bytes_ ? bytes_ : buf_.data(); }
Łukasz Anforowicz 2016/05/25 00:26:18 There are places in code where users of DataElemen
danakj 2016/05/25 22:13:46 Returning null lgtm
46 const base::FilePath& path() const { return path_; } 46 const base::FilePath& path() const { return path_; }
47 const GURL& filesystem_url() const { return filesystem_url_; } 47 const GURL& filesystem_url() const { return filesystem_url_; }
48 const std::string& blob_uuid() const { return blob_uuid_; } 48 const std::string& blob_uuid() const { return blob_uuid_; }
49 uint64_t offset() const { return offset_; } 49 uint64_t offset() const { return offset_; }
50 uint64_t length() const { return length_; } 50 uint64_t length() const { return length_; }
51 const base::Time& expected_modification_time() const { 51 const base::Time& expected_modification_time() const {
52 return expected_modification_time_; 52 return expected_modification_time_;
53 } 53 }
54 54
55 // For use with SetToAllocatedBytes. Should only be used after calling 55 // For use with SetToAllocatedBytes. Should only be used after calling
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 }; 155 };
156 156
157 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a, 157 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a,
158 const DataElement& b); 158 const DataElement& b);
159 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a, 159 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a,
160 const DataElement& b); 160 const DataElement& b);
161 161
162 } // namespace storage 162 } // namespace storage
163 163
164 #endif // STORAGE_COMMON_DATA_ELEMENT_H_ 164 #endif // STORAGE_COMMON_DATA_ELEMENT_H_
OLDNEW
« content/renderer/http_body_conversions.cc ('K') | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698