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

Unified Diff: chrome/browser/sessions/session_service.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jar feedback Created 8 years, 10 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: chrome/browser/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index c5864b1c72eb22d6cbcbd4ab360c8882e65cea0b..49ee9162e0a3f67bafeb6d5e77904d88288c51ea 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -1263,8 +1263,8 @@ bool SessionService::ReplacePendingCommand(SessionCommand* command) {
// well.
if (command->id() != kCommandUpdateTabNavigation)
return false;
- void* iterator = NULL;
scoped_ptr<Pickle> command_pickle(command->PayloadAsPickle());
+ PickleReader iterator(*command_pickle);
SessionID::id_type command_tab_id;
int command_nav_index;
if (!command_pickle->ReadInt(&iterator, &command_tab_id) ||
@@ -1282,7 +1282,7 @@ bool SessionService::ReplacePendingCommand(SessionCommand* command) {
// the command. Make sure we delete the pickle before the command, else
// the pickle references deleted memory.
scoped_ptr<Pickle> existing_pickle(existing_command->PayloadAsPickle());
- iterator = NULL;
+ iterator = PickleReader(*existing_pickle);
if (!existing_pickle->ReadInt(&iterator, &existing_tab_id) ||
!existing_pickle->ReadInt(&iterator, &existing_nav_index)) {
return false;

Powered by Google App Engine
This is Rietveld 408576698