Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 Log2("operator==", a, b); | 58 Log2("operator==", a, b); |
| 59 return a.origin_ == b.origin_; | 59 return a.origin_ == b.origin_; |
| 60 } | 60 } |
| 61 friend bool operator!=(const Logger& a, const Logger& b) { | 61 friend bool operator!=(const Logger& a, const Logger& b) { |
| 62 Log2("operator!=", a, b); | 62 Log2("operator!=", a, b); |
| 63 return a.origin_ != b.origin_; | 63 return a.origin_ != b.origin_; |
| 64 } | 64 } |
| 65 void Foo() { Log("Foo()"); } | 65 void Foo() { Log("Foo()"); } |
| 66 void Foo() const { Log("Foo() const"); } | 66 void Foo() const { Log("Foo() const"); } |
| 67 static rtc::scoped_ptr<std::vector<std::string>> Setup() { | 67 static rtc::scoped_ptr<std::vector<std::string>> Setup() { |
| 68 auto s = rtc_make_scoped_ptr(new std::vector<std::string>); | 68 auto s = |
| 69 rtc::scoped_ptr<std::vector<std::string>>(new std::vector<std::string>); | |
| 69 Logger::log_ = s.get(); | 70 Logger::log_ = s.get(); |
|
tommi
2016/03/15 09:22:09
Wow... Can this just return a vector instead? (mov
kwiberg-webrtc
2016/03/15 09:59:41
Yeah, I was about to send the author a sharply-wor
tommi (sloooow) - chröme
2016/03/15 16:49:00
OK. Btw we shouldn't use auto when it actually ma
kwiberg-webrtc
2016/03/15 18:53:37
Yeah, thanks for catching that. Fixed.
| |
| 70 Logger::next_id_ = 0; | 71 Logger::next_id_ = 0; |
| 71 return s; | 72 return s; |
| 72 } | 73 } |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 int id_; | 76 int id_; |
| 76 int origin_; | 77 int origin_; |
| 77 static std::vector<std::string>* log_; | 78 static std::vector<std::string>* log_; |
| 78 static int next_id_; | 79 static int next_id_; |
| 79 void Log(const char* msg) const { | 80 void Log(const char* msg) const { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 480 "4:17. copy constructor (from 0:17)", "5:5. default constructor", | 481 "4:17. copy constructor (from 0:17)", "5:5. default constructor", |
| 481 "6:6. default constructor", "7:7. default constructor", "---", | 482 "6:6. default constructor", "7:7. default constructor", "---", |
| 482 "swap 2:42, 3:17", "swap 4:5, 5:17", "swap 6:7, 7:6", "---", | 483 "swap 2:42, 3:17", "swap 4:5, 5:17", "swap 6:7, 7:6", "---", |
| 483 "7:6. destructor", "6:7. destructor", "5:17. destructor", | 484 "7:6. destructor", "6:7. destructor", "5:17. destructor", |
| 484 "4:5. destructor", "3:17. destructor", "2:42. destructor", | 485 "4:5. destructor", "3:17. destructor", "2:42. destructor", |
| 485 "1:42. destructor", "0:17. destructor"), | 486 "1:42. destructor", "0:17. destructor"), |
| 486 *log); | 487 *log); |
| 487 } | 488 } |
| 488 | 489 |
| 489 } // namespace rtc | 490 } // namespace rtc |
| OLD | NEW |