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 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // idiom usages with the pre-finalizer if the replacement won't cause | 85 // idiom usages with the pre-finalizer if the replacement won't cause |
86 // performance regressions. | 86 // performance regressions. |
87 // | 87 // |
88 // Usage: | 88 // Usage: |
89 // | 89 // |
90 // class Foo : GarbageCollected<Foo> { | 90 // class Foo : GarbageCollected<Foo> { |
91 // USING_PRE_FINALIZER(Foo, dispose); | 91 // USING_PRE_FINALIZER(Foo, dispose); |
92 // public: | 92 // public: |
93 // Foo() | 93 // Foo() |
94 // { | 94 // { |
95 // ThreadState::current()->registerPreFinalizer(dispose); | 95 // ThreadState::current()->registerPreFinalizer(this); |
96 // } | 96 // } |
97 // private: | 97 // private: |
98 // void dispose() | 98 // void dispose() |
99 // { | 99 // { |
100 // m_bar->...; // It is safe to touch other on-heap objects. | 100 // m_bar->...; // It is safe to touch other on-heap objects. |
101 // } | 101 // } |
102 // Member<Bar> m_bar; | 102 // Member<Bar> m_bar; |
103 // }; | 103 // }; |
104 #define USING_PRE_FINALIZER(Class, preFinalizer) \ | 104 #define USING_PRE_FINALIZER(Class, preFinalizer) \ |
105 public: \ | 105 public: \ |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 template<> class ThreadStateFor<AnyThread> { | 701 template<> class ThreadStateFor<AnyThread> { |
702 STATIC_ONLY(ThreadStateFor); | 702 STATIC_ONLY(ThreadStateFor); |
703 public: | 703 public: |
704 static ThreadState* state() { return ThreadState::current(); } | 704 static ThreadState* state() { return ThreadState::current(); } |
705 }; | 705 }; |
706 | 706 |
707 } // namespace blink | 707 } // namespace blink |
708 | 708 |
709 #endif // ThreadState_h | 709 #endif // ThreadState_h |
OLD | NEW |