| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_ |
| 6 #define CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_ | 6 #define CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 11 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
| 12 | 12 |
| 13 namespace blink { |
| 14 class WebThreadSafeData; |
| 15 } // namespace blink |
| 16 |
| 13 namespace content { | 17 namespace content { |
| 14 class ThreadSafeSender; | 18 class ThreadSafeSender; |
| 15 | 19 |
| 16 class WebBlobRegistryImpl : public blink::WebBlobRegistry { | 20 class WebBlobRegistryImpl : public blink::WebBlobRegistry { |
| 17 public: | 21 public: |
| 18 explicit WebBlobRegistryImpl(ThreadSafeSender* sender); | 22 explicit WebBlobRegistryImpl(ThreadSafeSender* sender); |
| 19 virtual ~WebBlobRegistryImpl(); | 23 virtual ~WebBlobRegistryImpl(); |
| 20 | 24 |
| 21 virtual void registerBlobData(const blink::WebString& uuid, | 25 virtual void registerBlobData(const blink::WebString& uuid, |
| 22 const blink::WebBlobData& data); | 26 const blink::WebBlobData& data); |
| 23 virtual void addBlobDataRef(const blink::WebString& uuid); | 27 virtual void addBlobDataRef(const blink::WebString& uuid); |
| 24 virtual void removeBlobDataRef(const blink::WebString& uuid); | 28 virtual void removeBlobDataRef(const blink::WebString& uuid); |
| 25 virtual void registerPublicBlobURL(const blink::WebURL&, | 29 virtual void registerPublicBlobURL(const blink::WebURL&, |
| 26 const blink::WebString& uuid); | 30 const blink::WebString& uuid); |
| 27 virtual void revokePublicBlobURL(const blink::WebURL&); | 31 virtual void revokePublicBlobURL(const blink::WebURL&); |
| 28 | 32 |
| 29 // Additional support for Streams. | 33 // Additional support for Streams. |
| 30 virtual void registerStreamURL(const blink::WebURL& url, | 34 virtual void registerStreamURL(const blink::WebURL& url, |
| 31 const blink::WebString& content_type); | 35 const blink::WebString& content_type); |
| 32 virtual void registerStreamURL(const blink::WebURL& url, | 36 virtual void registerStreamURL(const blink::WebURL& url, |
| 33 const blink::WebURL& src_url); | 37 const blink::WebURL& src_url); |
| 38 // TODO(tyoshino): Remove once removed in Blink side. |
| 34 virtual void addDataToStream(const blink::WebURL& url, | 39 virtual void addDataToStream(const blink::WebURL& url, |
| 35 blink::WebThreadSafeData& data); | 40 blink::WebThreadSafeData& data); |
| 41 virtual void addDataToStream(const blink::WebURL& url, |
| 42 const char* data, size_t length); |
| 36 virtual void finalizeStream(const blink::WebURL& url); | 43 virtual void finalizeStream(const blink::WebURL& url); |
| 37 virtual void abortStream(const blink::WebURL& url); | 44 virtual void abortStream(const blink::WebURL& url); |
| 38 virtual void unregisterStreamURL(const blink::WebURL& url); | 45 virtual void unregisterStreamURL(const blink::WebURL& url); |
| 39 | 46 |
| 40 private: | 47 private: |
| 41 void SendDataForBlob(const std::string& uuid_str, | 48 void SendDataForBlob(const std::string& uuid_str, |
| 42 const blink::WebThreadSafeData& data); | 49 const blink::WebThreadSafeData& data); |
| 43 | 50 |
| 44 scoped_refptr<ThreadSafeSender> sender_; | 51 scoped_refptr<ThreadSafeSender> sender_; |
| 45 }; | 52 }; |
| 46 | 53 |
| 47 } // namespace content | 54 } // namespace content |
| 48 | 55 |
| 49 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ | 56 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ |
| OLD | NEW |