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

Unified Diff: Source/bindings/v8/custom/V8BlobCustomHelpers.h

Issue 74213009: File constructor understands lastModified. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to latest File API ED. Created 7 years, 1 month 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: Source/bindings/v8/custom/V8BlobCustomHelpers.h
diff --git a/Source/bindings/v8/custom/V8BlobCustomHelpers.h b/Source/bindings/v8/custom/V8BlobCustomHelpers.h
index 8bb22f0dac3b41646943a1244aba78b405b509df..d37321795b50765c3e14ddca70f8bf9e19828562 100644
--- a/Source/bindings/v8/custom/V8BlobCustomHelpers.h
+++ b/Source/bindings/v8/custom/V8BlobCustomHelpers.h
@@ -40,12 +40,40 @@ class BlobBuilder;
// Shared code between the custom constructor bindings for Blob and File.
namespace V8BlobCustomHelpers {
-// Extracts the "type" and "endings" properties out of the BlobPropertyBag passed to a Blob constructor.
-// http://www.w3.org/TR/FileAPI/#constructorParams
-// Returns true if everything went well, false if a JS exception was thrown.
-bool processBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, String& contentType, String& endings, v8::Isolate*);
+// Parsed properties from a BlobPropertyBag or a FilePropertyBag.
+//
+// Instances are stack-allocated by the File and Blob constructor.
+//
+// processBlobPropertyBag is only called when constructors receive a value for
kinuko 2013/11/20 08:01:22 nit: comment looks stale
pwnall-personal 2013/11/20 09:51:07 It's still true. lastModified is a bit of a snowf
kinuko 2013/11/20 10:13:39 I mean, we no longer seem to have the method proce
pwnall-personal 2013/11/20 10:40:31 Done. Ah, that is a very good point! I updated the
+// the optional BlobPropertyBag / FilePropertyBag argument. The defaults set in
+// the constructor are used otherwise.
+class ParsedProperties {
+public:
+ String contentType;
+ String endings;
kinuko 2013/11/20 08:01:22 I think we prefer having accessors for C++ class (
pwnall-personal 2013/11/20 09:51:07 Done. Thank you!
+
+ // False if this contains the properties of a BlobPropertyBag.
+ bool hasFileProperties;
+
+ void setLastModified(double);
+ void setDefaultLastModified();
+ double lastModified();
+
+ explicit ParsedProperties(bool hasFileProperties);
kinuko 2013/11/20 08:01:22 nit: usually we put ctor at the top
pwnall-personal 2013/11/20 09:51:07 Done. Thank you for your patience in teaching me!
+
+ // Extracts the "type" and "endings" properties out of the BlobPropertyBag passed to a Blob constructor.
+ // http://www.w3.org/TR/FileAPI/#constructorParams
+ // Returns true if everything went well, false if a JS exception was thrown.
+ bool parseBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, v8::Isolate*);
+
+private:
+ double m_lastModified;
+#ifndef NDEBUG
+ bool m_hasLastModified;
+#endif // NDEBUG
+};
-// Appends the blobParts passed to a Blob constructor into a BlobBuilder.
+// Appends the blobParts passed to a Blob or File constructor into a BlobBuilder.
// http://www.w3.org/TR/FileAPI/#constructorParams
// Returns true if everything went well, false if a JS exception was thrown.
bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, const String& endings, BlobBuilder&, v8::Isolate*);

Powered by Google App Engine
This is Rietveld 408576698