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

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

Issue 324073002: Oilpan: Switch RefCountedGarbageCollected to GarbageCollectedFinalized for Node. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and update Node base class list Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | no next file » | 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) 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return; 107 return;
108 } 108 }
109 109
110 if (!m_handle) 110 if (!m_handle)
111 m_handle = new WebCore::Persistent<T>(); 111 m_handle = new WebCore::Persistent<T>();
112 112
113 (*m_handle) = val; 113 (*m_handle) = val;
114 } 114 }
115 115
116 void assign(T* ptr) { assign(RawPtr<T>(ptr)); } 116 void assign(T* ptr) { assign(RawPtr<T>(ptr)); }
117 template<typename U> void assign(const RawPtr<U>& val) { assign(RawPtr<T>(va l)); }
117 118
118 void assign(const PtrStorageImpl& other) { assign(other.get()); } 119 void assign(const PtrStorageImpl& other) { assign(other.get()); }
119 120
120 T* get() const { return m_handle ? m_handle->get() : 0; } 121 T* get() const { return m_handle ? m_handle->get() : 0; }
121 122
122 void release() 123 void release()
123 { 124 {
124 delete m_handle; 125 delete m_handle;
125 m_handle = 0; 126 m_handle = 0;
126 } 127 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // Disable the copy constructor; classes that contain a WebPrivatePtr 266 // Disable the copy constructor; classes that contain a WebPrivatePtr
266 // should implement their copy constructor using assign(). 267 // should implement their copy constructor using assign().
267 WebPrivatePtr(const WebPrivatePtr<T>&); 268 WebPrivatePtr(const WebPrivatePtr<T>&);
268 269
269 void* m_storage; 270 void* m_storage;
270 }; 271 };
271 272
272 } // namespace blink 273 } // namespace blink
273 274
274 #endif 275 #endif
OLDNEW
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698