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

Side by Side Diff: public/platform/WebPrivatePtr.h

Issue 863113004: Make WebThreadedDataReceiver wrap a Blink-managed object instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix msvc compilation Created 5 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 #if INSIDE_BLINK 44 #if INSIDE_BLINK
45 enum LifetimeManagementType { 45 enum LifetimeManagementType {
46 RefCountedLifetime, 46 RefCountedLifetime,
47 GarbageCollectedLifetime, 47 GarbageCollectedLifetime,
48 RefCountedGarbageCollectedLifetime 48 RefCountedGarbageCollectedLifetime
49 }; 49 };
50 50
51 template<typename T> 51 template<typename T>
52 class LifetimeOf { 52 class LifetimeOf {
53 static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, GarbageC ollected>::value; 53 static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, GarbageC ollected>::value || WTF::IsSubclass<T, GarbageCollectedMixin>::value;
54 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T , RefCountedGarbageCollected>::value; 54 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T , RefCountedGarbageCollected>::value;
55 public: 55 public:
56 static const LifetimeManagementType value = 56 static const LifetimeManagementType value =
57 !isGarbageCollected ? RefCountedLifetime : 57 !isGarbageCollected ? RefCountedLifetime :
58 isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : Garb ageCollectedLifetime; 58 isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : Garb ageCollectedLifetime;
59 }; 59 };
60 60
61 template<typename T, LifetimeManagementType lifetime> 61 template<typename T, LifetimeManagementType lifetime>
62 class PtrStorageImpl; 62 class PtrStorageImpl;
63 63
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // Disable the copy constructor; classes that contain a WebPrivatePtr 261 // Disable the copy constructor; classes that contain a WebPrivatePtr
262 // should implement their copy constructor using assign(). 262 // should implement their copy constructor using assign().
263 WebPrivatePtr(const WebPrivatePtr<T>&); 263 WebPrivatePtr(const WebPrivatePtr<T>&);
264 264
265 void* m_storage; 265 void* m_storage;
266 }; 266 };
267 267
268 } // namespace blink 268 } // namespace blink
269 269
270 #endif 270 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698