| Index: chrome/browser/component_updater/component_unpacker.cc
|
| diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc
|
| index d47bce829a048ff323c66ac0f61170f67720468a..613ec7f839cf658671ef431e1950ac184b400d23 100644
|
| --- a/chrome/browser/component_updater/component_unpacker.cc
|
| +++ b/chrome/browser/component_updater/component_unpacker.cc
|
| @@ -8,10 +8,10 @@
|
| #include <vector>
|
|
|
| #include "base/file_util.h"
|
| -#include "base/json/json_file_value_serializer.h"
|
| #include "base/memory/scoped_handle.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| +#include "base/values.h"
|
| #include "chrome/browser/component_updater/component_patcher.h"
|
| #include "chrome/browser/component_updater/component_updater_service.h"
|
| #include "chrome/common/extensions/extension_constants.h"
|
| @@ -85,25 +85,6 @@ class CRXValidator {
|
| std::vector<uint8> public_key_;
|
| };
|
|
|
| -// Deserialize the CRX manifest. The top level must be a dictionary.
|
| -// TODO(cpu): add a specific attribute check to a component json that the
|
| -// extension unpacker will reject, so that a component cannot be installed
|
| -// as an extension.
|
| -base::DictionaryValue* ReadManifest(const base::FilePath& unpack_path) {
|
| - base::FilePath manifest =
|
| - unpack_path.Append(FILE_PATH_LITERAL("manifest.json"));
|
| - if (!base::PathExists(manifest))
|
| - return NULL;
|
| - JSONFileValueSerializer serializer(manifest);
|
| - std::string error;
|
| - scoped_ptr<base::Value> root(serializer.Deserialize(NULL, &error));
|
| - if (!root.get())
|
| - return NULL;
|
| - if (!root->IsType(base::Value::TYPE_DICTIONARY))
|
| - return NULL;
|
| - return static_cast<base::DictionaryValue*>(root.release());
|
| -}
|
| -
|
| } // namespace.
|
|
|
| ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash,
|
| @@ -179,7 +160,8 @@ ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash,
|
| return;
|
| }
|
| }
|
| - scoped_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_));
|
| + scoped_ptr<base::DictionaryValue> manifest(
|
| + ReadComponentManifest(unpack_path_));
|
| if (!manifest.get()) {
|
| error_ = kBadManifest;
|
| return;
|
|
|