Changeset 168435 in webkit
- Timestamp:
- May 7, 2014 11:57:35 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168433 r168435 1 2014-05-07 Alexey Proskuryakov <ap@apple.com> 2 3 Make blob size computation lazy 4 https://bugs.webkit.org/show_bug.cgi?id=132653 5 6 Reviewed by Anders Carlsson. 7 8 * fileapi/Blob.cpp: 9 (WebCore::Blob::Blob): 10 (WebCore::Blob::size): 11 * fileapi/Blob.h: 12 (WebCore::Blob::size): Deleted. 13 * fileapi/File.cpp: 14 (WebCore::File::size): Deleted. 15 * fileapi/File.h: 16 * fileapi/ThreadableBlobRegistry.cpp: 17 (WebCore::ThreadableBlobRegistry::registerFileBlobURL): 18 (WebCore::ThreadableBlobRegistry::registerBlobURL): 19 (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice): 20 (WebCore::ThreadableBlobRegistry::blobSize): 21 (WebCore::ThreadableBlobRegistry::unregisterBlobURL): 22 (WebCore::unregisterBlobURLTask): Deleted. 23 * fileapi/ThreadableBlobRegistry.h: 24 * platform/network/BlobData.cpp: 25 (WebCore::BlobData::appendData): 26 * platform/network/BlobRegistry.h: 27 * platform/network/BlobRegistryImpl.cpp: 28 (WebCore::BlobRegistryImpl::registerBlobURL): 29 (WebCore::BlobRegistryImpl::registerBlobURLForSlice): 30 * platform/network/BlobRegistryImpl.h: 31 1 32 2014-05-06 Simon Fraser <simon.fraser@apple.com> 2 33 -
trunk/Source/WebCore/fileapi/Blob.cpp
r168333 r168435 80 80 Blob::Blob(Vector<char> data, const String& contentType) 81 81 : m_type(contentType) 82 , m_size(data.size()) 82 83 { 83 84 Vector<BlobPart> blobParts; 84 85 blobParts.append(BlobPart(std::move(data))); 85 86 m_internalURL = BlobURL::createInternalURL(); 86 m_size =ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType);87 ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType); 87 88 } 88 89 89 90 Blob::Blob(Vector<BlobPart> blobParts, const String& contentType) 90 91 : m_type(contentType) 91 { 92 m_internalURL = BlobURL::createInternalURL(); 93 m_size = ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType); 92 , m_size(-1) 93 { 94 m_internalURL = BlobURL::createInternalURL(); 95 ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType); 94 96 } 95 97 … … 105 107 Blob::Blob(const URL& srcURL, long long start, long long end, const String& type) 106 108 : m_type(Blob::normalizedContentType(type)) 107 { 108 m_internalURL = BlobURL::createInternalURL(); 109 m_size = ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end); 109 , m_size(-1) // size is not necessarily equal to end - start. 110 { 111 m_internalURL = BlobURL::createInternalURL(); 112 ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end); 110 113 } 111 114 #endif … … 114 117 { 115 118 ThreadableBlobRegistry::unregisterBlobURL(m_internalURL); 119 } 120 121 unsigned long long Blob::size() const 122 { 123 if (m_size < 0) { 124 // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to 125 // come up with an exception to throw if file size is not representable. 126 unsigned long long actualSize = ThreadableBlobRegistry::blobSize(m_internalURL); 127 m_size = (actualSize <= std::numeric_limits<long long>::max()) ? static_cast<long long>(actualSize) : 0; 128 } 129 130 return static_cast<unsigned long long>(m_size); 116 131 } 117 132 -
trunk/Source/WebCore/fileapi/Blob.h
r168333 r168435 71 71 const String& type() const { return m_type; } 72 72 73 virtual unsigned long long size() const { return static_cast<unsigned long long>(m_size); }73 unsigned long long size() const; 74 74 virtual bool isFile() const { return false; } 75 75 … … 114 114 115 115 String m_type; 116 long long m_size;116 mutable long long m_size; 117 117 }; 118 118 -
trunk/Source/WebCore/fileapi/File.cpp
r168430 r168435 78 78 } 79 79 80 unsigned long long File::size() const81 {82 // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to83 // come up with an exception to throw if file size is not representable.84 long long size;85 if (!getFileSize(m_path, size))86 return 0;87 return static_cast<unsigned long long>(size);88 }89 90 80 String File::contentTypeFromFilePathOrName(const String& name) 91 81 { -
trunk/Source/WebCore/fileapi/File.h
r168430 r168435 55 55 } 56 56 57 virtual unsigned long long size() const override;58 57 virtual bool isFile() const override { return true; } 59 58 … … 61 60 const String& name() const { return m_name; } 62 61 63 // This returns the current date and time if the file's last modifi ecation date is not known (per spec: http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate).62 // This returns the current date and time if the file's last modification date is not known (per spec: http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate). 64 63 double lastModifiedDate() const; 65 64 -
trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
r168333 r168435 107 107 // BlobRegistryContext performs an isolated copy of data. 108 108 BlobRegistryContext* context = new BlobRegistryContext(url, path, contentType); 109 BinarySemaphore semaphore;110 109 callOnMainThread([context] { 111 110 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); … … 115 114 } 116 115 117 unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType) 118 { 119 unsigned long long resultSize; 120 if (isMainThread()) 121 resultSize = blobRegistry().registerBlobURL(url, std::move(blobParts), contentType); 116 void ThreadableBlobRegistry::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType) 117 { 118 if (isMainThread()) 119 blobRegistry().registerBlobURL(url, std::move(blobParts), contentType); 122 120 else { 123 121 // BlobRegistryContext performs an isolated copy of data. 124 122 BlobRegistryContext* context = new BlobRegistryContext(url, std::move(blobParts), contentType); 125 BinarySemaphore semaphore; 126 callOnMainThread([context, &semaphore, &resultSize] { 127 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 128 resultSize = blobRegistry().registerBlobURL(blobRegistryContext->url, std::move(blobRegistryContext->blobParts), blobRegistryContext->contentType); 129 semaphore.signal(); 130 }); 131 semaphore.wait(std::numeric_limits<double>::max()); 132 } 133 return resultSize; 123 callOnMainThread([context] { 124 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 125 blobRegistry().registerBlobURL(blobRegistryContext->url, std::move(blobRegistryContext->blobParts), blobRegistryContext->contentType); 126 }); 127 } 134 128 } 135 129 … … 152 146 } 153 147 154 unsigned long long ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end) 148 void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end) 149 { 150 if (isMainThread()) 151 blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end); 152 else { 153 // BlobRegistryContext performs an isolated copy of data. 154 BlobRegistryContext* context = new BlobRegistryContext(newURL, srcURL); 155 callOnMainThread([context, start, end] { 156 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 157 blobRegistry().registerBlobURLForSlice(blobRegistryContext->url, blobRegistryContext->srcURL, start, end); 158 }); 159 } 160 } 161 162 unsigned long long ThreadableBlobRegistry::blobSize(const URL& url) 155 163 { 156 164 unsigned long long resultSize; 157 165 if (isMainThread()) 158 resultSize = blobRegistry(). registerBlobURLForSlice(newURL, srcURL, start, end);159 else { 160 // BlobRegistryContext performs an isolated copy of data. 161 BlobRegistryContext* context = new BlobRegistryContext( newURL, srcURL);166 resultSize = blobRegistry().blobSize(url); 167 else { 168 // BlobRegistryContext performs an isolated copy of data. 169 BlobRegistryContext* context = new BlobRegistryContext(url); 162 170 BinarySemaphore semaphore; 163 callOnMainThread([context, start, end,&semaphore, &resultSize] {164 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 165 resultSize = blobRegistry(). registerBlobURLForSlice(blobRegistryContext->url, blobRegistryContext->srcURL, start, end);171 callOnMainThread([context, &semaphore, &resultSize] { 172 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 173 resultSize = blobRegistry().blobSize(blobRegistryContext->url); 166 174 semaphore.signal(); 167 175 }); … … 169 177 } 170 178 return resultSize; 171 }172 173 static void unregisterBlobURLTask(void* context)174 {175 std::unique_ptr<BlobRegistryContext> blobRegistryContext(static_cast<BlobRegistryContext*>(context));176 blobRegistry().unregisterBlobURL(blobRegistryContext->url);177 179 } 178 180 … … 184 186 if (isMainThread()) 185 187 blobRegistry().unregisterBlobURL(url); 186 else 187 callOnMainThread(&unregisterBlobURLTask, new BlobRegistryContext(url)); 188 else { 189 // BlobRegistryContext performs an isolated copy of data. 190 BlobRegistryContext* context = new BlobRegistryContext(url); 191 callOnMainThread([context] { 192 std::unique_ptr<BlobRegistryContext> blobRegistryContext(context); 193 blobRegistry().unregisterBlobURL(blobRegistryContext->url); 194 }); 195 } 188 196 } 189 197 … … 199 207 } 200 208 201 unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL&, Vector<BlobPart>, const String&) 209 void ThreadableBlobRegistry::registerBlobURL(const URL&, Vector<BlobPart>, const String&) 210 { 211 } 212 213 void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin*, const URL&, const URL&) 214 { 215 } 216 217 void ThreadableBlobRegistry::registerBlobURLForSlice(const URL&, const URL&, long long, long long) 218 { 219 } 220 221 void ThreadableBlobRegistry::unregisterBlobURL(const URL&) 222 { 223 } 224 225 unsigned long long ThreadableBlobRegistry::blobSize(const URL&) 202 226 { 203 227 return 0; 204 228 } 205 229 206 void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin*, const URL&, const URL&) 207 { 208 } 209 210 unsigned long long ThreadableBlobRegistry::registerBlobURLForSlice(const URL&, const URL&, long long, long long) 230 PassRefPtr<SecurityOrigin> ThreadableBlobRegistry::getCachedOrigin(const URL&) 211 231 { 212 232 return 0; 213 233 } 214 234 215 void ThreadableBlobRegistry::unregisterBlobURL(const URL&)216 {217 }218 219 PassRefPtr<SecurityOrigin> ThreadableBlobRegistry::getCachedOrigin(const URL&)220 {221 return 0;222 }223 224 235 #endif // ENABL(BLOB) 225 236 -
trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h
r168333 r168435 44 44 public: 45 45 static void registerFileBlobURL(const URL&, const String& path, const String& contentType); 46 static unsigned long longregisterBlobURL(const URL&, Vector<BlobPart> blobParts, const String& contentType);46 static void registerBlobURL(const URL&, Vector<BlobPart> blobParts, const String& contentType); 47 47 static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL); 48 static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end); 48 49 static void unregisterBlobURL(const URL&); 49 50 50 static unsigned long long registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end);51 static unsigned long long blobSize(const URL&); 51 52 52 53 // Returns the origin for the given blob URL. This is because we are not able to embed the unique security origin or the origin of file URL -
trunk/Source/WebCore/platform/network/BlobData.cpp
r168391 r168435 70 70 void BlobData::appendData(PassRefPtr<RawData> data) 71 71 { 72 appendData(data, 0, data->length()); 72 size_t dataSize = data->length(); 73 appendData(data, 0, dataSize); 73 74 } 74 75 -
trunk/Source/WebCore/platform/network/BlobRegistry.h
r168333 r168435 51 51 52 52 // Registers a blob URL referring to the specified blob data. 53 virtual unsigned long longregisterBlobURL(const URL&, Vector<BlobPart>, const String& contentType) = 0;53 virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) = 0; 54 54 55 55 // Registers a new blob URL referring to the blob data identified by the specified srcURL. … … 57 57 58 58 // Negative start and end values select from the end. 59 virtual unsigned long longregisterBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) = 0;59 virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) = 0; 60 60 61 61 virtual void unregisterBlobURL(const URL&) = 0; 62 63 virtual unsigned long long blobSize(const URL&) = 0; 62 64 63 65 virtual bool isBlobRegistryImpl() const { return false; } -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp
r168391 r168435 129 129 } 130 130 131 unsigned long longBlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)131 void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType) 132 132 { 133 133 ASSERT(isMainThread()); … … 143 143 // All the Blob items in the passing blob data are resolved and expanded into a set of Data and File items. 144 144 145 unsigned long long size = 0;146 145 for (BlobPart& part : blobParts) { 147 146 switch (part.type()) { 148 147 case BlobPart::Data: { 149 unsigned long long partSize = part.data().size();150 148 RefPtr<RawData> rawData = RawData::create(part.moveData()); 151 size += partSize; 152 blobData->appendData(rawData.release(), 0, partSize); 149 blobData->appendData(rawData.release()); 153 150 break; 154 151 } 155 152 case BlobPart::Blob: { 156 153 if (!m_blobs.contains(part.url().string())) 157 return 0; 158 size += blobSize(part.url()); 154 return; 159 155 for (const BlobDataItem& item : m_blobs.get(part.url().string())->items()) 160 156 blobData->m_items.append(item); … … 165 161 166 162 m_blobs.set(url.string(), blobData.release()); 167 return size;168 163 } 169 164 … … 179 174 } 180 175 181 unsigned long longBlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)176 void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end) 182 177 { 183 178 ASSERT(isMainThread()); 184 179 BlobData* originalData = getBlobDataFromURL(srcURL); 185 180 if (!originalData) 186 return 0;181 return; 187 182 188 183 unsigned long long originalSize = blobSize(srcURL); … … 214 209 215 210 m_blobs.set(url.string(), newData.release()); 216 return newLength;217 211 } 218 212 -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.h
r168382 r168435 59 59 60 60 virtual void registerFileBlobURL(const WebCore::URL&, const String& path, const String& contentType) override; 61 virtual unsigned long longregisterBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override;61 virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override; 62 62 virtual void registerBlobURL(const URL&, const URL& srcURL) override; 63 virtual unsigned long longregisterBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;63 virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override; 64 64 virtual void unregisterBlobURL(const URL&) override; 65 65 virtual bool isBlobRegistryImpl() const override { return true; } 66 66 67 unsigned long long blobSize(const URL&);67 virtual unsigned long long blobSize(const URL&) override; 68 68 69 69 HashMap<String, RefPtr<BlobData>> m_blobs; -
trunk/Source/WebKit2/ChangeLog
r168433 r168435 1 2014-05-07 Alexey Proskuryakov <ap@apple.com> 2 3 Make blob size computation lazy 4 https://bugs.webkit.org/show_bug.cgi?id=132653 5 6 Reviewed by Anders Carlsson. 7 8 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: 9 (WebKit::NetworkBlobRegistry::registerBlobURL): 10 (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): 11 (WebKit::NetworkBlobRegistry::blobSize): 12 * NetworkProcess/FileAPI/NetworkBlobRegistry.h: 13 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 14 (WebKit::NetworkConnectionToWebProcess::registerBlobURL): 15 (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): 16 (WebKit::NetworkConnectionToWebProcess::blobSize): 17 * NetworkProcess/NetworkConnectionToWebProcess.h: 18 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: 19 * WebProcess/FileAPI/BlobRegistryProxy.cpp: 20 (WebKit::BlobRegistryProxy::registerBlobURL): 21 (WebKit::BlobRegistryProxy::registerBlobURLForSlice): 22 (WebKit::BlobRegistryProxy::blobSize): 23 * WebProcess/FileAPI/BlobRegistryProxy.h: 24 1 25 2014-05-06 Simon Fraser <simon.fraser@apple.com> 2 26 -
trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
r168333 r168435 69 69 } 70 70 71 uint64_tNetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, Vector<WebCore::BlobPart> blobParts, const String& contentType)71 void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, Vector<WebCore::BlobPart> blobParts, const String& contentType) 72 72 { 73 73 ASSERT(!m_sandboxExtensions.contains(url.string())); … … 80 80 } 81 81 82 uint64_t resultSize =blobRegistry().registerBlobURL(url, std::move(blobParts), contentType);82 blobRegistry().registerBlobURL(url, std::move(blobParts), contentType); 83 83 84 84 if (!sandboxExtensions.isEmpty()) … … 90 90 mapIterator = m_blobsForConnection.add(connection, HashSet<URL>()).iterator; 91 91 mapIterator->value.add(url); 92 93 return resultSize;94 92 } 95 93 … … 106 104 } 107 105 108 uint64_tNetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* connection, const WebCore::URL& url, const WebCore::URL& srcURL, int64_t start, int64_t end)106 void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* connection, const WebCore::URL& url, const WebCore::URL& srcURL, int64_t start, int64_t end) 109 107 { 110 uint64_t resultSize =blobRegistry().registerBlobURLForSlice(url, srcURL, start, end);108 blobRegistry().registerBlobURLForSlice(url, srcURL, start, end); 111 109 112 110 // FIXME: Only store extensions for files that the slice actually contains, not for all the files in original blob. … … 118 116 ASSERT(m_blobsForConnection.find(connection)->value.contains(srcURL)); 119 117 m_blobsForConnection.find(connection)->value.add(url); 120 121 return resultSize;122 118 } 123 119 … … 130 126 ASSERT(m_blobsForConnection.find(connection)->value.contains(url)); 131 127 m_blobsForConnection.find(connection)->value.remove(url); 128 } 129 130 uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess* connection, const WebCore::URL& url) 131 { 132 if (!m_blobsForConnection.contains(connection) || !m_blobsForConnection.find(connection)->value.contains(url)) 133 return 0; 134 135 return blobRegistry().blobSize(url); 132 136 } 133 137 -
trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
r168333 r168435 49 49 50 50 void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, PassRefPtr<SandboxExtension>, const String& contentType); 51 uint64_tregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);51 void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType); 52 52 void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL); 53 uint64_tregisterBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);53 void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end); 54 54 void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&); 55 uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&); 55 56 56 57 void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*); -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
r168333 r168435 231 231 } 232 232 233 void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType , uint64_t& resultSize)234 { 235 resultSize =NetworkBlobRegistry::shared().registerBlobURL(this, url, std::move(blobParts), contentType);233 void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType) 234 { 235 NetworkBlobRegistry::shared().registerBlobURL(this, url, std::move(blobParts), contentType); 236 236 } 237 237 … … 241 241 } 242 242 243 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end , uint64_t& resultSize)244 { 245 resultSize =NetworkBlobRegistry::shared().registerBlobURLForSlice(this, url, srcURL, start, end);243 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end) 244 { 245 NetworkBlobRegistry::shared().registerBlobURLForSlice(this, url, srcURL, start, end); 246 246 } 247 247 … … 250 250 NetworkBlobRegistry::shared().unregisterBlobURL(this, url); 251 251 } 252 253 void NetworkConnectionToWebProcess::blobSize(const URL& url, uint64_t& resultSize) 254 { 255 resultSize = NetworkBlobRegistry::shared().blobSize(this, url); 256 } 252 257 #endif 253 258 -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
r168333 r168435 89 89 #if ENABLE(BLOB) 90 90 void registerFileBlobURL(const WebCore::URL&, const String& path, const SandboxExtension::Handle&, const String& contentType); 91 void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType , uint64_t& resultSize);91 void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType); 92 92 void registerBlobURLFromURL(const WebCore::URL&, const WebCore::URL& srcURL); 93 void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end, uint64_t& resultSize); 93 void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end); 94 void blobSize(const WebCore::URL&, uint64_t& resultSize); 94 95 void unregisterBlobURL(const WebCore::URL&); 95 96 #endif -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r168333 r168435 46 46 #if ENABLE(BLOB) 47 47 RegisterFileBlobURL(WebCore::URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType) 48 RegisterBlobURL(WebCore::URL url, Vector<WebCore::BlobPart> blobParts, String contentType) -> (uint64_t resultSize)48 RegisterBlobURL(WebCore::URL url, Vector<WebCore::BlobPart> blobParts, String contentType) 49 49 RegisterBlobURLFromURL(WebCore::URL url, WebCore::URL srcURL) 50 RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end) -> (uint64_t resultSize)50 RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end) 51 51 UnregisterBlobURL(WebCore::URL url) 52 BlobSize(WebCore::URL url) -> (uint64_t resultSize) 52 53 #endif 53 54 } -
trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
r168333 r168435 51 51 } 52 52 53 unsigned long longBlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)53 void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType) 54 54 { 55 55 ASSERT(WebProcess::shared().usesNetworkProcess()); 56 56 57 uint64_t resultSize; 58 if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), Messages::NetworkConnectionToWebProcess::RegisterBlobURL::Reply(resultSize), 0)) 59 return 0; 60 return resultSize; 57 WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0); 61 58 } 62 59 … … 75 72 } 76 73 77 unsigned long long BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end) 74 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end) 75 { 76 ASSERT(WebProcess::shared().usesNetworkProcess()); 77 78 WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0); 79 } 80 81 unsigned long long BlobRegistryProxy::blobSize(const URL& url) 78 82 { 79 83 ASSERT(WebProcess::shared().usesNetworkProcess()); 80 84 81 85 uint64_t resultSize; 82 if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess:: RegisterBlobURLForSlice(url, srcURL, start, end), Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice::Reply(resultSize), 0))86 if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0)) 83 87 return 0; 84 88 return resultSize; -
trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h
r168333 r168435 36 36 public: 37 37 virtual void registerFileBlobURL(const WebCore::URL&, const String& path, const String& contentType) override; 38 virtual unsigned long longregisterBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override;38 virtual void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override; 39 39 virtual void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override; 40 40 virtual void unregisterBlobURL(const WebCore::URL&) override; 41 virtual unsigned long long registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override; 41 virtual void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override; 42 virtual unsigned long long blobSize(const WebCore::URL&) override; 42 43 }; 43 44
Note: See TracChangeset
for help on using the changeset viewer.