Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation_linux.cc

Issue 179963002: New Zip::ZipFromMemory API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "third_party/zlib/google/zip.h"
13 12
14 namespace extensions { 13 namespace extensions {
15 namespace image_writer { 14 namespace image_writer {
16 15
17 using content::BrowserThread; 16 using content::BrowserThread;
18 17
19 const int kBurningBlockSize = 8 * 1024; // 8 KiB 18 const int kBurningBlockSize = 8 * 1024; // 8 KiB
20 19
21 void Operation::Write(const base::Closure& continuation) { 20 void Operation::Write(const base::Closure& continuation) {
22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 base::ClosePlatformFile(device_file_); 185 base::ClosePlatformFile(device_file_);
187 } 186 }
188 187
189 void Operation::VerifyWriteComplete(const base::Closure& continuation) { 188 void Operation::VerifyWriteComplete(const base::Closure& continuation) {
190 SetProgress(kProgressComplete); 189 SetProgress(kProgressComplete);
191 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, continuation); 190 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, continuation);
192 } 191 }
193 192
194 } // namespace image_writer 193 } // namespace image_writer
195 } // namespace extensions 194 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698