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

Side by Side Diff: webrtc/base/scoped_ptr.h

Issue 1345433002: Add RTC_ prefix to contructormagic macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Formatting fix. Created 5 years, 3 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 | « webrtc/base/scoped_autorelease_pool.h ('k') | webrtc/base/scopedptrcollection.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 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good 291 // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good
292 // discussion of this technique. 292 // discussion of this technique.
293 struct Data : public D { 293 struct Data : public D {
294 explicit Data(T* ptr_in) : ptr(ptr_in) {} 294 explicit Data(T* ptr_in) : ptr(ptr_in) {}
295 Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {} 295 Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {}
296 T* ptr; 296 T* ptr;
297 }; 297 };
298 298
299 Data data_; 299 Data data_;
300 300
301 DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl); 301 RTC_DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl);
302 }; 302 };
303 303
304 } // namespace internal 304 } // namespace internal
305 305
306 // A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T> 306 // A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T>
307 // automatically deletes the pointer it holds (if any). 307 // automatically deletes the pointer it holds (if any).
308 // That is, scoped_ptr<T> owns the T object that it points to. 308 // That is, scoped_ptr<T> owns the T object that it points to.
309 // Like a T*, a scoped_ptr<T> may hold either nullptr or a pointer to a T 309 // Like a T*, a scoped_ptr<T> may hold either nullptr or a pointer to a T
310 // object. Also like T*, scoped_ptr<T> is thread-compatible, and once you 310 // object. Also like T*, scoped_ptr<T> is thread-compatible, and once you
311 // dereference it, you get the thread safety guarantees of T. 311 // dereference it, you get the thread safety guarantees of T.
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 627
628 // A function to convert T* into scoped_ptr<T> 628 // A function to convert T* into scoped_ptr<T>
629 // Doing e.g. make_scoped_ptr(new FooBarBaz<type>(arg)) is a shorter notation 629 // Doing e.g. make_scoped_ptr(new FooBarBaz<type>(arg)) is a shorter notation
630 // for scoped_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg)) 630 // for scoped_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
631 template <typename T> 631 template <typename T>
632 rtc::scoped_ptr<T> rtc_make_scoped_ptr(T* ptr) { 632 rtc::scoped_ptr<T> rtc_make_scoped_ptr(T* ptr) {
633 return rtc::scoped_ptr<T>(ptr); 633 return rtc::scoped_ptr<T>(ptr);
634 } 634 }
635 635
636 #endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__ 636 #endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__
OLDNEW
« no previous file with comments | « webrtc/base/scoped_autorelease_pool.h ('k') | webrtc/base/scopedptrcollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698