OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // (DOM) | 55 // (DOM) |
56 // NodeIterator ----RefPtr----> NodeFilter ----RefPtr----> NodeFilterCondition | 56 // NodeIterator ----RefPtr----> NodeFilter ----RefPtr----> NodeFilterCondition |
57 // | ^ | ^ | | 57 // | ^ | ^ | |
58 // weak | weak | ScopedPersistent(weak) | 58 // weak | weak | ScopedPersistent(weak) |
59 // | RefPtr | RefPtr | | 59 // | RefPtr | RefPtr | |
60 // v | v | v | 60 // v | v | v |
61 // NodeIterator --HiddenValue--> NodeFilter --HiddenValue--> JS Callback | 61 // NodeIterator --HiddenValue--> NodeFilter --HiddenValue--> JS Callback |
62 // (V8) | 62 // (V8) |
63 class V8NodeFilterCondition final : public NodeFilterCondition { | 63 class V8NodeFilterCondition final : public NodeFilterCondition { |
64 public: | 64 public: |
65 static RawPtr<V8NodeFilterCondition> create(v8::Local<v8::Value> filter, v8:
:Local<v8::Object> owner, ScriptState* scriptState) | 65 static V8NodeFilterCondition* create(v8::Local<v8::Value> filter, v8::Local<
v8::Object> owner, ScriptState* scriptState) |
66 { | 66 { |
67 return new V8NodeFilterCondition(filter, owner, scriptState); | 67 return new V8NodeFilterCondition(filter, owner, scriptState); |
68 } | 68 } |
69 | 69 |
70 ~V8NodeFilterCondition() override; | 70 ~V8NodeFilterCondition() override; |
71 | 71 |
72 unsigned acceptNode(Node*, ExceptionState&) const override; | 72 unsigned acceptNode(Node*, ExceptionState&) const override; |
73 | 73 |
74 private: | 74 private: |
75 // As the value |filter| is maintained by V8GC, the |owner| which references | 75 // As the value |filter| is maintained by V8GC, the |owner| which references |
76 // V8NodeFilterCondition, usually a wrapper of NodeFilter, is specified here | 76 // V8NodeFilterCondition, usually a wrapper of NodeFilter, is specified here |
77 // to hold a strong reference to |filter|. | 77 // to hold a strong reference to |filter|. |
78 V8NodeFilterCondition(v8::Local<v8::Value> filter, v8::Local<v8::Object> own
er, ScriptState*); | 78 V8NodeFilterCondition(v8::Local<v8::Value> filter, v8::Local<v8::Object> own
er, ScriptState*); |
79 | 79 |
80 static void setWeakCallback(const v8::WeakCallbackInfo<V8NodeFilterCondition
>&); | 80 static void setWeakCallback(const v8::WeakCallbackInfo<V8NodeFilterCondition
>&); |
81 | 81 |
82 RefPtr<ScriptState> m_scriptState; | 82 RefPtr<ScriptState> m_scriptState; |
83 ScopedPersistent<v8::Value> m_filter; | 83 ScopedPersistent<v8::Value> m_filter; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
87 | 87 |
88 #endif // V8NodeFilterCondition_h | 88 #endif // V8NodeFilterCondition_h |
OLD | NEW |