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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/V8PerContextData.h

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for all comments Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Garbage collected classes that use V8PerContextData to hold an instance 123 // Garbage collected classes that use V8PerContextData to hold an instance
124 // should subclass Data, and use addData / clearData / getData to manage the 124 // should subclass Data, and use addData / clearData / getData to manage the
125 // instance. 125 // instance.
126 class PLATFORM_EXPORT Data : public GarbageCollectedMixin {}; 126 class PLATFORM_EXPORT Data : public GarbageCollectedMixin {};
127 127
128 void AddData(const char* key, Data*); 128 void AddData(const char* key, Data*);
129 void ClearData(const char* key); 129 void ClearData(const char* key);
130 Data* GetData(const char* key); 130 Data* GetData(const char* key);
131 131
132 private: 132 private:
133 // V8SnapshotUtil can access on wrapper_boilerplates_ and constructor_map_.
134 friend class V8SnapshotUtil;
Yuki 2017/06/20 14:20:11 Can you remove this?
peria 2017/06/21 07:19:16 Done.
135
133 V8PerContextData(v8::Local<v8::Context>); 136 V8PerContextData(v8::Local<v8::Context>);
134 137
135 v8::Local<v8::Object> CreateWrapperFromCacheSlowCase(const WrapperTypeInfo*); 138 v8::Local<v8::Object> CreateWrapperFromCacheSlowCase(const WrapperTypeInfo*);
136 v8::Local<v8::Function> ConstructorForTypeSlowCase(const WrapperTypeInfo*); 139 v8::Local<v8::Function> ConstructorForTypeSlowCase(const WrapperTypeInfo*);
137 140
138 v8::Isolate* isolate_; 141 v8::Isolate* isolate_;
139 142
140 // For each possible type of wrapper, we keep a boilerplate object. 143 // For each possible type of wrapper, we keep a boilerplate object.
141 // The boilerplate is used to create additional wrappers of the same type. 144 // The boilerplate is used to create additional wrappers of the same type.
142 typedef V8GlobalValueMap<const WrapperTypeInfo*, v8::Object, v8::kNotWeak> 145 typedef V8GlobalValueMap<const WrapperTypeInfo*, v8::Object, v8::kNotWeak>
(...skipping 18 matching lines...) Expand all
161 // This is owned by a static hash map in V8DOMActivityLogger. 164 // This is owned by a static hash map in V8DOMActivityLogger.
162 V8DOMActivityLogger* activity_logger_; 165 V8DOMActivityLogger* activity_logger_;
163 166
164 using DataMap = PersistentHeapHashMap<const char*, Member<Data>>; 167 using DataMap = PersistentHeapHashMap<const char*, Member<Data>>;
165 DataMap data_map_; 168 DataMap data_map_;
166 }; 169 };
167 170
168 } // namespace blink 171 } // namespace blink
169 172
170 #endif // V8PerContextData_h 173 #endif // V8PerContextData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698