| Index: chrome/browser/extensions/pending_extension_manager.h
|
| diff --git a/chrome/browser/extensions/pending_extension_manager.h b/chrome/browser/extensions/pending_extension_manager.h
|
| index 8668892fc2d456933280823fd48685f7f5f8d772..6812f4ed1f469b41ad6f45d09dc987783908a461 100644
|
| --- a/chrome/browser/extensions/pending_extension_manager.h
|
| +++ b/chrome/browser/extensions/pending_extension_manager.h
|
| @@ -6,8 +6,9 @@
|
| #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
|
| #pragma once
|
|
|
| -#include <map>
|
| +#include <list>
|
| #include <string>
|
| +#include <utility>
|
|
|
| #include "chrome/browser/extensions/pending_extension_info.h"
|
| #include "chrome/common/extensions/extension.h"
|
| @@ -43,14 +44,13 @@ class PendingExtensionManager {
|
| // TODO(skerner): Many of these methods can be private once code in
|
| // ExtensionService is moved into methods of this class.
|
|
|
| - // Remove |id| from the set of pending extensions.
|
| - void Remove(const std::string& id);
|
| + // Remove extension with id |id| from the set of pending extensions. Returns
|
| + // true if such an extension was found and removed, false otherwise.
|
| + bool Remove(const std::string& id);
|
|
|
| - // Get the information for a pending extension. Returns true and sets
|
| - // |out_pending_extension_info| if there is a pending extension with id
|
| - // |id|. Returns false otherwise.
|
| - bool GetById(const std::string& id,
|
| - PendingExtensionInfo* out_pending_extension_info) const;
|
| + // Get the information for a pending extension. Returns a pointer to the
|
| + // pending extension with id |id|, or NULL if there is no such extension.
|
| + const PendingExtensionInfo* GetById(const std::string& id) const;
|
|
|
| // Is |id| in the set of pending extensions?
|
| bool IsIdPending(const std::string& id) const;
|
| @@ -84,14 +84,14 @@ class PendingExtensionManager {
|
| extensions::Extension::Location location,
|
| const Version& version);
|
|
|
| - // Get the set of pending IDs that should be installed from an update URL.
|
| + // Get the list of pending IDs that should be installed from an update URL.
|
| // Pending extensions that will be installed from local files will not be
|
| // included in the set.
|
| void GetPendingIdsForUpdateCheck(
|
| - std::set<std::string>* out_ids_for_update_check) const;
|
| + std::list<std::string>* out_ids_for_update_check) const;
|
|
|
| private:
|
| - typedef std::map<std::string, PendingExtensionInfo> PendingExtensionMap;
|
| + typedef std::list<PendingExtensionInfo> PendingExtensionList;
|
|
|
| // Assumes an extension with id |id| is not already installed.
|
| // Return true if the extension was added.
|
| @@ -107,8 +107,7 @@ class PendingExtensionManager {
|
| // Add a pending extension record directly. Used for unit tests that need
|
| // to set an inital state. Use friendship to allow the tests to call this
|
| // method.
|
| - void AddForTesting(const std::string& id,
|
| - const PendingExtensionInfo& pending_etension_info);
|
| + void AddForTesting(const PendingExtensionInfo& pending_extension_info);
|
|
|
| // Reference to the extension service whose pending extensions this class is
|
| // managing. Because this class is a member of |service_|, it is created
|
| @@ -116,8 +115,7 @@ class PendingExtensionManager {
|
| // ExtensionServiceInterface.
|
| const ExtensionServiceInterface& service_;
|
|
|
| - // A map from extension id to the pending extension info for that extension.
|
| - PendingExtensionMap pending_extension_map_;
|
| + PendingExtensionList pending_extension_list_;
|
|
|
| FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
|
| UpdatePendingExtensionAlreadyInstalled);
|
|
|