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

Unified Diff: storage/common/data_element.h

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created local var to improve readability Created 5 years, 9 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
Index: storage/common/data_element.h
diff --git a/storage/common/data_element.h b/storage/common/data_element.h
index 0efe1550a91e9a509d1cc0548854167a58c3a689..333e55b6f3be99f0341c9ed099e1a24e1e8590db 100644
--- a/storage/common/data_element.h
+++ b/storage/common/data_element.h
@@ -33,7 +33,12 @@ class STORAGE_COMMON_EXPORT DataElement {
~DataElement();
Type type() const { return type_; }
- const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; }
+ const char* bytes() const {
+ if (length_)
+ return bytes_ ? bytes_ : &buf_[0];
+ else
+ return nullptr;
+ }
const base::FilePath& path() const { return path_; }
const GURL& filesystem_url() const { return filesystem_url_; }
const std::string& blob_uuid() const { return blob_uuid_; }
« storage/browser/blob/blob_url_request_job.cc ('K') | « storage/browser/blob/blob_url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698