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

Side by Side Diff: base/macros.h

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « base/mac/scoped_mach_port.cc ('k') | base/metrics/statistics_recorder.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 file contains macros and macro-like constructs (e.g., templates) that 5 // This file contains macros and macro-like constructs (e.g., templates) that
6 // are commonly used throughout Chromium source. (It may also contain things 6 // are commonly used throughout Chromium source. (It may also contain things
7 // that are closely related to things that are commonly used that belong in this 7 // that are closely related to things that are commonly used that belong in this
8 // file.) 8 // file.)
9 9
10 #ifndef BASE_MACROS_H_ 10 #ifndef BASE_MACROS_H_
11 #define BASE_MACROS_H_ 11 #define BASE_MACROS_H_
12 12
13 #include <stddef.h> // For size_t. 13 #include <stddef.h> // For size_t.
14 #include <string.h> // For memcpy. 14 #include <string.h> // For memcpy.
15 15
16 #include "base/compiler_specific.h" // For ALLOW_UNUSED.
17
18 // Put this in the private: declarations for a class to be uncopyable. 16 // Put this in the private: declarations for a class to be uncopyable.
19 #define DISALLOW_COPY(TypeName) \ 17 #define DISALLOW_COPY(TypeName) \
20 TypeName(const TypeName&) 18 TypeName(const TypeName&)
21 19
22 // Put this in the private: declarations for a class to be unassignable. 20 // Put this in the private: declarations for a class to be unassignable.
23 #define DISALLOW_ASSIGN(TypeName) \ 21 #define DISALLOW_ASSIGN(TypeName) \
24 void operator=(const TypeName&) 22 void operator=(const TypeName&)
25 23
26 // A macro to disallow the copy constructor and operator= functions 24 // A macro to disallow the copy constructor and operator= functions
27 // This should be used in the private: declarations for a class 25 // This should be used in the private: declarations for a class
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 199
202 // Use these to declare and define a static local variable (static T;) so that 200 // Use these to declare and define a static local variable (static T;) so that
203 // it is leaked so that its destructors are not called at exit. If you need 201 // it is leaked so that its destructors are not called at exit. If you need
204 // thread-safe initialization, use base/lazy_instance.h instead. 202 // thread-safe initialization, use base/lazy_instance.h instead.
205 #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \ 203 #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \
206 static type& name = *new type arguments 204 static type& name = *new type arguments
207 205
208 } // base 206 } // base
209 207
210 #endif // BASE_MACROS_H_ 208 #endif // BASE_MACROS_H_
OLDNEW
« no previous file with comments | « base/mac/scoped_mach_port.cc ('k') | base/metrics/statistics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698