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

Side by Side Diff: chrome/browser/sessions/session_backend.cc

Issue 10669038: base: Remove dereference structure operator (i.e ->) from ScopedVector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/sessions/session_backend.h" 5 #include "chrome/browser/sessions/session_backend.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 TimeTicks start_time = TimeTicks::Now(); 97 TimeTicks start_time = TimeTicks::Now();
98 read_count = file_->ReadUntilComplete(reinterpret_cast<char*>(&header), 98 read_count = file_->ReadUntilComplete(reinterpret_cast<char*>(&header),
99 sizeof(header)); 99 sizeof(header));
100 if (read_count != sizeof(header) || header.signature != kFileSignature || 100 if (read_count != sizeof(header) || header.signature != kFileSignature ||
101 header.version != kFileCurrentVersion) 101 header.version != kFileCurrentVersion)
102 return false; 102 return false;
103 103
104 ScopedVector<SessionCommand> read_commands; 104 ScopedVector<SessionCommand> read_commands;
105 SessionCommand* command; 105 SessionCommand* command;
106 while ((command = ReadCommand()) && !errored_) 106 while ((command = ReadCommand()) && !errored_)
107 read_commands->push_back(command); 107 read_commands.push_back(command);
108 if (!errored_) 108 if (!errored_)
109 read_commands->swap(*commands); 109 read_commands.swap(*commands);
110 if (type == BaseSessionService::TAB_RESTORE) { 110 if (type == BaseSessionService::TAB_RESTORE) {
111 UMA_HISTOGRAM_TIMES("TabRestore.read_session_file_time", 111 UMA_HISTOGRAM_TIMES("TabRestore.read_session_file_time",
112 TimeTicks::Now() - start_time); 112 TimeTicks::Now() - start_time);
113 } else { 113 } else {
114 UMA_HISTOGRAM_TIMES("SessionRestore.read_session_file_time", 114 UMA_HISTOGRAM_TIMES("SessionRestore.read_session_file_time",
115 TimeTicks::Now() - start_time); 115 TimeTicks::Now() - start_time);
116 } 116 }
117 return !errored_; 117 return !errored_;
118 } 118 }
119 119
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 399
400 FilePath SessionBackend::GetCurrentSessionPath() { 400 FilePath SessionBackend::GetCurrentSessionPath() {
401 FilePath path = path_to_dir_; 401 FilePath path = path_to_dir_;
402 if (type_ == BaseSessionService::TAB_RESTORE) 402 if (type_ == BaseSessionService::TAB_RESTORE)
403 path = path.AppendASCII(kCurrentTabSessionFileName); 403 path = path.AppendASCII(kCurrentTabSessionFileName);
404 else 404 else
405 path = path.AppendASCII(kCurrentSessionFileName); 405 path = path.AppendASCII(kCurrentSessionFileName);
406 return path; 406 return path;
407 } 407 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_fetcher.cc ('k') | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698