| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "config.h" | 32 #include "config.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/NPV8Object.h" | 34 #include "bindings/core/v8/NPV8Object.h" |
| 35 #include "bindings/core/v8/SharedPersistent.h" | 35 #include "bindings/core/v8/SharedPersistent.h" |
| 36 #include "bindings/core/v8/V8Binding.h" | 36 #include "bindings/core/v8/V8Binding.h" |
| 37 #include "bindings/core/v8/V8HTMLAppletElement.h" | |
| 38 #include "bindings/core/v8/V8HTMLEmbedElement.h" | 37 #include "bindings/core/v8/V8HTMLEmbedElement.h" |
| 39 #include "bindings/core/v8/V8HTMLObjectElement.h" | 38 #include "bindings/core/v8/V8HTMLObjectElement.h" |
| 40 #include "bindings/core/v8/V8NPObject.h" | 39 #include "bindings/core/v8/V8NPObject.h" |
| 41 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
| 42 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 43 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 namespace { | 46 namespace { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // never set the return value here which would indicate that the plugin has | 110 // never set the return value here which would indicate that the plugin has |
| 112 // intercepted the SetProperty call, which means that the property on the | 111 // intercepted the SetProperty call, which means that the property on the |
| 113 // DOM element will also be set. For plugin's that don't intercept the call | 112 // DOM element will also be set. For plugin's that don't intercept the call |
| 114 // (all except gTalk) this makes no difference at all. For gTalk the fact | 113 // (all except gTalk) this makes no difference at all. For gTalk the fact |
| 115 // that the property on the DOM element also gets set is inconsequential. | 114 // that the property on the DOM element also gets set is inconsequential. |
| 116 v8::Maybe<bool> unused = instance->Set(info.GetIsolate()->GetCurrentContext(
), property, value); | 115 v8::Maybe<bool> unused = instance->Set(info.GetIsolate()->GetCurrentContext(
), property, value); |
| 117 ALLOW_UNUSED_LOCAL(unused); | 116 ALLOW_UNUSED_LOCAL(unused); |
| 118 } | 117 } |
| 119 } // namespace | 118 } // namespace |
| 120 | 119 |
| 121 void V8HTMLAppletElement::namedPropertyGetterCustom(v8::Local<v8::Name> name, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | |
| 122 { | |
| 123 if (!name->IsString()) | |
| 124 return; | |
| 125 getScriptableObjectProperty<V8HTMLAppletElement>(name.As<v8::String>(), info
); | |
| 126 } | |
| 127 | |
| 128 void V8HTMLEmbedElement::namedPropertyGetterCustom(v8::Local<v8::Name> name, con
st v8::PropertyCallbackInfo<v8::Value>& info) | 120 void V8HTMLEmbedElement::namedPropertyGetterCustom(v8::Local<v8::Name> name, con
st v8::PropertyCallbackInfo<v8::Value>& info) |
| 129 { | 121 { |
| 130 if (!name->IsString()) | 122 if (!name->IsString()) |
| 131 return; | 123 return; |
| 132 getScriptableObjectProperty<V8HTMLEmbedElement>(name.As<v8::String>(), info)
; | 124 getScriptableObjectProperty<V8HTMLEmbedElement>(name.As<v8::String>(), info)
; |
| 133 } | 125 } |
| 134 | 126 |
| 135 void V8HTMLObjectElement::namedPropertyGetterCustom(v8::Local<v8::Name> name, co
nst v8::PropertyCallbackInfo<v8::Value>& info) | 127 void V8HTMLObjectElement::namedPropertyGetterCustom(v8::Local<v8::Name> name, co
nst v8::PropertyCallbackInfo<v8::Value>& info) |
| 136 { | 128 { |
| 137 if (!name->IsString()) | 129 if (!name->IsString()) |
| 138 return; | 130 return; |
| 139 getScriptableObjectProperty<V8HTMLObjectElement>(name.As<v8::String>(), info
); | 131 getScriptableObjectProperty<V8HTMLObjectElement>(name.As<v8::String>(), info
); |
| 140 } | 132 } |
| 141 | 133 |
| 142 void V8HTMLAppletElement::namedPropertySetterCustom(v8::Local<v8::Name> name, v8
::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 143 { | |
| 144 if (!name->IsString()) | |
| 145 return; | |
| 146 setScriptableObjectProperty<V8HTMLAppletElement>(name.As<v8::String>(), valu
e, info); | |
| 147 } | |
| 148 | |
| 149 void V8HTMLEmbedElement::namedPropertySetterCustom(v8::Local<v8::Name> name, v8:
:Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | 134 void V8HTMLEmbedElement::namedPropertySetterCustom(v8::Local<v8::Name> name, v8:
:Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 150 { | 135 { |
| 151 if (!name->IsString()) | 136 if (!name->IsString()) |
| 152 return; | 137 return; |
| 153 setScriptableObjectProperty<V8HTMLEmbedElement>(name.As<v8::String>(), value
, info); | 138 setScriptableObjectProperty<V8HTMLEmbedElement>(name.As<v8::String>(), value
, info); |
| 154 } | 139 } |
| 155 | 140 |
| 156 void V8HTMLObjectElement::namedPropertySetterCustom(v8::Local<v8::Name> name, v8
::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | 141 void V8HTMLObjectElement::namedPropertySetterCustom(v8::Local<v8::Name> name, v8
::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 157 { | 142 { |
| 158 if (!name->IsString()) | 143 if (!name->IsString()) |
| 159 return; | 144 return; |
| 160 setScriptableObjectProperty<V8HTMLObjectElement>(name.As<v8::String>(), valu
e, info); | 145 setScriptableObjectProperty<V8HTMLObjectElement>(name.As<v8::String>(), valu
e, info); |
| 161 } | 146 } |
| 162 | 147 |
| 163 void V8HTMLAppletElement::indexedPropertyGetterCustom(uint32_t index, const v8::
PropertyCallbackInfo<v8::Value>& info) | |
| 164 { | |
| 165 getScriptableObjectProperty<V8HTMLAppletElement>(index, info); | |
| 166 } | |
| 167 | |
| 168 void V8HTMLEmbedElement::indexedPropertyGetterCustom(uint32_t index, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 148 void V8HTMLEmbedElement::indexedPropertyGetterCustom(uint32_t index, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
| 169 { | 149 { |
| 170 getScriptableObjectProperty<V8HTMLEmbedElement>(index, info); | 150 getScriptableObjectProperty<V8HTMLEmbedElement>(index, info); |
| 171 } | 151 } |
| 172 | 152 |
| 173 void V8HTMLObjectElement::indexedPropertyGetterCustom(uint32_t index, const v8::
PropertyCallbackInfo<v8::Value>& info) | 153 void V8HTMLObjectElement::indexedPropertyGetterCustom(uint32_t index, const v8::
PropertyCallbackInfo<v8::Value>& info) |
| 174 { | 154 { |
| 175 getScriptableObjectProperty<V8HTMLObjectElement>(index, info); | 155 getScriptableObjectProperty<V8HTMLObjectElement>(index, info); |
| 176 } | 156 } |
| 177 | 157 |
| 178 void V8HTMLAppletElement::indexedPropertySetterCustom(uint32_t index, v8::Local<
v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 179 { | |
| 180 setScriptableObjectProperty<V8HTMLAppletElement>(index, value, info); | |
| 181 } | |
| 182 | |
| 183 void V8HTMLEmbedElement::indexedPropertySetterCustom(uint32_t index, v8::Local<v
8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | 158 void V8HTMLEmbedElement::indexedPropertySetterCustom(uint32_t index, v8::Local<v
8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 184 { | 159 { |
| 185 setScriptableObjectProperty<V8HTMLEmbedElement>(index, value, info); | 160 setScriptableObjectProperty<V8HTMLEmbedElement>(index, value, info); |
| 186 } | 161 } |
| 187 | 162 |
| 188 void V8HTMLObjectElement::indexedPropertySetterCustom(uint32_t index, v8::Local<
v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | 163 void V8HTMLObjectElement::indexedPropertySetterCustom(uint32_t index, v8::Local<
v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 189 { | 164 { |
| 190 setScriptableObjectProperty<V8HTMLObjectElement>(index, value, info); | 165 setScriptableObjectProperty<V8HTMLObjectElement>(index, value, info); |
| 191 } | 166 } |
| 192 | 167 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 222 UseCounter::countIfNotPrivateScript(info.GetIsolate(), V8HTMLEmbedElement::t
oImpl(info.Holder())->document(), UseCounter::HTMLEmbedElementLegacyCall); | 197 UseCounter::countIfNotPrivateScript(info.GetIsolate(), V8HTMLEmbedElement::t
oImpl(info.Holder())->document(), UseCounter::HTMLEmbedElementLegacyCall); |
| 223 } | 198 } |
| 224 | 199 |
| 225 void V8HTMLObjectElement::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 200 void V8HTMLObjectElement::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 226 { | 201 { |
| 227 invokeOnScriptableObject<V8HTMLObjectElement>(info); | 202 invokeOnScriptableObject<V8HTMLObjectElement>(info); |
| 228 UseCounter::countIfNotPrivateScript(info.GetIsolate(), V8HTMLObjectElement::
toImpl(info.Holder())->document(), UseCounter::HTMLObjectElementLegacyCall); | 203 UseCounter::countIfNotPrivateScript(info.GetIsolate(), V8HTMLObjectElement::
toImpl(info.Holder())->document(), UseCounter::HTMLObjectElementLegacyCall); |
| 229 } | 204 } |
| 230 | 205 |
| 231 } // namespace blink | 206 } // namespace blink |
| OLD | NEW |