| 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(this, dispose); | 95 // ThreadState::current()->registerPreFinalizer(dispose); |
| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 }; | 673 }; |
| 674 | 674 |
| 675 template<> class ThreadStateFor<AnyThread> { | 675 template<> class ThreadStateFor<AnyThread> { |
| 676 public: | 676 public: |
| 677 static ThreadState* state() { return ThreadState::current(); } | 677 static ThreadState* state() { return ThreadState::current(); } |
| 678 }; | 678 }; |
| 679 | 679 |
| 680 } // namespace blink | 680 } // namespace blink |
| 681 | 681 |
| 682 #endif // ThreadState_h | 682 #endif // ThreadState_h |
| OLD | NEW |