Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
|
Paweł Hajdan Jr.
2017/02/13 17:17:24
nit: No (c)
alex-ac
2017/02/14 10:34:28
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_TEST_LOGGING_UTILS_H_ | |
| 6 #define BASE_TEST_LOGGING_UTILS_H_ | |
| 7 | |
| 8 #include "base/base_export.h" | |
| 9 #include "base/callback.h" | |
| 10 #include "base/logging.h" | |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 namespace logging { | |
| 14 | |
| 15 // Scoped object to set and restore Log Assert handler. | |
| 16 BASE_EXPORT class ScopedLogAssertHandler { | |
| 17 public: | |
| 18 ScopedLogAssertHandler(); | |
|
Paweł Hajdan Jr.
2017/02/13 17:17:24
Why do we need default ctor?
alex-ac
2017/02/14 10:34:28
It allows to use this object as an class variable
Paweł Hajdan Jr.
2017/02/14 19:23:26
Why don't we use unique_ptr instead, or some simil
alex-ac
2017/03/09 14:15:52
Done.
| |
| 19 explicit ScopedLogAssertHandler(LogAssertHandlerFunction handler); | |
| 20 ScopedLogAssertHandler(ScopedLogAssertHandler&& other); | |
|
Paweł Hajdan Jr.
2017/02/13 17:17:24
Why do we need this and operator= ?
alex-ac
2017/02/14 10:34:28
Move-assignment operator allows to initialize defa
Paweł Hajdan Jr.
2017/02/14 19:23:26
To me it's another reason not to need these additi
alex-ac
2017/03/09 14:15:52
Done.
| |
| 21 ~ScopedLogAssertHandler(); | |
| 22 | |
| 23 ScopedLogAssertHandler& operator=(ScopedLogAssertHandler&& other); | |
| 24 | |
| 25 private: | |
| 26 LogAssertHandlerFunction handler_; | |
| 27 | |
| 28 DISALLOW_COPY_AND_ASSIGN(ScopedLogAssertHandler); | |
| 29 }; | |
| 30 | |
| 31 } // namespace logging | |
| 32 | |
| 33 #endif // BASE_TEST_LOGGING_UTILS_H_ | |
| OLD | NEW |