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

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: rebased Created 6 years, 6 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
« no previous file with comments | « components/nacl/renderer/json_manifest.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « components/nacl/renderer/json_manifest.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698