| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 result.modificationTime = element.m_expectedFileModificationTime; | 96 result.modificationTime = element.m_expectedFileModificationTime; |
| 97 #endif | 97 #endif |
| 98 break; | 98 break; |
| 99 #if ENABLE(BLOB) | 99 #if ENABLE(BLOB) |
| 100 case FormDataElement::encodedBlob: | 100 case FormDataElement::encodedBlob: |
| 101 result.type = Element::TypeBlob; | 101 result.type = Element::TypeBlob; |
| 102 result.url = element.m_url; | 102 result.url = element.m_url; |
| 103 result.blobURL = element.m_url; // FIXME: deprecate this. | 103 result.blobURL = element.m_url; // FIXME: deprecate this. |
| 104 break; | 104 break; |
| 105 #endif | 105 #endif |
| 106 #if ENABLE(FILE_SYSTEM) | |
| 107 case FormDataElement::encodedURL: | 106 case FormDataElement::encodedURL: |
| 108 result.type = Element::TypeURL; | 107 result.type = Element::TypeURL; |
| 109 result.url = element.m_url; | 108 result.url = element.m_url; |
| 110 result.fileStart = element.m_fileStart; | 109 result.fileStart = element.m_fileStart; |
| 111 result.fileLength = element.m_fileLength; | 110 result.fileLength = element.m_fileLength; |
| 112 result.modificationTime = element.m_expectedFileModificationTime; | 111 result.modificationTime = element.m_expectedFileModificationTime; |
| 113 break; | 112 break; |
| 114 #endif | |
| 115 default: | 113 default: |
| 116 ASSERT_NOT_REACHED(); | 114 ASSERT_NOT_REACHED(); |
| 117 return false; | 115 return false; |
| 118 } | 116 } |
| 119 | 117 |
| 120 return true; | 118 return true; |
| 121 } | 119 } |
| 122 | 120 |
| 123 void WebHTTPBody::appendData(const WebData& data) | 121 void WebHTTPBody::appendData(const WebData& data) |
| 124 { | 122 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 137 void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart
, long long fileLength, double modificationTime) | 135 void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart
, long long fileLength, double modificationTime) |
| 138 { | 136 { |
| 139 #if ENABLE(BLOB) | 137 #if ENABLE(BLOB) |
| 140 ensureMutable(); | 138 ensureMutable(); |
| 141 m_private->appendFileRange(filePath, fileStart, fileLength, modificationTime
); | 139 m_private->appendFileRange(filePath, fileStart, fileLength, modificationTime
); |
| 142 #endif | 140 #endif |
| 143 } | 141 } |
| 144 | 142 |
| 145 void WebHTTPBody::appendURLRange(const WebURL& url, long long start, long long l
ength, double modificationTime) | 143 void WebHTTPBody::appendURLRange(const WebURL& url, long long start, long long l
ength, double modificationTime) |
| 146 { | 144 { |
| 147 #if ENABLE(FILE_SYSTEM) | |
| 148 // Currently we only support filesystem URL. | 145 // Currently we only support filesystem URL. |
| 149 ASSERT(KURL(url).protocolIs("filesystem")); | 146 ASSERT(KURL(url).protocolIs("filesystem")); |
| 150 ensureMutable(); | 147 ensureMutable(); |
| 151 m_private->appendURLRange(url, start, length, modificationTime); | 148 m_private->appendURLRange(url, start, length, modificationTime); |
| 152 #endif | |
| 153 } | 149 } |
| 154 | 150 |
| 155 void WebHTTPBody::appendBlob(const WebURL& blobURL) | 151 void WebHTTPBody::appendBlob(const WebURL& blobURL) |
| 156 { | 152 { |
| 157 #if ENABLE(BLOB) | 153 #if ENABLE(BLOB) |
| 158 ASSERT(KURL(blobURL).protocolIs("blob")); | 154 ASSERT(KURL(blobURL).protocolIs("blob")); |
| 159 ensureMutable(); | 155 ensureMutable(); |
| 160 m_private->appendBlob(blobURL); | 156 m_private->appendBlob(blobURL); |
| 161 #endif | 157 #endif |
| 162 } | 158 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 204 } |
| 209 | 205 |
| 210 void WebHTTPBody::ensureMutable() | 206 void WebHTTPBody::ensureMutable() |
| 211 { | 207 { |
| 212 ASSERT(!isNull()); | 208 ASSERT(!isNull()); |
| 213 if (!m_private->hasOneRef()) | 209 if (!m_private->hasOneRef()) |
| 214 assign(static_cast<WebHTTPBodyPrivate*>(m_private->copy().leakRef())); | 210 assign(static_cast<WebHTTPBodyPrivate*>(m_private->copy().leakRef())); |
| 215 } | 211 } |
| 216 | 212 |
| 217 } // namespace WebKit | 213 } // namespace WebKit |
| OLD | NEW |