Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: components/nacl/renderer/json_manifest.cc

Issue 310113002: Pepper: Move JsonManifestMap to json_manifest.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/nacl/renderer/json_manifest.cc
diff --git a/components/nacl/renderer/json_manifest.cc b/components/nacl/renderer/json_manifest.cc
index 8459f1ff37c2d58ec5e30d836b73c61c774284b8..69e1aff78413d93338e0f8c8689a3b321622679e 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,

Powered by Google App Engine
This is Rietveld 408576698