Revert of Allow BlobDataHandles to be copied, and have their UUIDs read, on any threa...
[chromium-blink-merge.git] / content / child / webblobregistry_impl.h
blob6588a5290735268ed998c96b09545e1a94f84ef4
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_FILEAPI_WEBBLOBREGISTRY_IMPL_H_
6 #define CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
10 #include "webkit/common/blob/blob_data.h"
12 namespace blink {
13 class WebBlobData;
14 class WebString;
15 class WebThreadSafeData;
16 class WebURL;
19 namespace content {
20 class ThreadSafeSender;
22 class WebBlobRegistryImpl : public blink::WebBlobRegistry {
23 public:
24 explicit WebBlobRegistryImpl(ThreadSafeSender* sender);
25 virtual ~WebBlobRegistryImpl();
27 virtual void registerBlobData(const blink::WebString& uuid,
28 const blink::WebBlobData& data);
29 virtual void addBlobDataRef(const blink::WebString& uuid);
30 virtual void removeBlobDataRef(const blink::WebString& uuid);
31 virtual void registerPublicBlobURL(const blink::WebURL&,
32 const blink::WebString& uuid);
33 virtual void revokePublicBlobURL(const blink::WebURL&);
35 // Additional support for Streams.
36 virtual void registerStreamURL(const blink::WebURL& url,
37 const blink::WebString& content_type);
38 virtual void registerStreamURL(const blink::WebURL& url,
39 const blink::WebURL& src_url);
40 virtual void addDataToStream(const blink::WebURL& url,
41 blink::WebThreadSafeData& data);
42 virtual void finalizeStream(const blink::WebURL& url);
43 virtual void abortStream(const blink::WebURL& url);
44 virtual void unregisterStreamURL(const blink::WebURL& url);
46 private:
47 void SendDataForBlob(const std::string& uuid_str,
48 const blink::WebThreadSafeData& data);
50 scoped_refptr<ThreadSafeSender> sender_;
53 } // namespace content
55 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_