| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ |
| 6 #define CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ | 6 #define CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 10 #include "webkit/fileapi/webfilewriter_base.h" | 12 #include "webkit/fileapi/webfilewriter_base.h" |
| 11 | 13 |
| 12 namespace content { | 14 namespace content { |
| 13 | 15 |
| 14 // An implementation of WebFileWriter for use in chrome renderers and workers. | 16 // An implementation of WebFileWriter for use in chrome renderers and workers. |
| 15 class WebFileWriterImpl : public fileapi::WebFileWriterBase, | 17 class WebFileWriterImpl : public fileapi::WebFileWriterBase, |
| 16 public base::SupportsWeakPtr<WebFileWriterImpl> { | 18 public base::SupportsWeakPtr<WebFileWriterImpl> { |
| 17 public: | 19 public: |
| 18 WebFileWriterImpl(const GURL& path, WebKit::WebFileWriterClient* client); | 20 WebFileWriterImpl(const GURL& path, WebKit::WebFileWriterClient* client); |
| 19 virtual ~WebFileWriterImpl(); | 21 virtual ~WebFileWriterImpl(); |
| 20 | 22 |
| 21 protected: | 23 protected: |
| 22 // WebFileWriterBase overrides | 24 // WebFileWriterBase overrides |
| 23 virtual void DoTruncate(const GURL& path, int64 offset) OVERRIDE; | 25 virtual void DoTruncate(const GURL& path, int64 offset) OVERRIDE; |
| 24 virtual void DoWrite(const GURL& path, const GURL& blob_url, | 26 virtual void DoWrite(const GURL& path, const std::string& blob_uuid, |
| 25 int64 offset) OVERRIDE; | 27 int64 offset) OVERRIDE; |
| 26 virtual void DoCancel() OVERRIDE; | 28 virtual void DoCancel() OVERRIDE; |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 class CallbackDispatcher; | 31 class CallbackDispatcher; |
| 30 int request_id_; | 32 int request_id_; |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 } // namespace content | 35 } // namespace content |
| 34 | 36 |
| 35 #endif // CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ | 37 #endif // CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ |
| OLD | NEW |