Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / child / webblobregistry_impl.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_
6 #define CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
12
13 namespace blink {
14 class WebThreadSafeData;
15 }  // namespace blink
16
17 namespace content {
18 class ThreadSafeSender;
19
20 class WebBlobRegistryImpl : public blink::WebBlobRegistry {
21  public:
22   explicit WebBlobRegistryImpl(ThreadSafeSender* sender);
23   virtual ~WebBlobRegistryImpl();
24
25   virtual void registerBlobData(const blink::WebString& uuid,
26                                 const blink::WebBlobData& data);
27   virtual void addBlobDataRef(const blink::WebString& uuid);
28   virtual void removeBlobDataRef(const blink::WebString& uuid);
29   virtual void registerPublicBlobURL(const blink::WebURL&,
30                                      const blink::WebString& uuid);
31   virtual void revokePublicBlobURL(const blink::WebURL&);
32
33   // Additional support for Streams.
34   virtual void registerStreamURL(const blink::WebURL& url,
35                                  const blink::WebString& content_type);
36   virtual void registerStreamURL(const blink::WebURL& url,
37                                  const blink::WebURL& src_url);
38   virtual void addDataToStream(const blink::WebURL& url,
39                                const char* data, size_t length);
40   virtual void finalizeStream(const blink::WebURL& url);
41   virtual void abortStream(const blink::WebURL& url);
42   virtual void unregisterStreamURL(const blink::WebURL& url);
43
44  private:
45   void SendDataForBlob(const std::string& uuid_str,
46                        const blink::WebThreadSafeData& data);
47
48   scoped_refptr<ThreadSafeSender> sender_;
49 };
50
51 }  // namespace content
52
53 #endif  // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_