Refactoring of SessionService into a component part 3.
[chromium-blink-merge.git] / content / child / webblobregistry_impl.h
blob8fa967d9de7923977eebdd581389a8d4d3764aa4
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.
5 #ifndef CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_
6 #define CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
13 namespace blink {
14 class WebThreadSafeData;
15 } // namespace blink
17 namespace content {
18 class ThreadSafeSender;
20 class WebBlobRegistryImpl : public blink::WebBlobRegistry {
21 public:
22 explicit WebBlobRegistryImpl(ThreadSafeSender* sender);
23 virtual ~WebBlobRegistryImpl();
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&);
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);
44 private:
45 void SendDataForBlob(const std::string& uuid_str,
46 const blink::WebThreadSafeData& data);
48 scoped_refptr<ThreadSafeSender> sender_;
51 } // namespace content
53 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_