OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef WebBlobData_h | 31 #ifndef WebBlobData_h |
32 #define WebBlobData_h | 32 #define WebBlobData_h |
33 | 33 |
34 #include "WebNonCopyable.h" | 34 #include "WebNonCopyable.h" |
35 #include "WebPrivateOwnPtr.h" | 35 #include "WebPrivateOwnPtr.h" |
36 #include "WebString.h" | 36 #include "WebString.h" |
37 #include "WebThreadSafeData.h" | 37 #include "WebThreadSafeData.h" |
38 #include "WebURL.h" | 38 #include "WebURL.h" |
39 | 39 |
40 namespace blink { class BlobData; } | |
41 #if INSIDE_BLINK | 40 #if INSIDE_BLINK |
42 namespace WTF { template <typename T> class PassOwnPtr; } | 41 namespace WTF { template <typename T> class PassOwnPtr; } |
43 #endif | 42 #endif |
44 | 43 |
45 namespace blink { | 44 namespace blink { |
46 | 45 |
| 46 class BlobData; |
| 47 |
47 class WebBlobData : public WebNonCopyable { | 48 class WebBlobData : public WebNonCopyable { |
48 public: | 49 public: |
49 struct Item { | 50 struct Item { |
50 enum { TypeData, TypeFile, TypeBlob, TypeFileSystemURL } type; | 51 enum { TypeData, TypeFile, TypeBlob, TypeFileSystemURL } type; |
51 WebThreadSafeData data; | 52 WebThreadSafeData data; |
52 WebString blobUUID; | 53 WebString blobUUID; |
53 WebString filePath; | 54 WebString filePath; |
54 WebURL fileSystemURL; | 55 WebURL fileSystemURL; |
55 long long offset; | 56 long long offset; |
56 long long length; // -1 means go to the end of the file/blob. | 57 long long length; // -1 means go to the end of the file/blob. |
57 double expectedModificationTime; // 0.0 means that the time is not set. | 58 double expectedModificationTime; // 0.0 means that the time is not set. |
58 }; | 59 }; |
59 | 60 |
60 BLINK_PLATFORM_EXPORT WebBlobData(); | 61 BLINK_PLATFORM_EXPORT WebBlobData(); |
61 BLINK_PLATFORM_EXPORT ~WebBlobData(); | 62 BLINK_PLATFORM_EXPORT ~WebBlobData(); |
62 | 63 |
63 bool isNull() const { return !m_private.get(); } | 64 bool isNull() const { return !m_private.get(); } |
64 | 65 |
65 // Returns the number of items. | 66 // Returns the number of items. |
66 BLINK_PLATFORM_EXPORT size_t itemCount() const; | 67 BLINK_PLATFORM_EXPORT size_t itemCount() const; |
67 | 68 |
68 // Retrieves the values of the item at the given index. Returns false if | 69 // Retrieves the values of the item at the given index. Returns false if |
69 // index is out of bounds. | 70 // index is out of bounds. |
70 BLINK_PLATFORM_EXPORT bool itemAt(size_t index, Item& result) const; | 71 BLINK_PLATFORM_EXPORT bool itemAt(size_t index, Item& result) const; |
71 | 72 |
72 BLINK_PLATFORM_EXPORT WebString contentType() const; | 73 BLINK_PLATFORM_EXPORT WebString contentType() const; |
73 | 74 |
74 #if INSIDE_BLINK | 75 #if INSIDE_BLINK |
75 BLINK_PLATFORM_EXPORT WebBlobData(const WTF::PassOwnPtr<blink::BlobData>&); | 76 BLINK_PLATFORM_EXPORT WebBlobData(const WTF::PassOwnPtr<BlobData>&); |
76 BLINK_PLATFORM_EXPORT WebBlobData& operator=(const WTF::PassOwnPtr<blink::Bl
obData>&); | 77 BLINK_PLATFORM_EXPORT WebBlobData& operator=(const WTF::PassOwnPtr<BlobData>
&); |
77 BLINK_PLATFORM_EXPORT operator WTF::PassOwnPtr<blink::BlobData>(); | 78 BLINK_PLATFORM_EXPORT operator WTF::PassOwnPtr<BlobData>(); |
78 #endif | 79 #endif |
79 | 80 |
80 private: | 81 private: |
81 WebPrivateOwnPtr<blink::BlobData> m_private; | 82 WebPrivateOwnPtr<BlobData> m_private; |
82 }; | 83 }; |
83 | 84 |
84 } // namespace blink | 85 } // namespace blink |
85 | 86 |
86 #endif // WebBlobData_h | 87 #endif // WebBlobData_h |
OLD | NEW |