OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 26 matching lines...) Expand all Loading... |
37 #include "bindings/v8/V8HiddenPropertyName.h" | 37 #include "bindings/v8/V8HiddenPropertyName.h" |
38 #include "core/dom/Node.h" | 38 #include "core/dom/Node.h" |
39 #include "core/dom/NodeFilter.h" | 39 #include "core/dom/NodeFilter.h" |
40 #include "wtf/OwnArrayPtr.h" | 40 #include "wtf/OwnArrayPtr.h" |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 V8NodeFilterCondition::V8NodeFilterCondition(v8::Handle<v8::Value> filter, v8::H
andle<v8::Object> owner, v8::Isolate* isolate) | 44 V8NodeFilterCondition::V8NodeFilterCondition(v8::Handle<v8::Value> filter, v8::H
andle<v8::Object> owner, v8::Isolate* isolate) |
45 : m_filter(isolate, filter) | 45 : m_filter(isolate, filter) |
46 { | 46 { |
47 owner->SetHiddenValue(V8HiddenPropertyName::condition(), filter); | 47 owner->SetHiddenValue(V8HiddenPropertyName::condition(isolate), filter); |
48 m_filter.makeWeak(this, &makeWeakCallback); | 48 m_filter.makeWeak(this, &makeWeakCallback); |
49 } | 49 } |
50 | 50 |
51 V8NodeFilterCondition::~V8NodeFilterCondition() | 51 V8NodeFilterCondition::~V8NodeFilterCondition() |
52 { | 52 { |
53 } | 53 } |
54 | 54 |
55 short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const | 55 short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const |
56 { | 56 { |
57 ASSERT(v8::Context::InContext()); | 57 ASSERT(v8::Context::InContext()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 return result->Int32Value(); | 93 return result->Int32Value(); |
94 } | 94 } |
95 | 95 |
96 void V8NodeFilterCondition::makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Va
lue>*, V8NodeFilterCondition* condition) | 96 void V8NodeFilterCondition::makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Va
lue>*, V8NodeFilterCondition* condition) |
97 { | 97 { |
98 condition->m_filter.clear(); | 98 condition->m_filter.clear(); |
99 } | 99 } |
100 | 100 |
101 } // namespace WebCore | 101 } // namespace WebCore |
OLD | NEW |