| OLD | NEW |
| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 element->setCustomElementState(Element::Upgraded); | 155 element->setCustomElementState(Element::Upgraded); |
| 156 | 156 |
| 157 v8::Isolate* isolate = toIsolate(executionContext()); | 157 v8::Isolate* isolate = toIsolate(executionContext()); |
| 158 v8::HandleScope handleScope(isolate); | 158 v8::HandleScope handleScope(isolate); |
| 159 v8::Handle<v8::Context> context = toV8Context(executionContext(), m_world.ge
t()); | 159 v8::Handle<v8::Context> context = toV8Context(executionContext(), m_world.ge
t()); |
| 160 if (context.IsEmpty()) | 160 if (context.IsEmpty()) |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 v8::Context::Scope scope(context); | 163 v8::Context::Scope scope(context); |
| 164 | 164 |
| 165 v8::Handle<v8::Object> receiver = DOMDataStore::current(isolate)->get<V8Elem
ent>(element, isolate); | 165 v8::Handle<v8::Object> receiver = DOMDataStore::current(isolate).get<V8Eleme
nt>(element, isolate); |
| 166 if (!receiver.IsEmpty()) { | 166 if (!receiver.IsEmpty()) { |
| 167 // Swizzle the prototype of the existing wrapper. We don't need to | 167 // Swizzle the prototype of the existing wrapper. We don't need to |
| 168 // worry about non-existent wrappers; they will get the right | 168 // worry about non-existent wrappers; they will get the right |
| 169 // prototype when wrapped. | 169 // prototype when wrapped. |
| 170 v8::Handle<v8::Object> prototype = m_prototype.newLocal(isolate); | 170 v8::Handle<v8::Object> prototype = m_prototype.newLocal(isolate); |
| 171 if (prototype.IsEmpty()) | 171 if (prototype.IsEmpty()) |
| 172 return; | 172 return; |
| 173 receiver->SetPrototype(prototype); | 173 receiver->SetPrototype(prototype); |
| 174 } | 174 } |
| 175 | 175 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 v8::Handle<v8::Object> receiver = toV8(element, context->Global(), isolate).
As<v8::Object>(); | 248 v8::Handle<v8::Object> receiver = toV8(element, context->Global(), isolate).
As<v8::Object>(); |
| 249 ASSERT(!receiver.IsEmpty()); | 249 ASSERT(!receiver.IsEmpty()); |
| 250 | 250 |
| 251 v8::TryCatch exceptionCatcher; | 251 v8::TryCatch exceptionCatcher; |
| 252 exceptionCatcher.SetVerbose(true); | 252 exceptionCatcher.SetVerbose(true); |
| 253 ScriptController::callFunction(executionContext(), callback, receiver, 0, 0,
isolate); | 253 ScriptController::callFunction(executionContext(), callback, receiver, 0, 0,
isolate); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace WebCore | 256 } // namespace WebCore |
| OLD | NEW |