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

Side by Side Diff: net/log/test_net_log.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 months 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 | « net/log/test_net_log.h ('k') | net/log/test_net_log_entry.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/log/test_net_log.h" 5 #include "net/log/test_net_log.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void Clear() { 43 void Clear() {
44 base::AutoLock lock(lock_); 44 base::AutoLock lock(lock_);
45 entry_list_.clear(); 45 entry_list_.clear();
46 } 46 }
47 47
48 private: 48 private:
49 // ThreadSafeObserver implementation: 49 // ThreadSafeObserver implementation:
50 void OnAddEntry(const NetLog::Entry& entry) override { 50 void OnAddEntry(const NetLog::Entry& entry) override {
51 // Using Dictionaries instead of Values makes checking values a little 51 // Using Dictionaries instead of Values makes checking values a little
52 // simpler. 52 // simpler.
53 scoped_ptr<base::DictionaryValue> param_dict = 53 std::unique_ptr<base::DictionaryValue> param_dict =
54 base::DictionaryValue::From(entry.ParametersToValue()); 54 base::DictionaryValue::From(entry.ParametersToValue());
55 55
56 // Only need to acquire the lock when accessing class variables. 56 // Only need to acquire the lock when accessing class variables.
57 base::AutoLock lock(lock_); 57 base::AutoLock lock(lock_);
58 entry_list_.push_back(TestNetLogEntry(entry.type(), base::TimeTicks::Now(), 58 entry_list_.push_back(TestNetLogEntry(entry.type(), base::TimeTicks::Now(),
59 entry.source(), entry.phase(), 59 entry.source(), entry.phase(),
60 std::move(param_dict))); 60 std::move(param_dict)));
61 } 61 }
62 62
63 // Needs to be "mutable" to use it in GetEntries(). 63 // Needs to be "mutable" to use it in GetEntries().
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void BoundTestNetLog::Clear() { 126 void BoundTestNetLog::Clear() {
127 test_net_log_.Clear(); 127 test_net_log_.Clear();
128 } 128 }
129 129
130 void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) { 130 void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) {
131 test_net_log_.SetCaptureMode(capture_mode); 131 test_net_log_.SetCaptureMode(capture_mode);
132 } 132 }
133 133
134 } // namespace net 134 } // namespace net
OLDNEW
« no previous file with comments | « net/log/test_net_log.h ('k') | net/log/test_net_log_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698