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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h

Issue 2086553002: Refactor ScriptWrappableVisitor.markWrapper(PersistentBase) to be instance method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace fix Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 isolate->SetReference(parent, m_mainWorldWrapper); 142 isolate->SetReference(parent, m_mainWorldWrapper);
143 } 143 }
144 144
145 bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); } 145 bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); }
146 146
147 /** 147 /**
148 * Mark wrapper of this ScriptWrappable as alive in V8. Only marks 148 * Mark wrapper of this ScriptWrappable as alive in V8. Only marks
149 * wrapper in the main world. To mark wrappers in all worlds call 149 * wrapper in the main world. To mark wrappers in all worlds call
150 * ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*) 150 * ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*)
151 */ 151 */
152 void markWrapper(v8::Isolate*) const; 152 void markWrapper(const WrapperVisitor*) const;
153 153
154 DECLARE_VIRTUAL_TRACE_WRAPPERS() {}; 154 DECLARE_VIRTUAL_TRACE_WRAPPERS() {};
155 155
156 // With Oilpan we don't need a ScriptWrappable destructor. 156 // With Oilpan we don't need a ScriptWrappable destructor.
157 // 157 //
158 // 'RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper())' is not nee ded 158 // 'RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper())' is not nee ded
159 // because Oilpan is not using reference counting at all. If containsWrapper () is true, 159 // because Oilpan is not using reference counting at all. If containsWrapper () is true,
160 // it means that ScriptWrappable still has a wrapper. In this case, the dest ructor 160 // it means that ScriptWrappable still has a wrapper. In this case, the dest ructor
161 // must not be called since the wrapper has a persistent handle back to this ScriptWrappable object. 161 // must not be called since the wrapper has a persistent handle back to this ScriptWrappable object.
162 // Assuming that Oilpan's GC is correct (If we cannot assume this, a lot of more things are 162 // Assuming that Oilpan's GC is correct (If we cannot assume this, a lot of more things are
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // in X's cpp code, and instantiate X, i.e. "template class X;". 205 // in X's cpp code, and instantiate X, i.e. "template class X;".
206 #define DECLARE_WRAPPERTYPEINFO() \ 206 #define DECLARE_WRAPPERTYPEINFO() \
207 public: \ 207 public: \
208 const WrapperTypeInfo* wrapperTypeInfo() const override; \ 208 const WrapperTypeInfo* wrapperTypeInfo() const override; \
209 private: \ 209 private: \
210 typedef void end_of_define_wrappertypeinfo_not_reached_t 210 typedef void end_of_define_wrappertypeinfo_not_reached_t
211 211
212 } // namespace blink 212 } // namespace blink
213 213
214 #endif // ScriptWrappable_h 214 #endif // ScriptWrappable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698