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

Side by Side Diff: Source/WebCore/platform/network/BlobRegistryImpl.cpp

Issue 13497009: Remove ENABLE(FILE_SYSTEM) compile-time flag. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added CodeGeneratorInspector.py change Created 7 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 handle->start(); 87 handle->start();
88 return handle.release(); 88 return handle.release();
89 } 89 }
90 90
91 void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons t BlobDataItemList& items) 91 void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons t BlobDataItemList& items)
92 { 92 {
93 for (BlobDataItemList::const_iterator iter = items.begin(); iter != items.en d(); ++iter) { 93 for (BlobDataItemList::const_iterator iter = items.begin(); iter != items.en d(); ++iter) {
94 if (iter->type == BlobDataItem::Data) 94 if (iter->type == BlobDataItem::Data)
95 blobStorageData->m_data.appendData(iter->data, iter->offset, iter->l ength); 95 blobStorageData->m_data.appendData(iter->data, iter->offset, iter->l ength);
96 #if ENABLE(FILE_SYSTEM)
97 else if (iter->type == BlobDataItem::URL) 96 else if (iter->type == BlobDataItem::URL)
98 blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->len gth, iter->expectedModificationTime); 97 blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->len gth, iter->expectedModificationTime);
99 #endif
100 else { 98 else {
101 ASSERT(iter->type == BlobDataItem::File); 99 ASSERT(iter->type == BlobDataItem::File);
102 blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->l ength, iter->expectedModificationTime); 100 blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->l ength, iter->expectedModificationTime);
103 } 101 }
104 } 102 }
105 } 103 }
106 104
107 void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons t BlobDataItemList& items, long long offset, long long length) 105 void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, cons t BlobDataItemList& items, long long offset, long long length)
108 { 106 {
109 ASSERT(length != BlobDataItem::toEndOfFile); 107 ASSERT(length != BlobDataItem::toEndOfFile);
110 108
111 BlobDataItemList::const_iterator iter = items.begin(); 109 BlobDataItemList::const_iterator iter = items.begin();
112 if (offset) { 110 if (offset) {
113 for (; iter != items.end(); ++iter) { 111 for (; iter != items.end(); ++iter) {
114 if (offset >= iter->length) 112 if (offset >= iter->length)
115 offset -= iter->length; 113 offset -= iter->length;
116 else 114 else
117 break; 115 break;
118 } 116 }
119 } 117 }
120 118
121 for (; iter != items.end() && length > 0; ++iter) { 119 for (; iter != items.end() && length > 0; ++iter) {
122 long long currentLength = iter->length - offset; 120 long long currentLength = iter->length - offset;
123 long long newLength = currentLength > length ? length : currentLength; 121 long long newLength = currentLength > length ? length : currentLength;
124 if (iter->type == BlobDataItem::Data) 122 if (iter->type == BlobDataItem::Data)
125 blobStorageData->m_data.appendData(iter->data, iter->offset + offset , newLength); 123 blobStorageData->m_data.appendData(iter->data, iter->offset + offset , newLength);
126 #if ENABLE(FILE_SYSTEM)
127 else if (iter->type == BlobDataItem::URL) 124 else if (iter->type == BlobDataItem::URL)
128 blobStorageData->m_data.appendURL(iter->url, iter->offset + offset, newLength, iter->expectedModificationTime); 125 blobStorageData->m_data.appendURL(iter->url, iter->offset + offset, newLength, iter->expectedModificationTime);
129 #endif
130 else { 126 else {
131 ASSERT(iter->type == BlobDataItem::File); 127 ASSERT(iter->type == BlobDataItem::File);
132 blobStorageData->m_data.appendFile(iter->path, iter->offset + offset , newLength, iter->expectedModificationTime); 128 blobStorageData->m_data.appendFile(iter->path, iter->offset + offset , newLength, iter->expectedModificationTime);
133 } 129 }
134 length -= newLength; 130 length -= newLength;
135 offset = 0; 131 offset = 0;
136 } 132 }
137 } 133 }
138 134
139 void BlobRegistryImpl::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blo bData) 135 void BlobRegistryImpl::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blo bData)
(...skipping 10 matching lines...) Expand all
150 // All the Blob items in the passing blob data are resolved and expanded int o a set of Data and File items. 146 // All the Blob items in the passing blob data are resolved and expanded int o a set of Data and File items.
151 147
152 for (BlobDataItemList::const_iterator iter = blobData->items().begin(); iter != blobData->items().end(); ++iter) { 148 for (BlobDataItemList::const_iterator iter = blobData->items().begin(); iter != blobData->items().end(); ++iter) {
153 switch (iter->type) { 149 switch (iter->type) {
154 case BlobDataItem::Data: 150 case BlobDataItem::Data:
155 blobStorageData->m_data.appendData(iter->data, 0, iter->data->length ()); 151 blobStorageData->m_data.appendData(iter->data, 0, iter->data->length ());
156 break; 152 break;
157 case BlobDataItem::File: 153 case BlobDataItem::File:
158 blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->l ength, iter->expectedModificationTime); 154 blobStorageData->m_data.appendFile(iter->path, iter->offset, iter->l ength, iter->expectedModificationTime);
159 break; 155 break;
160 #if ENABLE(FILE_SYSTEM)
161 case BlobDataItem::URL: 156 case BlobDataItem::URL:
162 blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->len gth, iter->expectedModificationTime); 157 blobStorageData->m_data.appendURL(iter->url, iter->offset, iter->len gth, iter->expectedModificationTime);
163 break; 158 break;
164 #endif
165 case BlobDataItem::Blob: 159 case BlobDataItem::Blob:
166 if (m_blobs.contains(iter->url.string())) 160 if (m_blobs.contains(iter->url.string()))
167 appendStorageItems(blobStorageData.get(), m_blobs.get(iter->url. string())->items(), iter->offset, iter->length); 161 appendStorageItems(blobStorageData.get(), m_blobs.get(iter->url. string())->items(), iter->offset, iter->length);
168 break; 162 break;
169 } 163 }
170 } 164 }
171 165
172 m_blobs.set(url.string(), blobStorageData); 166 m_blobs.set(url.string(), blobStorageData);
173 } 167 }
174 168
(...skipping 18 matching lines...) Expand all
193 187
194 BlobStorageData* BlobRegistryImpl::getBlobDataFromURL(const KURL& url) const 188 BlobStorageData* BlobRegistryImpl::getBlobDataFromURL(const KURL& url) const
195 { 189 {
196 ASSERT(isMainThread()); 190 ASSERT(isMainThread());
197 return m_blobs.get(url.string()).get(); 191 return m_blobs.get(url.string()).get();
198 } 192 }
199 193
200 } // namespace WebCore 194 } // namespace WebCore
201 195
202 #endif 196 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/platform/network/BlobData.cpp ('k') | Source/WebCore/platform/network/FormData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698