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

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: compile (racing with incoming CLs) Created 8 years, 9 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 2ba33b55f893a246d913acf845c8ea4576f80c8d..dcd56f0e0abfd33b9de73ebd71ede1e7ef205016 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -1304,8 +1304,8 @@ bool SessionService::ReplacePendingCommand(SessionCommand* command) {
// well.
if (command->id() != kCommandUpdateTabNavigation)
return false;
- void* iterator = NULL;
scoped_ptr<Pickle> command_pickle(command->PayloadAsPickle());
+ PickleIterator iterator(*command_pickle);
SessionID::id_type command_tab_id;
int command_nav_index;
if (!command_pickle->ReadInt(&iterator, &command_tab_id) ||
@@ -1323,7 +1323,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 = PickleIterator(*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