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_WEBFILEWRITER_IMPL_H_
6 #define CONTENT_CHILD_FILEAPI_WEBFILEWRITER_IMPL_H_
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop/message_loop_proxy.h"
13 #include "content/child/fileapi/webfilewriter_base.h"
17 // An implementation of WebFileWriter for use in chrome renderers and workers.
18 class WebFileWriterImpl
: public WebFileWriterBase
,
19 public base::SupportsWeakPtr
<WebFileWriterImpl
> {
26 WebFileWriterImpl(const GURL
& path
,
27 blink::WebFileWriterClient
* client
,
29 base::MessageLoopProxy
* main_thread_loop
);
30 virtual ~WebFileWriterImpl();
33 // WebFileWriterBase overrides
34 virtual void DoTruncate(const GURL
& path
, int64 offset
) OVERRIDE
;
35 virtual void DoWrite(const GURL
& path
, const std::string
& blob_id
,
36 int64 offset
) OVERRIDE
;
37 virtual void DoCancel() OVERRIDE
;
42 void RunOnMainThread(const base::Closure
& closure
);
44 scoped_refptr
<base::MessageLoopProxy
> main_thread_loop_
;
45 scoped_refptr
<WriterBridge
> bridge_
;
48 } // namespace content
50 #endif // CONTENT_CHILD_FILEAPI_WEBFILEWRITER_IMPL_H_