| 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 #include "content/common/fileapi/webfilewriter_impl.h" | 5 #include "content/common/fileapi/webfilewriter_impl.h" |
| 6 | 6 |
| 7 #include "content/common/child_thread.h" | 7 #include "content/common/child_thread.h" |
| 8 #include "content/common/fileapi/file_system_dispatcher.h" | 8 #include "content/common/fileapi/file_system_dispatcher.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 inline FileSystemDispatcher* GetFileSystemDispatcher() { | 13 inline FileSystemDispatcher* GetFileSystemDispatcher() { |
| 14 return ChildThread::current()->file_system_dispatcher(); | 14 return ChildThread::current()->file_system_dispatcher(); |
| 15 } | 15 } |
| 16 } | 16 } |
| 17 | 17 |
| 18 class WebFileWriterImpl::CallbackDispatcher | 18 class WebFileWriterImpl::CallbackDispatcher |
| 19 : public fileapi::FileSystemCallbackDispatcher { | 19 : public fileapi::FileSystemCallbackDispatcher { |
| 20 public: | 20 public: |
| 21 explicit CallbackDispatcher( | 21 explicit CallbackDispatcher( |
| 22 const base::WeakPtr<WebFileWriterImpl>& writer) : writer_(writer) { | 22 const base::WeakPtr<WebFileWriterImpl>& writer) : writer_(writer) { |
| 23 } | 23 } |
| 24 virtual ~CallbackDispatcher() { | 24 virtual ~CallbackDispatcher() { |
| 25 } | 25 } |
| 26 | 26 virtual void DidReadMetadata( |
| 27 virtual void DidReadMetadata(const base::PlatformFileInfo&, const FilePath&) { | 27 const base::PlatformFileInfo&, const FilePath&) { |
| 28 NOTREACHED(); |
| 29 } |
| 30 virtual void DidCreateSnapshotFile( |
| 31 const base::PlatformFileInfo&, const FilePath&) { |
| 28 NOTREACHED(); | 32 NOTREACHED(); |
| 29 } | 33 } |
| 30 virtual void DidReadDirectory( | 34 virtual void DidReadDirectory( |
| 31 const std::vector<base::FileUtilProxy::Entry>& entries, | 35 const std::vector<base::FileUtilProxy::Entry>& entries, |
| 32 bool has_more) { | 36 bool has_more) { |
| 33 NOTREACHED(); | 37 NOTREACHED(); |
| 34 } | 38 } |
| 35 virtual void DidOpenFileSystem(const std::string& name, | 39 virtual void DidOpenFileSystem(const std::string& name, |
| 36 const GURL& root) { | 40 const GURL& root) { |
| 37 NOTREACHED(); | 41 NOTREACHED(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 path, blob_url, offset, &request_id_, | 78 path, blob_url, offset, &request_id_, |
| 75 new CallbackDispatcher(AsWeakPtr())); | 79 new CallbackDispatcher(AsWeakPtr())); |
| 76 } | 80 } |
| 77 | 81 |
| 78 void WebFileWriterImpl::DoCancel() { | 82 void WebFileWriterImpl::DoCancel() { |
| 79 GetFileSystemDispatcher()->Cancel(request_id_, | 83 GetFileSystemDispatcher()->Cancel(request_id_, |
| 80 new CallbackDispatcher(AsWeakPtr())); | 84 new CallbackDispatcher(AsWeakPtr())); |
| 81 } | 85 } |
| 82 | 86 |
| 83 } // namespace content | 87 } // namespace content |
| OLD | NEW |