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

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

Issue 137263007: Move CancelableTaskTracker to //base/task/CancelableTaskTracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to base/task/cancelable_task_tracker* Created 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sessions/session_backend.h ('k') | chrome/browser/sessions/session_restore.cc » ('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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if (current_session_file_.get() && current_session_file_->IsOpen() && 237 if (current_session_file_.get() && current_session_file_->IsOpen() &&
238 !AppendCommandsToFile(current_session_file_.get(), *commands)) { 238 !AppendCommandsToFile(current_session_file_.get(), *commands)) {
239 current_session_file_.reset(NULL); 239 current_session_file_.reset(NULL);
240 } 240 }
241 empty_file_ = false; 241 empty_file_ = false;
242 STLDeleteElements(commands); 242 STLDeleteElements(commands);
243 delete commands; 243 delete commands;
244 } 244 }
245 245
246 void SessionBackend::ReadLastSessionCommands( 246 void SessionBackend::ReadLastSessionCommands(
247 const CancelableTaskTracker::IsCanceledCallback& is_canceled, 247 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled,
248 const BaseSessionService::InternalGetCommandsCallback& callback) { 248 const BaseSessionService::InternalGetCommandsCallback& callback) {
249 if (is_canceled.Run()) 249 if (is_canceled.Run())
250 return; 250 return;
251 251
252 Init(); 252 Init();
253 253
254 ScopedVector<SessionCommand> commands; 254 ScopedVector<SessionCommand> commands;
255 ReadLastSessionCommandsImpl(&(commands.get())); 255 ReadLastSessionCommandsImpl(&(commands.get()));
256 callback.Run(commands.Pass()); 256 callback.Run(commands.Pass());
257 } 257 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 399
400 base::FilePath SessionBackend::GetCurrentSessionPath() { 400 base::FilePath SessionBackend::GetCurrentSessionPath() {
401 base::FilePath path = path_to_dir_; 401 base::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/sessions/session_backend.h ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698