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 { | 11 namespace { |
11 | 12 |
12 inline FileSystemDispatcher* GetFileSystemDispatcher() { | 13 inline FileSystemDispatcher* GetFileSystemDispatcher() { |
13 return ChildThread::current()->file_system_dispatcher(); | 14 return ChildThread::current()->file_system_dispatcher(); |
14 } | 15 } |
15 } | 16 } |
16 | 17 |
17 class WebFileWriterImpl::CallbackDispatcher | 18 class WebFileWriterImpl::CallbackDispatcher |
18 : public fileapi::FileSystemCallbackDispatcher { | 19 : public fileapi::FileSystemCallbackDispatcher { |
19 public: | 20 public: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const GURL& path, const GURL& blob_url, int64 offset) { | 72 const GURL& path, const GURL& blob_url, int64 offset) { |
72 GetFileSystemDispatcher()->Write( | 73 GetFileSystemDispatcher()->Write( |
73 path, blob_url, offset, &request_id_, | 74 path, blob_url, offset, &request_id_, |
74 new CallbackDispatcher(AsWeakPtr())); | 75 new CallbackDispatcher(AsWeakPtr())); |
75 } | 76 } |
76 | 77 |
77 void WebFileWriterImpl::DoCancel() { | 78 void WebFileWriterImpl::DoCancel() { |
78 GetFileSystemDispatcher()->Cancel(request_id_, | 79 GetFileSystemDispatcher()->Cancel(request_id_, |
79 new CallbackDispatcher(AsWeakPtr())); | 80 new CallbackDispatcher(AsWeakPtr())); |
80 } | 81 } |
| 82 |
| 83 } // namespace content |
OLD | NEW |