OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/child/fileapi/webfilewriter_impl.h" | 5 #include "content/child/fileapi/webfilewriter_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "content/child/child_thread.h" | 10 #include "content/child/child_thread.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 StatusCallback status_callback_; | 115 StatusCallback status_callback_; |
116 WriteCallback write_callback_; | 116 WriteCallback write_callback_; |
117 int request_id_; | 117 int request_id_; |
118 int thread_id_; | 118 int thread_id_; |
119 int written_bytes_; | 119 int written_bytes_; |
120 scoped_ptr<base::WaitableEvent> waitable_event_; | 120 scoped_ptr<base::WaitableEvent> waitable_event_; |
121 base::Closure results_closure_; | 121 base::Closure results_closure_; |
122 }; | 122 }; |
123 | 123 |
124 WebFileWriterImpl::WebFileWriterImpl( | 124 WebFileWriterImpl::WebFileWriterImpl( |
125 const GURL& path, WebKit::WebFileWriterClient* client, | 125 const GURL& path, blink::WebFileWriterClient* client, |
126 Type type, | 126 Type type, |
127 base::MessageLoopProxy* main_thread_loop) | 127 base::MessageLoopProxy* main_thread_loop) |
128 : WebFileWriterBase(path, client), | 128 : WebFileWriterBase(path, client), |
129 main_thread_loop_(main_thread_loop), | 129 main_thread_loop_(main_thread_loop), |
130 bridge_(new WriterBridge(type)) { | 130 bridge_(new WriterBridge(type)) { |
131 } | 131 } |
132 | 132 |
133 WebFileWriterImpl::~WebFileWriterImpl() { | 133 WebFileWriterImpl::~WebFileWriterImpl() { |
134 } | 134 } |
135 | 135 |
(...skipping 21 matching lines...) Expand all Loading... |
157 DCHECK(!bridge_->waitable_event()); | 157 DCHECK(!bridge_->waitable_event()); |
158 closure.Run(); | 158 closure.Run(); |
159 return; | 159 return; |
160 } | 160 } |
161 main_thread_loop_->PostTask(FROM_HERE, closure); | 161 main_thread_loop_->PostTask(FROM_HERE, closure); |
162 if (bridge_->waitable_event()) | 162 if (bridge_->waitable_event()) |
163 bridge_->WaitAndRun(); | 163 bridge_->WaitAndRun(); |
164 } | 164 } |
165 | 165 |
166 } // namespace content | 166 } // namespace content |
OLD | NEW |