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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp

Issue 125043004: Remove world type from hasInstance() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return result->value.newLocal(isolate); 159 return result->value.newLocal(isolate);
160 160
161 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 161 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
162 v8::EscapableHandleScope handleScope(isolate); 162 v8::EscapableHandleScope handleScope(isolate);
163 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode); 163 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode);
164 configureV8TestInterfaceNamedConstructorTemplate(templ, isolate, currentWorl dType); 164 configureV8TestInterfaceNamedConstructorTemplate(templ, isolate, currentWorl dType);
165 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ)); 165 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ));
166 return handleScope.Escape(templ); 166 return handleScope.Escape(templ);
167 } 167 }
168 168
169 bool V8TestInterfaceNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType) 169 bool V8TestInterfaceNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
170 { 170 {
171 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, currentWorldType); 171 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI nfo, jsValue)
172 } 172 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy peInfo, jsValue);
173
174 bool V8TestInterfaceNamedConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value > jsValue, v8::Isolate* isolate)
175 {
176 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, MainWorld)
177 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, IsolatedWorld)
178 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, WorkerWorld);
179 } 173 }
180 174
181 ActiveDOMObject* V8TestInterfaceNamedConstructor::toActiveDOMObject(v8::Handle<v 8::Object> wrapper) 175 ActiveDOMObject* V8TestInterfaceNamedConstructor::toActiveDOMObject(v8::Handle<v 8::Object> wrapper)
182 { 176 {
183 return toNative(wrapper); 177 return toNative(wrapper);
184 } 178 }
185 179
186 v8::Handle<v8::Object> V8TestInterfaceNamedConstructor::createWrapper(PassRefPtr <TestInterfaceNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8 ::Isolate* isolate) 180 v8::Handle<v8::Object> V8TestInterfaceNamedConstructor::createWrapper(PassRefPtr <TestInterfaceNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8 ::Isolate* isolate)
187 { 181 {
188 ASSERT(impl); 182 ASSERT(impl);
(...skipping 19 matching lines...) Expand all
208 fromInternalPointer(object)->deref(); 202 fromInternalPointer(object)->deref();
209 } 203 }
210 204
211 template<> 205 template<>
212 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 206 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
213 { 207 {
214 return toV8(impl, creationContext, isolate); 208 return toV8(impl, creationContext, isolate);
215 } 209 }
216 210
217 } // namespace WebCore 211 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698