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

Side by Side Diff: extensions/renderer/v8_schema_registry.h

Issue 1085733006: replace to be deprecated v8::PersistentValueMap with v8::GlobalValueMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/plugin_object.h ('k') | gin/interceptor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_ 5 #ifndef EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_
6 #define EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_ 6 #define EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 22 matching lines...) Expand all
33 33
34 // Returns a v8::Object for the schema for |api|, possibly from the cache. 34 // Returns a v8::Object for the schema for |api|, possibly from the cache.
35 v8::Handle<v8::Object> GetSchema(const std::string& api); 35 v8::Handle<v8::Object> GetSchema(const std::string& api);
36 36
37 private: 37 private:
38 // Gets the separate context that backs the registry, creating a new one if 38 // Gets the separate context that backs the registry, creating a new one if
39 // if necessary. Will also initialize schema_cache_. 39 // if necessary. Will also initialize schema_cache_.
40 v8::Handle<v8::Context> GetOrCreateContext(v8::Isolate* isolate); 40 v8::Handle<v8::Context> GetOrCreateContext(v8::Isolate* isolate);
41 41
42 // Cache of schemas. Created lazily by GetOrCreateContext. 42 // Cache of schemas. Created lazily by GetOrCreateContext.
43 typedef v8::StdPersistentValueMap<std::string, v8::Object> SchemaCache; 43 typedef v8::StdGlobalValueMap<std::string, v8::Object> SchemaCache;
44 scoped_ptr<SchemaCache> schema_cache_; 44 scoped_ptr<SchemaCache> schema_cache_;
45 45
46 // Single per-instance gin::ContextHolder to create v8::Values. 46 // Single per-instance gin::ContextHolder to create v8::Values.
47 // Created lazily via GetOrCreateContext. 47 // Created lazily via GetOrCreateContext.
48 scoped_ptr<gin::ContextHolder> context_holder_; 48 scoped_ptr<gin::ContextHolder> context_holder_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(V8SchemaRegistry); 50 DISALLOW_COPY_AND_ASSIGN(V8SchemaRegistry);
51 }; 51 };
52 52
53 } // namespace extensions 53 } // namespace extensions
54 54
55 #endif // EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_ 55 #endif // EXTENSIONS_RENDERER_V8_SCHEMA_REGISTRY_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/plugin_object.h ('k') | gin/interceptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698