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

Side by Side Diff: base/bind_helpers.h

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 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 | « base/base_paths_win.cc ('k') | base/bind_internal.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) 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 // This defines a set of argument wrappers and related factory methods that 5 // This defines a set of argument wrappers and related factory methods that
6 // can be used specify the refcounting and reference semantics of arguments 6 // can be used specify the refcounting and reference semantics of arguments
7 // that are bound by the Bind() function in base/bind.h. 7 // that are bound by the Bind() function in base/bind.h.
8 // 8 //
9 // It also defines a set of simple functions and utilities that people want 9 // It also defines a set of simple functions and utilities that people want
10 // when using Callback<> and Bind(). 10 // when using Callback<> and Bind().
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // See http://crbug.com/82038. 222 // See http://crbug.com/82038.
223 template <typename T> 223 template <typename T>
224 class SupportsAddRefAndRelease { 224 class SupportsAddRefAndRelease {
225 typedef char Yes[1]; 225 typedef char Yes[1];
226 typedef char No[2]; 226 typedef char No[2];
227 227
228 struct BaseMixin { 228 struct BaseMixin {
229 void AddRef(); 229 void AddRef();
230 }; 230 };
231 231
232 // MSVC warns when you try to use Base if T has a private destructor, the
233 // common pattern for refcounted types. It does this even though no attempt to
234 // instantiate Base is made. We disable the warning for this definition.
235 #if defined(OS_WIN)
236 #pragma warning(push)
237 #pragma warning(disable:4624)
238 #endif
239 struct Base : public T, public BaseMixin { 232 struct Base : public T, public BaseMixin {
240 }; 233 };
241 #if defined(OS_WIN)
242 #pragma warning(pop)
243 #endif
244 234
245 template <void(BaseMixin::*)(void)> struct Helper {}; 235 template <void(BaseMixin::*)(void)> struct Helper {};
246 236
247 template <typename C> 237 template <typename C>
248 static No& Check(Helper<&C::AddRef>*); 238 static No& Check(Helper<&C::AddRef>*);
249 239
250 template <typename > 240 template <typename >
251 static Yes& Check(...); 241 static Yes& Check(...);
252 242
253 public: 243 public:
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 BASE_EXPORT void DoNothing(); 583 BASE_EXPORT void DoNothing();
594 584
595 template<typename T> 585 template<typename T>
596 void DeletePointer(T* obj) { 586 void DeletePointer(T* obj) {
597 delete obj; 587 delete obj;
598 } 588 }
599 589
600 } // namespace base 590 } // namespace base
601 591
602 #endif // BASE_BIND_HELPERS_H_ 592 #endif // BASE_BIND_HELPERS_H_
OLDNEW
« no previous file with comments | « base/base_paths_win.cc ('k') | base/bind_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698