Home | History | Annotate | Download | only in child
      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_FILEAPI_WEBBLOBREGISTRY_IMPL_H_
      6 #define CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_
      7 
      8 #include "base/memory/ref_counted.h"
      9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
     10 #include "webkit/common/blob/blob_data.h"
     11 
     12 namespace WebKit {
     13 class WebBlobData;
     14 class WebString;
     15 class WebThreadSafeData;
     16 class WebURL;
     17 }
     18 
     19 namespace content {
     20 class ThreadSafeSender;
     21 
     22 class WebBlobRegistryImpl : public WebKit::WebBlobRegistry {
     23  public:
     24   explicit WebBlobRegistryImpl(ThreadSafeSender* sender);
     25   virtual ~WebBlobRegistryImpl();
     26 
     27   virtual void registerBlobURL(const WebKit::WebURL& url,
     28                                WebKit::WebBlobData& data);
     29   virtual void registerBlobURL(const WebKit::WebURL& url,
     30                                const WebKit::WebURL& src_url);
     31   virtual void unregisterBlobURL(const WebKit::WebURL& url);
     32 
     33   virtual void registerStreamURL(const WebKit::WebURL& url,
     34                                  const WebKit::WebString& content_type);
     35   virtual void registerStreamURL(const WebKit::WebURL& url,
     36                                  const WebKit::WebURL& src_url);
     37   virtual void addDataToStream(const WebKit::WebURL& url,
     38                                WebKit::WebThreadSafeData& data);
     39   virtual void finalizeStream(const WebKit::WebURL& url);
     40   virtual void unregisterStreamURL(const WebKit::WebURL& url);
     41 
     42  private:
     43   void SendDataForBlob(const WebKit::WebURL& url,
     44                        const WebKit::WebThreadSafeData& data);
     45 
     46   scoped_refptr<ThreadSafeSender> sender_;
     47 };
     48 
     49 }  // namespace content
     50 
     51 #endif  // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_
     52