| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // This should never be called, but is needed to compile. | 389 // This should never be called, but is needed to compile. |
| 390 template<typename T> | 390 template<typename T> |
| 391 class TraceTrait<RefPtr<T> > { | 391 class TraceTrait<RefPtr<T> > { |
| 392 public: | 392 public: |
| 393 static void trace(Visitor*, void*) | 393 static void trace(Visitor*, void*) |
| 394 { | 394 { |
| 395 ASSERT_NOT_REACHED(); | 395 ASSERT_NOT_REACHED(); |
| 396 } | 396 } |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 // TraceTrait to allow compilation of trace method bodies when oilpan is disable
d. | |
| 400 // This should never be called, but is needed to compile. | |
| 401 template<typename T> | |
| 402 class TraceTrait<RefPtr<T> > { | |
| 403 public: | |
| 404 static void trace(Visitor*, void*) | |
| 405 { | |
| 406 ASSERT_NOT_REACHED(); | |
| 407 } | |
| 408 }; | |
| 409 | |
| 410 // WeakMember is similar to Member in that it is used to point to other oilpan | 399 // WeakMember is similar to Member in that it is used to point to other oilpan |
| 411 // heap allocated objects. | 400 // heap allocated objects. |
| 412 // However instead of creating a strong pointer to the object, the WeakMember cr
eates | 401 // However instead of creating a strong pointer to the object, the WeakMember cr
eates |
| 413 // a weak pointer, which does not keep the pointee alive. Hence if all pointers
to | 402 // a weak pointer, which does not keep the pointee alive. Hence if all pointers
to |
| 414 // to a heap allocated object are weak the object will be garbage collected. At
the | 403 // to a heap allocated object are weak the object will be garbage collected. At
the |
| 415 // time of GC the weak pointers will automatically be set to null. | 404 // time of GC the weak pointers will automatically be set to null. |
| 416 template<typename T> | 405 template<typename T> |
| 417 class WeakMember : public Member<T> { | 406 class WeakMember : public Member<T> { |
| 418 public: | 407 public: |
| 419 WeakMember() : Member<T>() { } | 408 WeakMember() : Member<T>() { } |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 }; | 800 }; |
| 812 | 801 |
| 813 template<typename T> inline T* getPtr(const WebCore::Member<T>& p) | 802 template<typename T> inline T* getPtr(const WebCore::Member<T>& p) |
| 814 { | 803 { |
| 815 return p.get(); | 804 return p.get(); |
| 816 } | 805 } |
| 817 | 806 |
| 818 } // namespace WTF | 807 } // namespace WTF |
| 819 | 808 |
| 820 #endif | 809 #endif |
| OLD | NEW |