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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfacePython2.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return result->value.newLocal(isolate); 111 return result->value.newLocal(isolate);
112 112
113 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 113 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
114 v8::EscapableHandleScope handleScope(isolate); 114 v8::EscapableHandleScope handleScope(isolate);
115 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode); 115 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode);
116 configureV8TestInterfacePython2Template(templ, isolate, currentWorldType); 116 configureV8TestInterfacePython2Template(templ, isolate, currentWorldType);
117 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ)); 117 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ));
118 return handleScope.Escape(templ); 118 return handleScope.Escape(templ);
119 } 119 }
120 120
121 bool V8TestInterfacePython2::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isol ate* isolate, WrapperWorldType currentWorldType) 121 bool V8TestInterfacePython2::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isol ate* isolate)
122 { 122 {
123 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, currentWorldType); 123 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI nfo, jsValue)
124 } 124 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy peInfo, jsValue);
125
126 bool V8TestInterfacePython2::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue , v8::Isolate* isolate)
127 {
128 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, MainWorld)
129 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, IsolatedWorld)
130 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, WorkerWorld);
131 } 125 }
132 126
133 v8::Handle<v8::Object> wrap(TestInterfacePython2* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 127 v8::Handle<v8::Object> wrap(TestInterfacePython2* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
134 { 128 {
135 ASSERT(impl); 129 ASSERT(impl);
136 if (impl->isInterface1()) 130 if (impl->isInterface1())
137 return wrap(toInterface1(impl), creationContext, isolate); 131 return wrap(toInterface1(impl), creationContext, isolate);
138 if (impl->isInterface2()) 132 if (impl->isInterface2())
139 return wrap(toInterface2(impl), creationContext, isolate); 133 return wrap(toInterface2(impl), creationContext, isolate);
140 v8::Handle<v8::Object> wrapper = V8TestInterfacePython2::createWrapper(impl, creationContext, isolate); 134 v8::Handle<v8::Object> wrapper = V8TestInterfacePython2::createWrapper(impl, creationContext, isolate);
(...skipping 25 matching lines...) Expand all
166 fromInternalPointer(object)->deref(); 160 fromInternalPointer(object)->deref();
167 } 161 }
168 162
169 template<> 163 template<>
170 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate) 164 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
171 { 165 {
172 return toV8(impl, creationContext, isolate); 166 return toV8(impl, creationContext, isolate);
173 } 167 }
174 168
175 } // namespace WebCore 169 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfacePython2.h ('k') | Source/bindings/tests/results/V8TestInterfacePython3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698