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

Side by Side Diff: Source/heap/Handle.h

Issue 163493003: Revert of Move speech module over to Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/heap/Visitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 template<typename T> 383 template<typename T>
384 class TraceTrait<Member<T> > { 384 class TraceTrait<Member<T> > {
385 public: 385 public:
386 static void trace(Visitor* visitor, void* self) 386 static void trace(Visitor* visitor, void* self)
387 { 387 {
388 TraceTrait<T>::mark(visitor, *static_cast<Member<T>*>(self)); 388 TraceTrait<T>::mark(visitor, *static_cast<Member<T>*>(self));
389 } 389 }
390 }; 390 };
391 391
392 // TraceTrait to allow compilation of trace method bodies when oilpan is disable d.
393 // This should never be called, but is needed to compile.
394 template<typename T>
395 class TraceTrait<RefPtr<T> > {
396 public:
397 static void trace(Visitor*, void*)
398 {
399 ASSERT_NOT_REACHED();
400 }
401 };
402
403 // WeakMember is similar to Member in that it is used to point to other oilpan 392 // WeakMember is similar to Member in that it is used to point to other oilpan
404 // heap allocated objects. 393 // heap allocated objects.
405 // However instead of creating a strong pointer to the object, the WeakMember cr eates 394 // However instead of creating a strong pointer to the object, the WeakMember cr eates
406 // a weak pointer, which does not keep the pointee alive. Hence if all pointers to 395 // a weak pointer, which does not keep the pointee alive. Hence if all pointers to
407 // to a heap allocated object are weak the object will be garbage collected. At the 396 // to a heap allocated object are weak the object will be garbage collected. At the
408 // time of GC the weak pointers will automatically be set to null. 397 // time of GC the weak pointers will automatically be set to null.
409 template<typename T> 398 template<typename T>
410 class WeakMember : public Member<T> { 399 class WeakMember : public Member<T> {
411 public: 400 public:
412 WeakMember() : Member<T>() { } 401 WeakMember() : Member<T>() { }
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 template<typename T> 767 template<typename T>
779 struct IsWeak<WebCore::WeakMember<T> > { 768 struct IsWeak<WebCore::WeakMember<T> > {
780 static const bool value = true; 769 static const bool value = true;
781 }; 770 };
782 771
783 template<typename Key, typename Value, typename Extractor, typename Traits, type name KeyTraits> 772 template<typename Key, typename Value, typename Extractor, typename Traits, type name KeyTraits>
784 struct IsWeak<WebCore::HeapHashTableBacking<Key, Value, Extractor, Traits, KeyTr aits> > { 773 struct IsWeak<WebCore::HeapHashTableBacking<Key, Value, Extractor, Traits, KeyTr aits> > {
785 static const bool value = Traits::isWeak; 774 static const bool value = Traits::isWeak;
786 }; 775 };
787 776
788 template<typename T> inline T* getPtr(const WebCore::Member<T>& p)
789 {
790 return p.get();
791 }
792
793 } // namespace WTF 777 } // namespace WTF
794 778
795 #endif 779 #endif
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698