OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 #include "bindings/v8/V8Binding.h" | 34 #include "bindings/v8/V8Binding.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class BlobBuilder; | 38 class BlobBuilder; |
39 | 39 |
40 // Shared code between the custom constructor bindings for Blob and File. | 40 // Shared code between the custom constructor bindings for Blob and File. |
41 namespace V8BlobCustomHelpers { | 41 namespace V8BlobCustomHelpers { |
42 | 42 |
43 // Parsed properties from a BlobPropertyBag or a FilePropertyBag. | |
44 struct ParsedProperties { | |
haraken
2013/11/18 10:27:48
We normally use class instead of struct for this k
pwnall-personal
2013/11/18 11:23:45
Done.
I also turned the function that took a Pars
| |
45 String contentType; | |
46 String endings; | |
47 | |
48 // False if this contains the properties of a BlobPropertyBag. | |
49 bool hasFileProperties; | |
50 | |
51 private: | |
52 double m_lastModifiedDate; | |
53 #ifndef NDEBUG | |
54 bool m_hasLastModifiedDate; | |
55 #endif // NDEBUG | |
56 | |
57 | |
58 public: | |
59 void setLastModifiedDate(double); | |
60 void setDefaultLastModifiedDate(); | |
61 double lastModifiedDate(); | |
62 | |
63 ParsedProperties(bool hasFileProperties); | |
haraken
2013/11/18 10:27:48
Add 'explicit'.
pwnall-personal
2013/11/18 11:23:45
Done.
Thank you!
| |
64 }; | |
65 | |
43 // Extracts the "type" and "endings" properties out of the BlobPropertyBag passe d to a Blob constructor. | 66 // Extracts the "type" and "endings" properties out of the BlobPropertyBag passe d to a Blob constructor. |
44 // http://www.w3.org/TR/FileAPI/#constructorParams | 67 // http://www.w3.org/TR/FileAPI/#constructorParams |
45 // Returns true if everything went well, false if a JS exception was thrown. | 68 // Returns true if everything went well, false if a JS exception was thrown. |
46 bool processBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobCl assName, String& contentType, String& endings, v8::Isolate*); | 69 bool processBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobCl assName, ParsedProperties&, v8::Isolate*); |
47 | 70 |
48 // Appends the blobParts passed to a Blob constructor into a BlobBuilder. | 71 // Appends the blobParts passed to a Blob or File constructor into a BlobBuilder . |
49 // http://www.w3.org/TR/FileAPI/#constructorParams | 72 // http://www.w3.org/TR/FileAPI/#constructorParams |
50 // Returns true if everything went well, false if a JS exception was thrown. | 73 // Returns true if everything went well, false if a JS exception was thrown. |
51 bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, const String& endings, BlobBuilder&, v8::Isolate*); | 74 bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, const String& endings, BlobBuilder&, v8::Isolate*); |
52 | 75 |
53 } // namespace V8BlobCustomHelpers | 76 } // namespace V8BlobCustomHelpers |
54 | 77 |
55 } // namespace WebCore | 78 } // namespace WebCore |
56 | 79 |
57 #endif // V8BlobCustomHelpers_h | 80 #endif // V8BlobCustomHelpers_h |
OLD | NEW |