| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sessions/session_service.h" | 7 #include "chrome/browser/sessions/session_service.h" |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 NewCallback(this, &SessionService::OnGotSessionCommands), | 410 NewCallback(this, &SessionService::OnGotSessionCommands), |
| 411 callback), consumer); | 411 callback), consumer); |
| 412 } | 412 } |
| 413 | 413 |
| 414 SessionService::Handle SessionService::GetCurrentSession( | 414 SessionService::Handle SessionService::GetCurrentSession( |
| 415 CancelableRequestConsumerBase* consumer, | 415 CancelableRequestConsumerBase* consumer, |
| 416 SessionCallback* callback) { | 416 SessionCallback* callback) { |
| 417 if (pending_window_close_ids_.empty()) { | 417 if (pending_window_close_ids_.empty()) { |
| 418 // If there are no pending window closes, we can get the current session | 418 // If there are no pending window closes, we can get the current session |
| 419 // from memory. | 419 // from memory. |
| 420 scoped_refptr<InternalSessionRequest> request = new InternalSessionRequest( | 420 scoped_refptr<InternalSessionRequest> request(new InternalSessionRequest( |
| 421 NewCallback(this, &SessionService::OnGotSessionCommands), | 421 NewCallback(this, &SessionService::OnGotSessionCommands), |
| 422 callback); | 422 callback)); |
| 423 AddRequest(request, consumer); | 423 AddRequest(request, consumer); |
| 424 IdToRange tab_to_available_range; | 424 IdToRange tab_to_available_range; |
| 425 std::set<SessionID::id_type> windows_to_track; | 425 std::set<SessionID::id_type> windows_to_track; |
| 426 BuildCommandsFromBrowsers(&(request->commands), | 426 BuildCommandsFromBrowsers(&(request->commands), |
| 427 &tab_to_available_range, | 427 &tab_to_available_range, |
| 428 &windows_to_track); | 428 &windows_to_track); |
| 429 request->ForwardResult( | 429 request->ForwardResult( |
| 430 BaseSessionService::InternalGetCommandsRequest::TupleType( | 430 BaseSessionService::InternalGetCommandsRequest::TupleType( |
| 431 request->handle(), request)); | 431 request->handle(), request)); |
| 432 return request->handle(); | 432 return request->handle(); |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 50); | 1466 50); |
| 1467 if (use_long_period) { | 1467 if (use_long_period) { |
| 1468 std::string long_name_("SessionRestore.SaveLongPeriod"); | 1468 std::string long_name_("SessionRestore.SaveLongPeriod"); |
| 1469 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_, | 1469 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_, |
| 1470 delta, | 1470 delta, |
| 1471 save_delay_in_mins_, | 1471 save_delay_in_mins_, |
| 1472 save_delay_in_hrs_, | 1472 save_delay_in_hrs_, |
| 1473 50); | 1473 50); |
| 1474 } | 1474 } |
| 1475 } | 1475 } |
| OLD | NEW |