OLD | NEW |
---|---|
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 if (type->parent_class) { | 120 if (type->parent_class) { |
121 v8::Local<v8::Object> prototype_template = | 121 v8::Local<v8::Object> prototype_template = |
122 ConstructorForType(type->parent_class); | 122 ConstructorForType(type->parent_class); |
123 if (prototype_template.IsEmpty()) | 123 if (prototype_template.IsEmpty()) |
124 return v8::Local<v8::Function>(); | 124 return v8::Local<v8::Function>(); |
125 if (!V8CallBoolean(interface_object->SetPrototype(current_context, | 125 if (!V8CallBoolean(interface_object->SetPrototype(current_context, |
126 prototype_template))) | 126 prototype_template))) |
127 return v8::Local<v8::Function>(); | 127 return v8::Local<v8::Function>(); |
128 } | 128 } |
129 | 129 |
130 if (type->wrapper_type_prototype == | |
131 WrapperTypeInfo::kWrapperTypeNoPrototype) { | |
132 constructor_map_.Set(type, interface_object); | |
133 return interface_object; | |
Yuki
2017/04/27 12:18:28
nit: Ideally, we shouldn't skip InstallConditional
tkent
2017/04/28 06:13:36
Done.
| |
134 } | |
135 | |
130 v8::Local<v8::Value> prototype_value; | 136 v8::Local<v8::Value> prototype_value; |
131 if (!interface_object | 137 if (!interface_object |
132 ->Get(current_context, V8AtomicString(isolate_, "prototype")) | 138 ->Get(current_context, V8AtomicString(isolate_, "prototype")) |
133 .ToLocal(&prototype_value) || | 139 .ToLocal(&prototype_value) || |
134 !prototype_value->IsObject()) | 140 !prototype_value->IsObject()) |
135 return v8::Local<v8::Function>(); | 141 return v8::Local<v8::Function>(); |
136 v8::Local<v8::Object> prototype_object = prototype_value.As<v8::Object>(); | 142 v8::Local<v8::Object> prototype_object = prototype_value.As<v8::Object>(); |
137 if (prototype_object->InternalFieldCount() == | 143 if (prototype_object->InternalFieldCount() == |
138 kV8PrototypeInternalFieldcount && | 144 kV8PrototypeInternalFieldcount && |
139 type->wrapper_type_prototype == | 145 type->wrapper_type_prototype == |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 | 203 |
198 void V8PerContextData::ClearData(const char* key) { | 204 void V8PerContextData::ClearData(const char* key) { |
199 data_map_.erase(key); | 205 data_map_.erase(key); |
200 } | 206 } |
201 | 207 |
202 V8PerContextData::Data* V8PerContextData::GetData(const char* key) { | 208 V8PerContextData::Data* V8PerContextData::GetData(const char* key) { |
203 return data_map_.at(key); | 209 return data_map_.at(key); |
204 } | 210 } |
205 | 211 |
206 } // namespace blink | 212 } // namespace blink |
OLD | NEW |