cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / content / child / fileapi / webfilewriter_impl.h
blob43ac63df3edfb8c851c6b5f974ee10f9f52ae231
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_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "content/child/fileapi/webfilewriter_base.h"
14 namespace content {
16 // An implementation of WebFileWriter for use in chrome renderers and workers.
17 class WebFileWriterImpl : public WebFileWriterBase,
18 public base::SupportsWeakPtr<WebFileWriterImpl> {
19 public:
20 enum Type {
21 TYPE_SYNC,
22 TYPE_ASYNC,
25 WebFileWriterImpl(const GURL& path,
26 blink::WebFileWriterClient* client,
27 Type type,
28 const scoped_refptr<base::SingleThreadTaskRunner>&
29 main_thread_task_runner);
30 virtual ~WebFileWriterImpl();
32 protected:
33 // WebFileWriterBase overrides
34 void DoTruncate(const GURL& path, int64 offset) override;
35 void DoWrite(const GURL& path,
36 const std::string& blob_id,
37 int64 offset) override;
38 void DoCancel() override;
40 private:
41 class WriterBridge;
43 void RunOnMainThread(const base::Closure& closure);
45 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
46 scoped_refptr<WriterBridge> bridge_;
49 } // namespace content
51 #endif // CONTENT_CHILD_FILEAPI_WEBFILEWRITER_IMPL_H_