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

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

Issue 694813003: Changing SessionService to have a BaseSessionService, not being one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser tests Created 6 years, 1 month 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
« no previous file with comments | « chrome/browser/sessions/session_backend.h ('k') | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Need to check current_session_file_ again, ResetFile may fail. 233 // Need to check current_session_file_ again, ResetFile may fail.
234 if (current_session_file_.get() && current_session_file_->IsValid() && 234 if (current_session_file_.get() && current_session_file_->IsValid() &&
235 !AppendCommandsToFile(current_session_file_.get(), commands)) { 235 !AppendCommandsToFile(current_session_file_.get(), commands)) {
236 current_session_file_.reset(NULL); 236 current_session_file_.reset(NULL);
237 } 237 }
238 empty_file_ = false; 238 empty_file_ = false;
239 } 239 }
240 240
241 void SessionBackend::ReadLastSessionCommands( 241 void SessionBackend::ReadLastSessionCommands(
242 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled, 242 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled,
243 const BaseSessionService::InternalGetCommandsCallback& callback) { 243 const BaseSessionService::GetCommandsCallback& callback) {
244 if (is_canceled.Run()) 244 if (is_canceled.Run())
245 return; 245 return;
246 246
247 Init(); 247 Init();
248 248
249 ScopedVector<SessionCommand> commands; 249 ScopedVector<SessionCommand> commands;
250 ReadLastSessionCommandsImpl(&commands); 250 ReadLastSessionCommandsImpl(&commands);
251 callback.Run(commands.Pass()); 251 callback.Run(commands.Pass());
252 } 252 }
253 253
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 base::FilePath SessionBackend::GetCurrentSessionPath() { 395 base::FilePath SessionBackend::GetCurrentSessionPath() {
396 base::FilePath path = path_to_dir_; 396 base::FilePath path = path_to_dir_;
397 if (type_ == BaseSessionService::TAB_RESTORE) 397 if (type_ == BaseSessionService::TAB_RESTORE)
398 path = path.AppendASCII(kCurrentTabSessionFileName); 398 path = path.AppendASCII(kCurrentTabSessionFileName);
399 else 399 else
400 path = path.AppendASCII(kCurrentSessionFileName); 400 path = path.AppendASCII(kCurrentSessionFileName);
401 return path; 401 return path;
402 } 402 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_backend.h ('k') | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698