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

Side by Side Diff: base/memory/ref_counted.h

Issue 748073004: Disable implicit conversion of scoped_refptr<T> to T* on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comptr too Created 6 years, 1 month 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 | « no previous file | base/win/scoped_comptr.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_MEMORY_REF_COUNTED_H_ 5 #ifndef BASE_MEMORY_REF_COUNTED_H_
6 #define BASE_MEMORY_REF_COUNTED_H_ 6 #define BASE_MEMORY_REF_COUNTED_H_
7 7
8 #include <cassert> 8 #include <cassert>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
11 #include "base/atomic_ref_count.h" 11 #include "base/atomic_ref_count.h"
12 #include "base/base_export.h" 12 #include "base/base_export.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #ifndef NDEBUG 14 #ifndef NDEBUG
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #endif 16 #endif
17 #include "base/threading/thread_collision_warner.h" 17 #include "base/threading/thread_collision_warner.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 19
20 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_IOS) || defined(OS_AND ROID) 20 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_IOS) || defined(OS_AND ROID) || defined(OS_WIN)
Nico 2014/11/22 01:19:24 Is anything missing from this list? Might want to
dcheng 2014/11/22 01:20:22 I wanted to do that in a followup--just in case th
21 #define DISABLE_SCOPED_REFPTR_CONVERSION_OPERATOR 21 #define DISABLE_SCOPED_REFPTR_CONVERSION_OPERATOR
22 #endif 22 #endif
23 23
24 namespace base { 24 namespace base {
25 25
26 namespace subtle { 26 namespace subtle {
27 27
28 class BASE_EXPORT RefCountedBase { 28 class BASE_EXPORT RefCountedBase {
29 public: 29 public:
30 bool HasOneRef() const { return ref_count_ == 1; } 30 bool HasOneRef() const { return ref_count_ == 1; }
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 return !operator==(lhs, rhs); 411 return !operator==(lhs, rhs);
412 } 412 }
413 413
414 template <typename T> 414 template <typename T>
415 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) { 415 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) {
416 return out << p.get(); 416 return out << p.get();
417 } 417 }
418 #endif // defined(DISABLE_SCOPED_REFPTR_CONVERSION_OPERATOR) 418 #endif // defined(DISABLE_SCOPED_REFPTR_CONVERSION_OPERATOR)
419 419
420 #endif // BASE_MEMORY_REF_COUNTED_H_ 420 #endif // BASE_MEMORY_REF_COUNTED_H_
OLDNEW
« no previous file with comments | « no previous file | base/win/scoped_comptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698