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

Unified Diff: components/sessions/core/base_session_service_commands.cc

Issue 1912843002: Convert //components/sessions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/sessions/core/base_session_service_commands.cc
diff --git a/components/sessions/core/base_session_service_commands.cc b/components/sessions/core/base_session_service_commands.cc
index ef273b297096936af9ddf45d5c3957ba990cfb9c..934f13d6596f6bf9c1a39d4309871fa16271bc3f 100644
--- a/components/sessions/core/base_session_service_commands.cc
+++ b/components/sessions/core/base_session_service_commands.cc
@@ -31,7 +31,7 @@ void WriteStringToPickle(base::Pickle& pickle,
} // namespace
-scoped_ptr<SessionCommand> CreateUpdateTabNavigationCommand(
+std::unique_ptr<SessionCommand> CreateUpdateTabNavigationCommand(
SessionID::id_type command_id,
SessionID::id_type tab_id,
const sessions::SerializedNavigationEntry& navigation) {
@@ -43,10 +43,11 @@ scoped_ptr<SessionCommand> CreateUpdateTabNavigationCommand(
static const size_t max_state_size =
std::numeric_limits<SessionCommand::size_type>::max() - 1024;
navigation.WriteToPickle(max_state_size, &pickle);
- return scoped_ptr<SessionCommand>(new SessionCommand(command_id, pickle));
+ return std::unique_ptr<SessionCommand>(
+ new SessionCommand(command_id, pickle));
}
-scoped_ptr<SessionCommand> CreateSetTabExtensionAppIDCommand(
+std::unique_ptr<SessionCommand> CreateSetTabExtensionAppIDCommand(
SessionID::id_type command_id,
SessionID::id_type tab_id,
const std::string& extension_id) {
@@ -62,10 +63,11 @@ scoped_ptr<SessionCommand> CreateSetTabExtensionAppIDCommand(
WriteStringToPickle(pickle, &bytes_written, max_id_size, extension_id);
- return scoped_ptr<SessionCommand>(new SessionCommand(command_id, pickle));
+ return std::unique_ptr<SessionCommand>(
+ new SessionCommand(command_id, pickle));
}
-scoped_ptr<SessionCommand> CreateSetTabUserAgentOverrideCommand(
+std::unique_ptr<SessionCommand> CreateSetTabUserAgentOverrideCommand(
SessionID::id_type command_id,
SessionID::id_type tab_id,
const std::string& user_agent_override) {
@@ -83,10 +85,11 @@ scoped_ptr<SessionCommand> CreateSetTabUserAgentOverrideCommand(
WriteStringToPickle(pickle, &bytes_written, max_user_agent_size,
user_agent_override);
- return scoped_ptr<SessionCommand>(new SessionCommand(command_id, pickle));
+ return std::unique_ptr<SessionCommand>(
+ new SessionCommand(command_id, pickle));
}
-scoped_ptr<SessionCommand> CreateSetWindowAppNameCommand(
+std::unique_ptr<SessionCommand> CreateSetWindowAppNameCommand(
SessionID::id_type command_id,
SessionID::id_type window_id,
const std::string& app_name) {
@@ -102,14 +105,15 @@ scoped_ptr<SessionCommand> CreateSetWindowAppNameCommand(
WriteStringToPickle(pickle, &bytes_written, max_id_size, app_name);
- return scoped_ptr<SessionCommand>(new SessionCommand(command_id, pickle));
+ return std::unique_ptr<SessionCommand>(
+ new SessionCommand(command_id, pickle));
}
bool RestoreUpdateTabNavigationCommand(
const SessionCommand& command,
sessions::SerializedNavigationEntry* navigation,
SessionID::id_type* tab_id) {
- scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
+ std::unique_ptr<base::Pickle> pickle(command.PayloadAsPickle());
if (!pickle.get())
return false;
base::PickleIterator iterator(*pickle);
@@ -119,7 +123,7 @@ bool RestoreUpdateTabNavigationCommand(
bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command,
SessionID::id_type* tab_id,
std::string* extension_app_id) {
- scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
+ std::unique_ptr<base::Pickle> pickle(command.PayloadAsPickle());
if (!pickle.get())
return false;
@@ -130,7 +134,7 @@ bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command,
bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command,
SessionID::id_type* tab_id,
std::string* user_agent_override) {
- scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
+ std::unique_ptr<base::Pickle> pickle(command.PayloadAsPickle());
if (!pickle.get())
return false;
@@ -141,7 +145,7 @@ bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command,
bool RestoreSetWindowAppNameCommand(const SessionCommand& command,
SessionID::id_type* window_id,
std::string* app_name) {
- scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
+ std::unique_ptr<base::Pickle> pickle(command.PayloadAsPickle());
if (!pickle.get())
return false;
« no previous file with comments | « components/sessions/core/base_session_service_commands.h ('k') | components/sessions/core/base_session_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698