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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 bool WebBlobData::itemAt(size_t index, Item& result) const | 60 bool WebBlobData::itemAt(size_t index, Item& result) const |
61 { | 61 { |
62 ASSERT(!isNull()); | 62 ASSERT(!isNull()); |
63 | 63 |
64 if (index >= m_private->items().size()) | 64 if (index >= m_private->items().size()) |
65 return false; | 65 return false; |
66 | 66 |
67 const BlobDataItem& item = m_private->items()[index]; | 67 const BlobDataItem& item = m_private->items()[index]; |
68 result.data.reset(); | 68 result.data.reset(); |
69 result.filePath.reset(); | 69 result.filePath.reset(); |
70 result.blobURL = KURL(); | |
71 result.blobUUID.reset(); | 70 result.blobUUID.reset(); |
72 result.offset = item.offset; | 71 result.offset = item.offset; |
73 result.length = item.length; | 72 result.length = item.length; |
74 result.expectedModificationTime = item.expectedModificationTime; | 73 result.expectedModificationTime = item.expectedModificationTime; |
75 | 74 |
76 switch (item.type) { | 75 switch (item.type) { |
77 case BlobDataItem::Data: | 76 case BlobDataItem::Data: |
78 result.type = Item::TypeData; | 77 result.type = Item::TypeData; |
79 result.data = item.data; | 78 result.data = item.data; |
80 return true; | 79 return true; |
81 case BlobDataItem::File: | 80 case BlobDataItem::File: |
82 result.type = Item::TypeFile; | 81 result.type = Item::TypeFile; |
83 result.filePath = item.path; | 82 result.filePath = item.path; |
84 return true; | 83 return true; |
85 case BlobDataItem::Blob: | 84 case BlobDataItem::Blob: |
86 result.type = Item::TypeBlob; | 85 result.type = Item::TypeBlob; |
87 result.blobURL = item.url; // FIXME: deprecate this. | 86 result.blobUUID = item.blobDataHandle->uuid(); |
88 result.url = item.url; // DEPRECATED, should be able to remove after htt
ps://codereview.chromium.org/23223003/ lands | |
89 return true; | 87 return true; |
90 case BlobDataItem::URL: | 88 case BlobDataItem::FileSystemURL: |
91 result.type = Item::TypeFileSystemURL; | 89 result.type = Item::TypeFileSystemURL; |
92 result.url = item.url; // DEPRECATED | 90 result.fileSystemURL = item.fileSystemURL; |
93 result.fileSystemURL = item.url; | |
94 return true; | 91 return true; |
95 } | 92 } |
96 ASSERT_NOT_REACHED(); | 93 ASSERT_NOT_REACHED(); |
97 return false; | 94 return false; |
98 } | 95 } |
99 | 96 |
100 WebString WebBlobData::contentType() const | 97 WebString WebBlobData::contentType() const |
101 { | 98 { |
102 ASSERT(!isNull()); | 99 ASSERT(!isNull()); |
103 return m_private->contentType(); | 100 return m_private->contentType(); |
(...skipping 25 matching lines...) Expand all Loading... |
129 } | 126 } |
130 | 127 |
131 void WebBlobData::assign(const PassOwnPtr<BlobData>& data) | 128 void WebBlobData::assign(const PassOwnPtr<BlobData>& data) |
132 { | 129 { |
133 if (m_private) | 130 if (m_private) |
134 delete m_private; | 131 delete m_private; |
135 m_private = static_cast<WebBlobDataPrivate*>(data.leakPtr()); | 132 m_private = static_cast<WebBlobDataPrivate*>(data.leakPtr()); |
136 } | 133 } |
137 | 134 |
138 } // namespace WebKit | 135 } // namespace WebKit |
OLD | NEW |