Index: components/nacl/renderer/json_manifest.cc |
diff --git a/components/nacl/renderer/json_manifest.cc b/components/nacl/renderer/json_manifest.cc |
index 951894679760a82f6db2cf8f0afe7de9da57bbce..e2063acd1d6c87a826917db7b7f78845827341cf 100644 |
--- a/components/nacl/renderer/json_manifest.cc |
+++ b/components/nacl/renderer/json_manifest.cc |
@@ -6,6 +6,8 @@ |
#include <set> |
+#include "base/containers/scoped_ptr_hash_map.h" |
+#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/macros.h" |
#include "components/nacl/renderer/nexe_load_manager.h" |
@@ -378,6 +380,21 @@ void GrabUrlAndPnaclOptions(const Json::Value& url_spec, |
} // namespace |
+typedef base::ScopedPtrHashMap<PP_Instance, nacl::JsonManifest> JsonManifestMap; |
+base::LazyInstance<JsonManifestMap> g_manifest_map = LAZY_INSTANCE_INITIALIZER; |
+ |
+void AddJsonManifest(PP_Instance instance, scoped_ptr<JsonManifest> manifest) { |
+ g_manifest_map.Get().add(instance, manifest.Pass()); |
+} |
+ |
+JsonManifest* GetJsonManifest(PP_Instance instance) { |
+ return g_manifest_map.Get().get(instance); |
+} |
+ |
+void DeleteJsonManifest(PP_Instance instance) { |
+ g_manifest_map.Get().erase(instance); |
+} |
+ |
JsonManifest::JsonManifest(const std::string& manifest_base_url, |
const std::string& sandbox_isa, |
bool nonsfi_enabled, |