Chromium Code Reviews| 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_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ | 5 #ifndef CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ |
| 6 #define CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ | 6 #define CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
| 10 #include "webkit/common/blob/blob_data.h" | 10 #include "webkit/common/blob/blob_data.h" |
| 11 | 11 |
| 12 namespace WebKit { | 12 namespace WebKit { |
| 13 class WebBlobData; | 13 class WebBlobData; |
| 14 class WebString; | 14 class WebString; |
| 15 class WebThreadSafeData; | 15 class WebThreadSafeData; |
| 16 class WebURL; | 16 class WebURL; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class ThreadSafeSender; | 20 class ThreadSafeSender; |
| 21 | 21 |
| 22 class WebBlobRegistryImpl : public WebKit::WebBlobRegistry { | 22 class WebBlobRegistryImpl : public WebKit::WebBlobRegistry { |
| 23 public: | 23 public: |
| 24 explicit WebBlobRegistryImpl(ThreadSafeSender* sender); | 24 explicit WebBlobRegistryImpl(ThreadSafeSender* sender); |
| 25 virtual ~WebBlobRegistryImpl(); | 25 virtual ~WebBlobRegistryImpl(); |
| 26 | 26 |
| 27 virtual void registerBlobData(const WebKit::WebString& uuid, | |
| 28 const WebKit::WebBlobData& data); | |
| 29 virtual void addBlobDataRef(const WebKit::WebString& uuid); | |
| 30 virtual void removeBlobDataRef(const WebKit::WebString& uuid); | |
| 31 virtual void registerPublicBlobURL(const WebKit::WebURL&, | |
| 32 const WebKit::WebString& uuid); | |
| 33 virtual void revokePublicBlobURL(const WebKit::WebURL&); | |
| 34 | |
| 35 // DEPRECATED, almost | |
|
ericu
2013/08/21 23:26:09
OK, that almost is funny, but needs to have your n
michaeln
2013/08/27 23:24:06
Done.
| |
| 27 virtual void registerBlobURL(const WebKit::WebURL& url, | 36 virtual void registerBlobURL(const WebKit::WebURL& url, |
| 28 WebKit::WebBlobData& data); | 37 WebKit::WebBlobData& data); |
| 29 virtual void registerBlobURL(const WebKit::WebURL& url, | 38 virtual void registerBlobURL(const WebKit::WebURL& url, |
| 30 const WebKit::WebURL& src_url); | 39 const WebKit::WebURL& src_url); |
| 31 virtual void unregisterBlobURL(const WebKit::WebURL& url); | 40 virtual void unregisterBlobURL(const WebKit::WebURL& url); |
| 32 | 41 |
| 42 // Additional support for Streams. | |
| 33 virtual void registerStreamURL(const WebKit::WebURL& url, | 43 virtual void registerStreamURL(const WebKit::WebURL& url, |
| 34 const WebKit::WebString& content_type); | 44 const WebKit::WebString& content_type); |
| 35 virtual void registerStreamURL(const WebKit::WebURL& url, | 45 virtual void registerStreamURL(const WebKit::WebURL& url, |
| 36 const WebKit::WebURL& src_url); | 46 const WebKit::WebURL& src_url); |
| 37 virtual void addDataToStream(const WebKit::WebURL& url, | 47 virtual void addDataToStream(const WebKit::WebURL& url, |
| 38 WebKit::WebThreadSafeData& data); | 48 WebKit::WebThreadSafeData& data); |
| 39 virtual void finalizeStream(const WebKit::WebURL& url); | 49 virtual void finalizeStream(const WebKit::WebURL& url); |
| 40 virtual void unregisterStreamURL(const WebKit::WebURL& url); | 50 virtual void unregisterStreamURL(const WebKit::WebURL& url); |
| 41 | 51 |
| 42 private: | 52 private: |
| 43 void SendDataForBlob(const WebKit::WebURL& url, | 53 void SendDataForBlob(const std::string& uuid_str, |
| 44 const WebKit::WebThreadSafeData& data); | 54 const WebKit::WebThreadSafeData& data); |
| 45 | 55 |
| 46 scoped_refptr<ThreadSafeSender> sender_; | 56 scoped_refptr<ThreadSafeSender> sender_; |
| 47 }; | 57 }; |
| 48 | 58 |
| 49 } // namespace content | 59 } // namespace content |
| 50 | 60 |
| 51 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ | 61 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ |
| OLD | NEW |