| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/dom/CustomElementLifecycleCallbacks.h" | 37 #include "core/dom/CustomElementLifecycleCallbacks.h" |
| 38 #include <v8.h> | 38 #include <v8.h> |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 class Element; | 42 class Element; |
| 43 class ScriptExecutionContext; | 43 class ScriptExecutionContext; |
| 44 | 44 |
| 45 class V8CustomElementLifecycleCallbacks : public CustomElementLifecycleCallbacks
, ActiveDOMCallback { | 45 class V8CustomElementLifecycleCallbacks : public CustomElementLifecycleCallbacks
, ActiveDOMCallback { |
| 46 public: | 46 public: |
| 47 static PassRefPtr<V8CustomElementLifecycleCallbacks> create(ScriptExecutionC
ontext*, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8:
:Handle<v8::Function> attributeChanged); | 47 static PassRefPtr<V8CustomElementLifecycleCallbacks> create(ScriptExecutionC
ontext*, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8:
:Handle<v8::Function> enteredDocument, v8::Handle<v8::Function> leftDocument, v8
::Handle<v8::Function> attributeChanged); |
| 48 | 48 |
| 49 virtual ~V8CustomElementLifecycleCallbacks() { } | 49 virtual ~V8CustomElementLifecycleCallbacks() { } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 V8CustomElementLifecycleCallbacks(ScriptExecutionContext*, v8::Handle<v8::Ob
ject> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> attr
ibuteChanged); | 52 V8CustomElementLifecycleCallbacks(ScriptExecutionContext*, v8::Handle<v8::Ob
ject> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> ente
redDocument, v8::Handle<v8::Function> leftDocument, v8::Handle<v8::Function> att
ributeChanged); |
| 53 | 53 |
| 54 virtual void created(Element*) OVERRIDE; | 54 virtual void created(Element*) OVERRIDE; |
| 55 virtual void enteredDocument(Element*) OVERRIDE; |
| 56 virtual void leftDocument(Element*) OVERRIDE; |
| 55 virtual void attributeChanged(Element*, const AtomicString& name, const Atom
icString& oldValue, const AtomicString& newValue) OVERRIDE; | 57 virtual void attributeChanged(Element*, const AtomicString& name, const Atom
icString& oldValue, const AtomicString& newValue) OVERRIDE; |
| 56 | 58 |
| 59 void call(const ScopedPersistent<v8::Function>& weakCallback, Element*); |
| 60 |
| 57 RefPtr<DOMWrapperWorld> m_world; | 61 RefPtr<DOMWrapperWorld> m_world; |
| 58 ScopedPersistent<v8::Object> m_prototype; | 62 ScopedPersistent<v8::Object> m_prototype; |
| 59 ScopedPersistent<v8::Function> m_created; | 63 ScopedPersistent<v8::Function> m_created; |
| 64 ScopedPersistent<v8::Function> m_enteredDocument; |
| 65 ScopedPersistent<v8::Function> m_leftDocument; |
| 60 ScopedPersistent<v8::Function> m_attributeChanged; | 66 ScopedPersistent<v8::Function> m_attributeChanged; |
| 61 }; | 67 }; |
| 62 | 68 |
| 63 } | 69 } |
| 64 | 70 |
| 65 #endif // V8CustomElementLifecycleCallbacks_h | 71 #endif // V8CustomElementLifecycleCallbacks_h |
| OLD | NEW |