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

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

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/http/transport_security_state.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_factory.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/net_log.h" 5 #include "net/log/net_log.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 25 matching lines...) Expand all
36 return 1; 36 return 1;
37 if (capture_mode == NetLogCaptureMode::IncludeSocketBytes()) 37 if (capture_mode == NetLogCaptureMode::IncludeSocketBytes())
38 return 2; 38 return 2;
39 39
40 ADD_FAILURE() << "Unknown capture mode"; 40 ADD_FAILURE() << "Unknown capture mode";
41 return -1; 41 return -1;
42 } 42 }
43 43
44 std::unique_ptr<base::Value> CaptureModeToValue( 44 std::unique_ptr<base::Value> CaptureModeToValue(
45 NetLogCaptureMode capture_mode) { 45 NetLogCaptureMode capture_mode) {
46 return base::WrapUnique( 46 return base::MakeUnique<base::FundamentalValue>(
47 new base::FundamentalValue(CaptureModeToInt(capture_mode))); 47 CaptureModeToInt(capture_mode));
48 } 48 }
49 49
50 std::unique_ptr<base::Value> NetCaptureModeCallback( 50 std::unique_ptr<base::Value> NetCaptureModeCallback(
51 NetLogCaptureMode capture_mode) { 51 NetLogCaptureMode capture_mode) {
52 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 52 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
53 dict->Set("capture_mode", CaptureModeToValue(capture_mode)); 53 dict->Set("capture_mode", CaptureModeToValue(capture_mode));
54 return std::move(dict); 54 return std::move(dict);
55 } 55 }
56 56
57 TEST(NetLogTest, Basic) { 57 TEST(NetLogTest, Basic) {
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 NetLog net_log; 398 NetLog net_log;
399 399
400 // Run a bunch of threads to completion, each of which will repeatedly add 400 // Run a bunch of threads to completion, each of which will repeatedly add
401 // and remove an observer, and set its logging level. 401 // and remove an observer, and set its logging level.
402 RunTestThreads<AddRemoveObserverTestThread>(&net_log); 402 RunTestThreads<AddRemoveObserverTestThread>(&net_log);
403 } 403 }
404 404
405 } // namespace 405 } // namespace
406 406
407 } // namespace net 407 } // namespace net
OLDNEW
« no previous file with comments | « net/http/transport_security_state.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698