Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: Source/bindings/v8/V8NodeFilterCondition.h

Issue 297513008: Decrease call sites of ScriptState::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8MutationCallback.cpp ('k') | Source/bindings/v8/V8NodeFilterCondition.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 PassRefPtrWillBeRawPtr<V8NodeFilterCondition> create(v8::Handle<v8::V alue> filter, v8::Handle<v8::Object> owner, v8::Isolate* isolate) 65 static PassRefPtrWillBeRawPtr<V8NodeFilterCondition> create(v8::Handle<v8::V alue> filter, v8::Handle<v8::Object> owner, ScriptState* scriptState)
66 { 66 {
67 return adoptRefWillBeNoop(new V8NodeFilterCondition(filter, owner, isola te)); 67 return adoptRefWillBeNoop(new V8NodeFilterCondition(filter, owner, scrip tState));
68 } 68 }
69 69
70 virtual ~V8NodeFilterCondition(); 70 virtual ~V8NodeFilterCondition();
71 71
72 virtual short acceptNode(Node*, ExceptionState&) const OVERRIDE; 72 virtual short 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::Handle<v8::Value> filter, v8::Handle<v8::Object> o wner, v8::Isolate*); 78 V8NodeFilterCondition(v8::Handle<v8::Value> filter, v8::Handle<v8::Object> o wner, ScriptState*);
79 79
80 static void setWeakCallback(const v8::WeakCallbackData<v8::Value, V8NodeFilt erCondition>&); 80 static void setWeakCallback(const v8::WeakCallbackData<v8::Value, V8NodeFilt erCondition>&);
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 WebCore 86 } // namespace WebCore
87 87
88 #endif // V8NodeFilterCondition_h 88 #endif // V8NodeFilterCondition_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8MutationCallback.cpp ('k') | Source/bindings/v8/V8NodeFilterCondition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698