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

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

Issue 596913002: Add mojo package manager skeleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years, 3 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
« no previous file with comments | « mojo/tools/package_manager/unpacker.h ('k') | no next file » | 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 printf("Deleting %s\n", dir_.value().c_str());
19 //DeleteFile(dir_, true);
20 }
21 }
22
23 bool Unpacker::Unpack(const base::FilePath& zip_file) {
24 DCHECK(zip_file_.empty());
25 zip_file_ = zip_file;
26
27 DCHECK(dir_.empty());
28 if (!CreateNewTempDirectory(base::FilePath::StringType(), &dir_))
29 return false;
30 if (!zip::Unzip(zip_file, dir_)) {
31 dir_ = base::FilePath();
32 return false;
33 }
34 return true;
35 }
36
37 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/tools/package_manager/unpacker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698