OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Weak handles provides a way to refer to weak pointers from another | 5 // Weak handles provides a way to refer to weak pointers from another |
6 // thread. This is useful because it is not safe to reference a weak | 6 // thread. This is useful because it is not safe to reference a weak |
7 // pointer from a thread other than the thread on which it was | 7 // pointer from a thread other than the thread on which it was |
8 // created. | 8 // created. |
9 // | 9 // |
10 // Weak handles can be passed across threads, so for example, you can | 10 // Weak handles can be passed across threads, so for example, you can |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // }; | 45 // }; |
46 | 46 |
47 #ifndef CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ | 47 #ifndef CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ |
48 #define CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ | 48 #define CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ |
49 #pragma once | 49 #pragma once |
50 | 50 |
51 #include <cstddef> | 51 #include <cstddef> |
52 | 52 |
53 #include "base/basictypes.h" | 53 #include "base/basictypes.h" |
54 #include "base/bind.h" | 54 #include "base/bind.h" |
55 #include "base/callback.h" | 55 #include "base/callback_forward.h" |
56 #include "base/compiler_specific.h" | 56 #include "base/compiler_specific.h" |
57 #include "base/gtest_prod_util.h" | 57 #include "base/gtest_prod_util.h" |
58 #include "base/location.h" | 58 #include "base/location.h" |
59 #include "base/logging.h" | 59 #include "base/logging.h" |
60 #include "base/memory/ref_counted.h" | 60 #include "base/memory/ref_counted.h" |
61 #include "base/memory/weak_ptr.h" | 61 #include "base/memory/weak_ptr.h" |
62 | 62 |
63 namespace base { | 63 namespace base { |
64 class MessageLoopProxy; | 64 class MessageLoopProxy; |
65 } // namespace base | 65 } // namespace base |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 // Makes a WeakHandle from a WeakPtr. | 371 // Makes a WeakHandle from a WeakPtr. |
372 template <typename T> | 372 template <typename T> |
373 WeakHandle<T> MakeWeakHandle(const base::WeakPtr<T>& ptr) { | 373 WeakHandle<T> MakeWeakHandle(const base::WeakPtr<T>& ptr) { |
374 return WeakHandle<T>(ptr); | 374 return WeakHandle<T>(ptr); |
375 } | 375 } |
376 | 376 |
377 } // namespace browser_sync | 377 } // namespace browser_sync |
378 | 378 |
379 #endif // CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ | 379 #endif // CHROME_BROWSER_SYNC_UTIL_WEAK_HANDLE_H_ |
OLD | NEW |