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

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

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Rebase Created 3 years, 4 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type)); 129 kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type));
130 } 130 }
131 type->PreparePrototypeAndInterfaceObject(current_context, world, 131 type->PreparePrototypeAndInterfaceObject(current_context, world,
132 prototype_object, interface_object, 132 prototype_object, interface_object,
133 interface_template); 133 interface_template);
134 } 134 }
135 135
136 // Origin Trials 136 // Origin Trials
137 InstallConditionalFeatures(type, ScriptState::From(current_context), 137 InstallConditionalFeatures(type, ScriptState::From(current_context),
138 prototype_object, interface_object); 138 prototype_object, interface_object);
139
140 constructor_map_.Set(type, interface_object); 139 constructor_map_.Set(type, interface_object);
141
142 return interface_object; 140 return interface_object;
143 } 141 }
144 142
145 v8::Local<v8::Object> V8PerContextData::PrototypeForType( 143 v8::Local<v8::Object> V8PerContextData::PrototypeForType(
146 const WrapperTypeInfo* type) { 144 const WrapperTypeInfo* type) {
147 v8::Local<v8::Object> constructor = ConstructorForType(type); 145 v8::Local<v8::Object> constructor = ConstructorForType(type);
148 if (constructor.IsEmpty()) 146 if (constructor.IsEmpty())
149 return v8::Local<v8::Object>(); 147 return v8::Local<v8::Object>();
150 v8::Local<v8::Value> prototype_value; 148 v8::Local<v8::Value> prototype_value;
151 if (!constructor->Get(GetContext(), V8String(isolate_, "prototype")) 149 if (!constructor->Get(GetContext(), V8String(isolate_, "prototype"))
(...skipping 28 matching lines...) Expand all
180 178
181 void V8PerContextData::ClearData(const char* key) { 179 void V8PerContextData::ClearData(const char* key) {
182 data_map_.erase(key); 180 data_map_.erase(key);
183 } 181 }
184 182
185 V8PerContextData::Data* V8PerContextData::GetData(const char* key) { 183 V8PerContextData::Data* V8PerContextData::GetData(const char* key) {
186 return data_map_.at(key); 184 return data_map_.at(key);
187 } 185 }
188 186
189 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698