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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
7 #include "base/threading/worker_pool.h" | 7 #include "base/threading/worker_pool.h" |
8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
9 #include "chrome/browser/extensions/api/image_writer_private/operation.h" | 9 #include "chrome/browser/extensions/api/image_writer_private/operation.h" |
10 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h " | 10 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h " |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 success = false; | 131 success = false; |
132 } | 132 } |
133 return success; | 133 return success; |
134 } | 134 } |
135 | 135 |
136 void Operation::WriteComplete() { | 136 void Operation::WriteComplete() { |
137 | 137 |
138 DVLOG(2) << "Completed write of " << image_path_.value(); | 138 DVLOG(2) << "Completed write of " << image_path_.value(); |
139 SetProgress(kProgressComplete); | 139 SetProgress(kProgressComplete); |
140 | 140 |
141 BrowserThread::PostTask( | 141 if (verify_write_) { |
142 BrowserThread::FILE, | 142 BrowserThread::PostTask( |
143 FROM_HERE, | 143 BrowserThread::FILE, |
tbarzic
2013/12/14 01:01:04
indent+=2
Drew Haven
2013/12/16 20:15:33
Done.
| |
144 base::Bind(&Operation::VerifyWriteStart, | 144 FROM_HERE, |
145 this)); | 145 base::Bind(&Operation::VerifyWriteStart, |
146 this)); | |
tbarzic
2013/12/14 01:01:04
can't this fit in the previous line?
Drew Haven
2013/12/16 20:15:33
Yep, oops. Hold-over from a longer set of argumen
| |
147 } else { | |
148 BrowserThread::PostTask( | |
149 BrowserThread::FILE, | |
150 FROM_HERE, | |
151 base::Bind(&Operation::Finish, | |
152 this)); | |
153 } | |
146 } | 154 } |
147 | 155 |
148 void Operation::VerifyWriteStart() { | 156 void Operation::VerifyWriteStart() { |
149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
150 if (IsCancelled()) { | 158 if (IsCancelled()) { |
151 return; | 159 return; |
152 } | 160 } |
153 | 161 |
154 DVLOG(1) << "Starting verification stage."; | 162 DVLOG(1) << "Starting verification stage."; |
155 | 163 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 | 208 |
201 DVLOG(2) << "Completed write verification of " << image_path_.value(); | 209 DVLOG(2) << "Completed write verification of " << image_path_.value(); |
202 | 210 |
203 SetProgress(kProgressComplete); | 211 SetProgress(kProgressComplete); |
204 | 212 |
205 Finish(); | 213 Finish(); |
206 } | 214 } |
207 | 215 |
208 } // namespace image_writer | 216 } // namespace image_writer |
209 } // namespace extensions | 217 } // namespace extensions |
OLD | NEW |