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

Unified Diff: device/bluetooth/bluetooth_device_win_unittest.cc

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_device_win_unittest.cc
diff --git a/device/bluetooth/bluetooth_device_win_unittest.cc b/device/bluetooth/bluetooth_device_win_unittest.cc
index d509296ac5a5ed052a23f695ca3659f9da19418d..c3989ac79a44124f96a06b1a1de1f9df8b02f784 100644
--- a/device/bluetooth/bluetooth_device_win_unittest.cc
+++ b/device/bluetooth/bluetooth_device_win_unittest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/test_simple_task_runner.h"
@@ -52,17 +53,17 @@ class BluetoothDeviceWinTest : public testing::Test {
device_state_->name = std::string(kDeviceName);
device_state_->address = kDeviceAddress;
- BluetoothTaskManagerWin::ServiceRecordState* audio_state =
- new BluetoothTaskManagerWin::ServiceRecordState();
+ auto audio_state =
+ base::MakeUnique<BluetoothTaskManagerWin::ServiceRecordState>();
audio_state->name = kTestAudioSdpName;
base::HexStringToBytes(kTestAudioSdpBytes, &audio_state->sdp_bytes);
- device_state_->service_record_states.push_back(audio_state);
+ device_state_->service_record_states.push_back(std::move(audio_state));
- BluetoothTaskManagerWin::ServiceRecordState* video_state =
- new BluetoothTaskManagerWin::ServiceRecordState();
+ auto video_state =
+ base::MakeUnique<BluetoothTaskManagerWin::ServiceRecordState>();
video_state->name = kTestVideoSdpName;
base::HexStringToBytes(kTestVideoSdpBytes, &video_state->sdp_bytes);
- device_state_->service_record_states.push_back(video_state);
+ device_state_->service_record_states.push_back(std::move(video_state));
device_.reset(new BluetoothDeviceWin(NULL, *device_state_, ui_task_runner,
socket_thread, NULL,

Powered by Google App Engine
This is Rietveld 408576698