Remove unneeded ArchiveFactory.
This commit is contained in:
parent
390b804ca0
commit
c49a44f944
6 changed files with 22 additions and 64 deletions
|
@ -5,7 +5,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "atom/common/asar/archive.h"
|
||||
#include "atom/common/asar/archive_factory.h"
|
||||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||
#include "native_mate/arguments.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/common/asar/archive_factory.h"
|
||||
|
||||
#include "atom/common/asar/archive.h"
|
||||
|
||||
namespace asar {
|
||||
|
||||
ArchiveFactory::ArchiveFactory() {}
|
||||
|
||||
ArchiveFactory::~ArchiveFactory() {}
|
||||
|
||||
Archive* ArchiveFactory::GetOrCreate(const base::FilePath& path) {
|
||||
if (!archives_.contains(path)) {
|
||||
scoped_ptr<Archive> archive(new Archive(path));
|
||||
if (!archive->Init())
|
||||
return nullptr;
|
||||
|
||||
archives_.set(path, archive.Pass());
|
||||
}
|
||||
|
||||
return archives_.get(path);
|
||||
}
|
||||
|
||||
} // namespace asar
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_COMMON_ASAR_ARCHIVE_FACTORY_H_
|
||||
#define ATOM_COMMON_ASAR_ARCHIVE_FACTORY_H_
|
||||
|
||||
#include "base/containers/scoped_ptr_hash_map.h"
|
||||
#include "base/files/file_path.h"
|
||||
|
||||
namespace asar {
|
||||
|
||||
class Archive;
|
||||
|
||||
class ArchiveFactory {
|
||||
public:
|
||||
ArchiveFactory();
|
||||
virtual ~ArchiveFactory();
|
||||
|
||||
Archive* GetOrCreate(const base::FilePath& path);
|
||||
|
||||
private:
|
||||
base::ScopedPtrHashMap<base::FilePath, Archive> archives_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ArchiveFactory);
|
||||
};
|
||||
|
||||
} // namespace asar
|
||||
|
||||
#endif // ATOM_COMMON_ASAR_ARCHIVE_FACTORY_H_
|
Loading…
Add table
Add a link
Reference in a new issue