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

Side by Side Diff: components/sessions/base_session_service_commands.cc

Issue 818833004: Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/sessions/base_session_service_commands.h" 5 #include "components/sessions/base_session_service_commands.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "components/sessions/session_backend.h" 8 #include "components/sessions/session_backend.h"
9 #include "components/sessions/session_types.h" 9 #include "components/sessions/session_types.h"
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 bool RestoreUpdateTabNavigationCommand( 104 bool RestoreUpdateTabNavigationCommand(
105 const SessionCommand& command, 105 const SessionCommand& command,
106 sessions::SerializedNavigationEntry* navigation, 106 sessions::SerializedNavigationEntry* navigation,
107 SessionID::id_type* tab_id) { 107 SessionID::id_type* tab_id) {
108 scoped_ptr<Pickle> pickle(command.PayloadAsPickle()); 108 scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
109 if (!pickle.get()) 109 if (!pickle.get())
110 return false; 110 return false;
111 PickleIterator iterator(*pickle); 111 PickleIterator iterator(*pickle);
112 return pickle->ReadInt(&iterator, tab_id) && 112 return iterator.ReadInt(tab_id) && navigation->ReadFromPickle(&iterator);
113 navigation->ReadFromPickle(&iterator);
114 } 113 }
115 114
116 bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command, 115 bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command,
117 SessionID::id_type* tab_id, 116 SessionID::id_type* tab_id,
118 std::string* extension_app_id) { 117 std::string* extension_app_id) {
119 scoped_ptr<Pickle> pickle(command.PayloadAsPickle()); 118 scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
120 if (!pickle.get()) 119 if (!pickle.get())
121 return false; 120 return false;
122 121
123 PickleIterator iterator(*pickle); 122 PickleIterator iterator(*pickle);
124 return pickle->ReadInt(&iterator, tab_id) && 123 return iterator.ReadInt(tab_id) && iterator.ReadString(extension_app_id);
125 pickle->ReadString(&iterator, extension_app_id);
126 } 124 }
127 125
128 bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command, 126 bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command,
129 SessionID::id_type* tab_id, 127 SessionID::id_type* tab_id,
130 std::string* user_agent_override) { 128 std::string* user_agent_override) {
131 scoped_ptr<Pickle> pickle(command.PayloadAsPickle()); 129 scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
132 if (!pickle.get()) 130 if (!pickle.get())
133 return false; 131 return false;
134 132
135 PickleIterator iterator(*pickle); 133 PickleIterator iterator(*pickle);
136 return pickle->ReadInt(&iterator, tab_id) && 134 return iterator.ReadInt(tab_id) && iterator.ReadString(user_agent_override);
137 pickle->ReadString(&iterator, user_agent_override);
138 } 135 }
139 136
140 bool RestoreSetWindowAppNameCommand(const SessionCommand& command, 137 bool RestoreSetWindowAppNameCommand(const SessionCommand& command,
141 SessionID::id_type* window_id, 138 SessionID::id_type* window_id,
142 std::string* app_name) { 139 std::string* app_name) {
143 scoped_ptr<Pickle> pickle(command.PayloadAsPickle()); 140 scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
144 if (!pickle.get()) 141 if (!pickle.get())
145 return false; 142 return false;
146 143
147 PickleIterator iterator(*pickle); 144 PickleIterator iterator(*pickle);
148 return pickle->ReadInt(&iterator, window_id) && 145 return iterator.ReadInt(window_id) && iterator.ReadString(app_name);
149 pickle->ReadString(&iterator, app_name);
150 } 146 }
151 147
152 } // namespace sessions 148 } // namespace sessions
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data.cc ('k') | components/sessions/session_service_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698