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

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

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for comments Created 3 years, 5 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!V8CallBoolean(prototype_object->SetPrototype( 152 if (!V8CallBoolean(prototype_object->SetPrototype(
153 current_context, error_prototype_.NewLocal(isolate_)))) { 153 current_context, error_prototype_.NewLocal(isolate_)))) {
154 return v8::Local<v8::Function>(); 154 return v8::Local<v8::Function>();
155 } 155 }
156 } 156 }
157 } 157 }
158 158
159 // Origin Trials 159 // Origin Trials
160 InstallConditionalFeatures(type, ScriptState::From(current_context), 160 InstallConditionalFeatures(type, ScriptState::From(current_context),
161 prototype_object, interface_object); 161 prototype_object, interface_object);
162
163 constructor_map_.Set(type, interface_object); 162 constructor_map_.Set(type, interface_object);
164
165 return interface_object; 163 return interface_object;
166 } 164 }
167 165
168 v8::Local<v8::Object> V8PerContextData::PrototypeForType( 166 v8::Local<v8::Object> V8PerContextData::PrototypeForType(
169 const WrapperTypeInfo* type) { 167 const WrapperTypeInfo* type) {
170 v8::Local<v8::Object> constructor = ConstructorForType(type); 168 v8::Local<v8::Object> constructor = ConstructorForType(type);
171 if (constructor.IsEmpty()) 169 if (constructor.IsEmpty())
172 return v8::Local<v8::Object>(); 170 return v8::Local<v8::Object>();
173 v8::Local<v8::Value> prototype_value; 171 v8::Local<v8::Value> prototype_value;
174 if (!constructor->Get(GetContext(), V8String(isolate_, "prototype")) 172 if (!constructor->Get(GetContext(), V8String(isolate_, "prototype"))
(...skipping 28 matching lines...) Expand all
203 201
204 void V8PerContextData::ClearData(const char* key) { 202 void V8PerContextData::ClearData(const char* key) {
205 data_map_.erase(key); 203 data_map_.erase(key);
206 } 204 }
207 205
208 V8PerContextData::Data* V8PerContextData::GetData(const char* key) { 206 V8PerContextData::Data* V8PerContextData::GetData(const char* key) {
209 return data_map_.at(key); 207 return data_map_.at(key);
210 } 208 }
211 209
212 } // namespace blink 210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698