OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 scoped_ptr<MessagePump> TypeUIMessagePumpFactory() { | 47 scoped_ptr<MessagePump> TypeUIMessagePumpFactory() { |
48 return MessageLoop::CreateMessagePumpForType(MessageLoop::TYPE_UI); | 48 return MessageLoop::CreateMessagePumpForType(MessageLoop::TYPE_UI); |
49 } | 49 } |
50 | 50 |
51 class Foo : public RefCounted<Foo> { | 51 class Foo : public RefCounted<Foo> { |
52 public: | 52 public: |
53 Foo() : test_count_(0) { | 53 Foo() : test_count_(0) { |
54 } | 54 } |
55 | 55 |
56 void Test0() { | |
57 ++test_count_; | |
58 } | |
59 | |
60 void Test1ConstRef(const std::string& a) { | 56 void Test1ConstRef(const std::string& a) { |
61 ++test_count_; | 57 ++test_count_; |
62 result_.append(a); | 58 result_.append(a); |
63 } | 59 } |
64 | 60 |
65 void Test1Ptr(std::string* a) { | |
66 ++test_count_; | |
67 result_.append(*a); | |
68 } | |
69 | |
70 void Test1Int(int a) { | |
71 test_count_ += a; | |
72 } | |
73 | |
74 void Test2Ptr(std::string* a, std::string* b) { | |
75 ++test_count_; | |
76 result_.append(*a); | |
77 result_.append(*b); | |
78 } | |
79 | |
80 void Test2Mixed(const std::string& a, std::string* b) { | |
81 ++test_count_; | |
82 result_.append(a); | |
83 result_.append(*b); | |
84 } | |
85 | |
86 int test_count() const { return test_count_; } | 61 int test_count() const { return test_count_; } |
87 const std::string& result() const { return result_; } | 62 const std::string& result() const { return result_; } |
88 | 63 |
89 private: | 64 private: |
90 friend class RefCounted<Foo>; | 65 friend class RefCounted<Foo>; |
91 | 66 |
92 ~Foo() {} | 67 ~Foo() {} |
93 | 68 |
94 int test_count_; | 69 int test_count_; |
95 std::string result_; | 70 std::string result_; |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 | 1015 |
1041 ASSERT_TRUE(PostMessage(message_hwnd, kSignalMsg, 0, 1)); | 1016 ASSERT_TRUE(PostMessage(message_hwnd, kSignalMsg, 0, 1)); |
1042 | 1017 |
1043 loop.Run(); | 1018 loop.Run(); |
1044 | 1019 |
1045 ASSERT_TRUE(UnregisterClass(MAKEINTATOM(atom), instance)); | 1020 ASSERT_TRUE(UnregisterClass(MAKEINTATOM(atom), instance)); |
1046 } | 1021 } |
1047 #endif // defined(OS_WIN) | 1022 #endif // defined(OS_WIN) |
1048 | 1023 |
1049 } // namespace base | 1024 } // namespace base |
OLD | NEW |