| 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 PrefinalizerRegistration(T* self) { | 505 PrefinalizerRegistration(T* self) { |
| 506 static_assert(sizeof(&T::invokePreFinalizer) > 0, | 506 static_assert(sizeof(&T::invokePreFinalizer) > 0, |
| 507 "USING_PRE_FINALIZER(T) must be defined."); | 507 "USING_PRE_FINALIZER(T) must be defined."); |
| 508 ThreadState* state = ThreadState::current(); | 508 ThreadState* state = ThreadState::current(); |
| 509 #if DCHECK_IS_ON() | 509 #if DCHECK_IS_ON() |
| 510 DCHECK(state->checkThread()); | 510 DCHECK(state->checkThread()); |
| 511 #endif | 511 #endif |
| 512 DCHECK(!state->sweepForbidden()); | 512 DCHECK(!state->sweepForbidden()); |
| 513 DCHECK(!state->m_orderedPreFinalizers.contains( | 513 DCHECK(!state->m_orderedPreFinalizers.contains( |
| 514 PreFinalizer(self, T::invokePreFinalizer))); | 514 PreFinalizer(self, T::invokePreFinalizer))); |
| 515 state->m_orderedPreFinalizers.add( | 515 state->m_orderedPreFinalizers.insert( |
| 516 PreFinalizer(self, T::invokePreFinalizer)); | 516 PreFinalizer(self, T::invokePreFinalizer)); |
| 517 } | 517 } |
| 518 }; | 518 }; |
| 519 | 519 |
| 520 static const char* gcReasonString(BlinkGC::GCReason); | 520 static const char* gcReasonString(BlinkGC::GCReason); |
| 521 | 521 |
| 522 // Returns |true| if |object| resides on this thread's heap. | 522 // Returns |true| if |object| resides on this thread's heap. |
| 523 // It is well-defined to call this method on any heap allocated | 523 // It is well-defined to call this method on any heap allocated |
| 524 // reference, provided its associated heap hasn't been detached | 524 // reference, provided its associated heap hasn't been detached |
| 525 // and shut down. Its behavior is undefined for any other pointer | 525 // and shut down. Its behavior is undefined for any other pointer |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 class ThreadStateFor<AnyThread> { | 699 class ThreadStateFor<AnyThread> { |
| 700 STATIC_ONLY(ThreadStateFor); | 700 STATIC_ONLY(ThreadStateFor); |
| 701 | 701 |
| 702 public: | 702 public: |
| 703 static ThreadState* state() { return ThreadState::current(); } | 703 static ThreadState* state() { return ThreadState::current(); } |
| 704 }; | 704 }; |
| 705 | 705 |
| 706 } // namespace blink | 706 } // namespace blink |
| 707 | 707 |
| 708 #endif // ThreadState_h | 708 #endif // ThreadState_h |
| OLD | NEW |