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

Side by Side Diff: mojo/tools/package_manager/unpacker.cc

Issue 705703002: Remove mojo/tools/, not needed in chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove gyp Created 6 years, 1 month 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
« no previous file with comments | « mojo/tools/package_manager/unpacker.h ('k') | mojo/tools/pylib/mojo_python_tests_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/tools/package_manager/unpacker.h"
6
7 #include "base/files/file_util.h"
8 #include "base/logging.h"
9 #include "third_party/zlib/google/zip.h"
10
11 namespace mojo {
12
13 Unpacker::Unpacker() {
14 }
15
16 Unpacker::~Unpacker() {
17 if (!dir_.empty())
18 DeleteFile(dir_, true);
19 }
20
21 bool Unpacker::Unpack(const base::FilePath& zip_file) {
22 DCHECK(zip_file_.empty());
23 zip_file_ = zip_file;
24
25 DCHECK(dir_.empty());
26 if (!CreateNewTempDirectory(base::FilePath::StringType(), &dir_))
27 return false;
28 if (!zip::Unzip(zip_file, dir_)) {
29 dir_ = base::FilePath();
30 return false;
31 }
32 return true;
33 }
34
35 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/tools/package_manager/unpacker.h ('k') | mojo/tools/pylib/mojo_python_tests_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698