OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 v8::Local<v8::Object> shadow = V8ScriptRunner::instantiateObject(isolate, sh
adowConstructor); | 64 v8::Local<v8::Object> shadow = V8ScriptRunner::instantiateObject(isolate, sh
adowConstructor); |
65 if (shadow.IsEmpty()) | 65 if (shadow.IsEmpty()) |
66 return v8::Local<v8::Object>(); | 66 return v8::Local<v8::Object>(); |
67 if (!v8CallBoolean(shadow->SetPrototype(isolate->GetCurrentContext(), wrappe
r))) | 67 if (!v8CallBoolean(shadow->SetPrototype(isolate->GetCurrentContext(), wrappe
r))) |
68 return v8::Local<v8::Object>(); | 68 return v8::Local<v8::Object>(); |
69 V8DOMWrapper::setNativeInfo(wrapper, &V8HTMLDocument::wrapperTypeInfo, scrip
tWrappable); | 69 V8DOMWrapper::setNativeInfo(wrapper, &V8HTMLDocument::wrapperTypeInfo, scrip
tWrappable); |
70 return shadow; | 70 return shadow; |
71 } | 71 } |
72 | 72 |
73 v8::Local<v8::Object> V8DOMWrapper::createWrapper(v8::Isolate* isolate, v8::Hand
le<v8::Object> creationContext, const WrapperTypeInfo* type, ScriptWrappable* sc
riptWrappable) | 73 v8::Local<v8::Object> V8DOMWrapper::createWrapper(v8::Isolate* isolate, v8::Loca
l<v8::Object> creationContext, const WrapperTypeInfo* type, ScriptWrappable* scr
iptWrappable) |
74 { | 74 { |
75 V8WrapperInstantiationScope scope(creationContext, isolate); | 75 V8WrapperInstantiationScope scope(creationContext, isolate); |
76 | 76 |
77 V8PerContextData* perContextData = V8PerContextData::from(scope.context()); | 77 V8PerContextData* perContextData = V8PerContextData::from(scope.context()); |
78 v8::Local<v8::Object> wrapper = perContextData ? perContextData->createWrapp
erFromCache(type) : V8ObjectConstructor::newInstance(isolate, type->domTemplate(
isolate)->GetFunction()); | 78 v8::Local<v8::Object> wrapper = perContextData ? perContextData->createWrapp
erFromCache(type) : V8ObjectConstructor::newInstance(isolate, type->domTemplate(
isolate)->GetFunction()); |
79 | 79 |
80 if (type == &V8HTMLDocument::wrapperTypeInfo && !wrapper.IsEmpty()) | 80 if (type == &V8HTMLDocument::wrapperTypeInfo && !wrapper.IsEmpty()) |
81 wrapper = wrapInShadowTemplate(wrapper, scriptWrappable, isolate); | 81 wrapper = wrapInShadowTemplate(wrapper, scriptWrappable, isolate); |
82 | 82 |
83 return wrapper; | 83 return wrapper; |
(...skipping 25 matching lines...) Expand all Loading... |
109 return false; | 109 return false; |
110 | 110 |
111 const ScriptWrappable* untrustedScriptWrappable = toScriptWrappable(object); | 111 const ScriptWrappable* untrustedScriptWrappable = toScriptWrappable(object); |
112 const WrapperTypeInfo* untrustedWrapperTypeInfo = toWrapperTypeInfo(object); | 112 const WrapperTypeInfo* untrustedWrapperTypeInfo = toWrapperTypeInfo(object); |
113 return untrustedScriptWrappable | 113 return untrustedScriptWrappable |
114 && untrustedWrapperTypeInfo | 114 && untrustedWrapperTypeInfo |
115 && untrustedWrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink; | 115 && untrustedWrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink; |
116 } | 116 } |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
OLD | NEW |