Chromium Code Reviews| Index: src/api.h |
| diff --git a/src/api.h b/src/api.h |
| index f41c96ede8bf9e15dc0814a72d0b9551e0afbb73..b0d32b3cf12696e1668b1b60a747436001498eb7 100644 |
| --- a/src/api.h |
| +++ b/src/api.h |
| @@ -30,6 +30,7 @@ |
| #include "apiutils.h" |
| #include "factory.h" |
| +#include "hashmap.h" |
| #include "../include/v8-testing.h" |
| @@ -137,10 +138,6 @@ class ApiFunction { |
| }; |
| -enum ExtensionTraversalState { |
| - UNVISITED, VISITED, INSTALLED |
| -}; |
| - |
| class RegisteredExtension { |
| public: |
| @@ -149,18 +146,30 @@ class RegisteredExtension { |
| Extension* extension() { return extension_; } |
| RegisteredExtension* next() { return next_; } |
| RegisteredExtension* next_auto() { return next_auto_; } |
| - ExtensionTraversalState state() { return state_; } |
| - void set_state(ExtensionTraversalState value) { state_ = value; } |
| static RegisteredExtension* first_extension() { return first_extension_; } |
| private: |
| Extension* extension_; |
| RegisteredExtension* next_; |
| RegisteredExtension* next_auto_; |
| - ExtensionTraversalState state_; |
| static RegisteredExtension* first_extension_; |
| }; |
| +namespace internal { |
| +enum ExtensionTraversalState { |
| + UNVISITED, VISITED, INSTALLED |
| +}; |
| + |
| + |
| +class ExtensionStates : private HashMap { |
|
Vitaly Repeshko
2011/11/15 18:14:17
Use delegation instead of implementation inheritan
|
| + public: |
| + ExtensionStates(); |
| + ExtensionTraversalState get_state(RegisteredExtension* extension); |
| + void set_state(RegisteredExtension* extension, ExtensionTraversalState state); |
| +}; |
| +} |
|
Vitaly Repeshko
2011/11/15 18:14:17
nit: // namespace internal
|
| + |
| + |
| class Utils { |
| public: |
| static bool ReportApiFailure(const char* location, const char* message); |