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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
34 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
35 #include <v8.h> | 35 #include <v8.h> |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class ExecutionContext; | 39 class ExecutionContext; |
40 | 40 |
41 class V8MutationCallback final : public MutationCallback, public ActiveDOMCallba
ck { | 41 class V8MutationCallback final : public MutationCallback, public ActiveDOMCallba
ck { |
42 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8MutationCallback); | 42 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8MutationCallback); |
| 43 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8MutationCallback); |
43 public: | 44 public: |
44 static PassOwnPtrWillBeRawPtr<V8MutationCallback> create(v8::Local<v8::Funct
ion> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) | 45 static PassOwnPtrWillBeRawPtr<V8MutationCallback> create(v8::Local<v8::Funct
ion> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) |
45 { | 46 { |
46 return adoptPtrWillBeNoop(new V8MutationCallback(callback, owner, script
State)); | 47 return adoptPtrWillBeNoop(new V8MutationCallback(callback, owner, script
State)); |
47 } | 48 } |
48 ~V8MutationCallback() override; | 49 ~V8MutationCallback() override; |
49 | 50 |
50 void call(const WillBeHeapVector<RefPtrWillBeMember<MutationRecord>>&, Mutat
ionObserver*) override; | 51 void call(const WillBeHeapVector<RefPtrWillBeMember<MutationRecord>>&, Mutat
ionObserver*) override; |
51 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } | 52 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } |
52 | 53 |
53 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
54 | 55 |
55 private: | 56 private: |
56 V8MutationCallback(v8::Local<v8::Function>, v8::Local<v8::Object>, ScriptSta
te*); | 57 V8MutationCallback(v8::Local<v8::Function>, v8::Local<v8::Object>, ScriptSta
te*); |
57 | 58 |
58 static void setWeakCallback(const v8::WeakCallbackInfo<V8MutationCallback>&)
; | 59 static void setWeakCallback(const v8::WeakCallbackInfo<V8MutationCallback>&)
; |
59 | 60 |
60 ScopedPersistent<v8::Function> m_callback; | 61 ScopedPersistent<v8::Function> m_callback; |
61 RefPtr<ScriptState> m_scriptState; | 62 RefPtr<ScriptState> m_scriptState; |
62 }; | 63 }; |
63 | 64 |
64 } | 65 } |
65 | 66 |
66 #endif // V8MutationCallback_h | 67 #endif // V8MutationCallback_h |
OLD | NEW |