summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/saved_files_service.cc8
-rw-r--r--apps/saved_files_service.h5
-rw-r--r--ash/system/chromeos/power/tray_power_unittest.cc8
-rw-r--r--media/midi/midi_manager_alsa.cc10
-rw-r--r--media/midi/midi_manager_alsa.h10
-rw-r--r--ui/message_center/popup_timer.cc7
-rw-r--r--ui/message_center/popup_timer.h5
7 files changed, 26 insertions, 27 deletions
diff --git a/apps/saved_files_service.cc b/apps/saved_files_service.cc
index 43a0062..e4a4fd9 100644
--- a/apps/saved_files_service.cc
+++ b/apps/saved_files_service.cc
@@ -275,10 +275,9 @@ void SavedFilesService::ClearQueue(const extensions::Extension* extension) {
SavedFilesService::SavedFiles* SavedFilesService::Get(
const std::string& extension_id) const {
- base::ScopedPtrMap<std::string, scoped_ptr<SavedFiles>>::const_iterator it =
- extension_id_to_saved_files_.find(extension_id);
+ auto it = extension_id_to_saved_files_.find(extension_id);
if (it != extension_id_to_saved_files_.end())
- return it->second;
+ return it->second.get();
return NULL;
}
@@ -292,7 +291,8 @@ SavedFilesService::SavedFiles* SavedFilesService::GetOrInsert(
scoped_ptr<SavedFiles> scoped_saved_files(
new SavedFiles(profile_, extension_id));
saved_files = scoped_saved_files.get();
- extension_id_to_saved_files_.insert(extension_id, scoped_saved_files.Pass());
+ extension_id_to_saved_files_.insert(
+ std::make_pair(extension_id, std::move(scoped_saved_files)));
return saved_files;
}
diff --git a/apps/saved_files_service.h b/apps/saved_files_service.h
index 6359116..0cf7d9c 100644
--- a/apps/saved_files_service.h
+++ b/apps/saved_files_service.h
@@ -5,11 +5,11 @@
#ifndef APPS_SAVED_FILES_SERVICE_H_
#define APPS_SAVED_FILES_SERVICE_H_
+#include <map>
#include <set>
#include <string>
#include <vector>
-#include "base/containers/scoped_ptr_map.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
@@ -127,8 +127,7 @@ class SavedFilesService : public KeyedService,
static void SetLruSizeForTest(int size);
static void ClearLruSizeForTest();
- base::ScopedPtrMap<std::string, scoped_ptr<SavedFiles>>
- extension_id_to_saved_files_;
+ std::map<std::string, scoped_ptr<SavedFiles>> extension_id_to_saved_files_;
content::NotificationRegistrar registrar_;
Profile* profile_;
diff --git a/ash/system/chromeos/power/tray_power_unittest.cc b/ash/system/chromeos/power/tray_power_unittest.cc
index 865519c..d0b9705 100644
--- a/ash/system/chromeos/power/tray_power_unittest.cc
+++ b/ash/system/chromeos/power/tray_power_unittest.cc
@@ -9,7 +9,6 @@
#include "ash/ash_switches.h"
#include "ash/test/ash_test_base.h"
-#include "base/containers/scoped_ptr_map.h"
#include "base/memory/scoped_ptr.h"
#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
#include "ui/message_center/fake_message_center.h"
@@ -30,7 +29,8 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
// message_center::FakeMessageCenter overrides:
void AddNotification(scoped_ptr<Notification> notification) override {
add_count_++;
- notifications_.insert(notification->id(), notification.Pass());
+ notifications_.insert(
+ std::make_pair(notification->id(), std::move(notification)));
}
void RemoveNotification(const std::string& id, bool by_user) override {
Notification* notification = FindVisibleNotificationById(id);
@@ -42,13 +42,13 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
Notification* FindVisibleNotificationById(const std::string& id) override {
auto it = notifications_.find(id);
- return it == notifications_.end() ? NULL : it->second;
+ return it == notifications_.end() ? NULL : it->second.get();
}
private:
int add_count_;
int remove_count_;
- base::ScopedPtrMap<std::string, scoped_ptr<Notification>> notifications_;
+ std::map<std::string, scoped_ptr<Notification>> notifications_;
DISALLOW_COPY_AND_ASSIGN(MockMessageCenter);
};
diff --git a/media/midi/midi_manager_alsa.cc b/media/midi/midi_manager_alsa.cc
index 9a10169..0ac9ecd 100644
--- a/media/midi/midi_manager_alsa.cc
+++ b/media/midi/midi_manager_alsa.cc
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <algorithm>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/json/json_string_value_serializer.h"
@@ -592,7 +593,8 @@ void MidiManagerAlsa::AlsaSeqState::ClientStart(int client_id,
const std::string& client_name,
snd_seq_client_type_t type) {
ClientExit(client_id);
- clients_.insert(client_id, make_scoped_ptr(new Client(client_name, type)));
+ clients_.insert(std::make_pair(
+ client_id, make_scoped_ptr(new Client(client_name, type))));
if (IsCardClient(type, client_id))
++card_client_count_;
}
@@ -645,7 +647,7 @@ MidiManagerAlsa::AlsaSeqState::ToMidiPortState(const AlsaCardMap& alsa_cards) {
int card_midi_device = -1;
for (const auto& client_pair : clients_) {
int client_id = client_pair.first;
- const auto& client = client_pair.second;
+ const auto& client = client_pair.second.get();
// Get client metadata.
const std::string client_name = client->name();
@@ -727,7 +729,7 @@ MidiManagerAlsa::AlsaSeqState::Client::~Client() = default;
void MidiManagerAlsa::AlsaSeqState::Client::AddPort(int addr,
scoped_ptr<Port> port) {
- ports_.set(addr, port.Pass());
+ ports_[addr] = std::move(port);
}
void MidiManagerAlsa::AlsaSeqState::Client::RemovePort(int addr) {
@@ -1119,7 +1121,7 @@ void MidiManagerAlsa::AddCard(udev_device* dev) {
if (midi_count > 0) {
scoped_ptr<AlsaCard> card(
new AlsaCard(dev, name, longname, driver, midi_count));
- alsa_cards_.insert(number, card.Pass());
+ alsa_cards_.insert(std::make_pair(number, std::move(card)));
alsa_card_midi_count_ += midi_count;
}
}
diff --git a/media/midi/midi_manager_alsa.h b/media/midi/midi_manager_alsa.h
index e577a65..2dd95e6 100644
--- a/media/midi/midi_manager_alsa.h
+++ b/media/midi/midi_manager_alsa.h
@@ -6,10 +6,10 @@
#define MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
#include <alsa/asoundlib.h>
+#include <map>
#include <vector>
#include "base/basictypes.h"
-#include "base/containers/scoped_ptr_map.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
@@ -42,7 +42,7 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ToMidiPortState);
class AlsaCard;
- typedef base::ScopedPtrMap<int, scoped_ptr<AlsaCard>> AlsaCardMap;
+ using AlsaCardMap = std::map<int, scoped_ptr<AlsaCard>>;
class MidiPort {
public:
@@ -269,7 +269,7 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
class Client {
public:
- typedef base::ScopedPtrMap<int, scoped_ptr<Port>> PortMap;
+ using PortMap = std::map<int, scoped_ptr<Port>>;
Client(const std::string& name, snd_seq_client_type_t type);
~Client();
@@ -289,9 +289,7 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
DISALLOW_COPY_AND_ASSIGN(Client);
};
- typedef base::ScopedPtrMap<int, scoped_ptr<Client>> ClientMap;
-
- ClientMap clients_;
+ std::map<int, scoped_ptr<Client>> clients_;
// This is the current number of clients we know about that have
// cards. When this number matches alsa_card_midi_count_, we know
diff --git a/ui/message_center/popup_timer.cc b/ui/message_center/popup_timer.cc
index dc27866..f19da62 100644
--- a/ui/message_center/popup_timer.cc
+++ b/ui/message_center/popup_timer.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/stl_util.h"
#include "ui/message_center/message_center_style.h"
#include "ui/message_center/message_center_types.h"
#include "ui/message_center/notification.h"
@@ -93,11 +94,11 @@ void PopupTimersController::StartTimer(const std::string& id,
scoped_ptr<PopupTimer> timer(new PopupTimer(id, timeout, AsWeakPtr()));
timer->Start();
- popup_timers_.insert(id, timer.Pass());
+ popup_timers_.insert(std::make_pair(id, std::move(timer)));
}
void PopupTimersController::StartAll() {
- for (auto& iter : popup_timers_)
+ for (const auto& iter : popup_timers_)
iter.second->Start();
}
@@ -115,7 +116,7 @@ void PopupTimersController::PauseTimer(const std::string& id) {
}
void PopupTimersController::PauseAll() {
- for (auto& iter : popup_timers_)
+ for (const auto& iter : popup_timers_)
iter.second->Pause();
}
diff --git a/ui/message_center/popup_timer.h b/ui/message_center/popup_timer.h
index f730732..a822ca8 100644
--- a/ui/message_center/popup_timer.h
+++ b/ui/message_center/popup_timer.h
@@ -5,10 +5,10 @@
#ifndef UI_MESSAGE_CENTER_POPUP_TIMER_H_
#define UI_MESSAGE_CENTER_POPUP_TIMER_H_
+#include <map>
#include <string>
#include <vector>
-#include "base/containers/scoped_ptr_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
@@ -118,8 +118,7 @@ class MESSAGE_CENTER_EXPORT PopupTimersController
MessageCenter* message_center_;
// The PopupTimerCollection contains all the managed timers by their ID.
- typedef base::ScopedPtrMap<std::string, scoped_ptr<PopupTimer>>
- PopupTimerCollection;
+ using PopupTimerCollection = std::map<std::string, scoped_ptr<PopupTimer>>;
PopupTimerCollection popup_timers_;
DISALLOW_COPY_AND_ASSIGN(PopupTimersController);