| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 config_.max_age); | 475 config_.max_age); |
| 476 } | 476 } |
| 477 | 477 |
| 478 histograms_->RecordPerSessionCount(++prerenders_per_session_count_); | 478 histograms_->RecordPerSessionCount(++prerenders_per_session_count_); |
| 479 prerender_contents->set_final_status(FINAL_STATUS_USED); | 479 prerender_contents->set_final_status(FINAL_STATUS_USED); |
| 480 | 480 |
| 481 RenderViewHost* render_view_host = | 481 RenderViewHost* render_view_host = |
| 482 prerender_contents->prerender_contents()->render_view_host(); | 482 prerender_contents->prerender_contents()->render_view_host(); |
| 483 DCHECK(render_view_host); | 483 DCHECK(render_view_host); |
| 484 render_view_host->Send( | 484 render_view_host->Send( |
| 485 new ViewMsg_SetIsPrerendering(render_view_host->routing_id(), false)); | 485 new ChromeViewMsg_SetIsPrerendering(render_view_host->routing_id(), |
| 486 false)); |
| 486 | 487 |
| 487 TabContentsWrapper* new_tab_contents = | 488 TabContentsWrapper* new_tab_contents = |
| 488 prerender_contents->ReleasePrerenderContents(); | 489 prerender_contents->ReleasePrerenderContents(); |
| 489 TabContentsWrapper* old_tab_contents = | 490 TabContentsWrapper* old_tab_contents = |
| 490 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); | 491 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); |
| 491 DCHECK(new_tab_contents); | 492 DCHECK(new_tab_contents); |
| 492 DCHECK(old_tab_contents); | 493 DCHECK(old_tab_contents); |
| 493 | 494 |
| 494 MarkTabContentsAsPrerendered(new_tab_contents->tab_contents()); | 495 MarkTabContentsAsPrerendered(new_tab_contents->tab_contents()); |
| 495 | 496 |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 DeletePendingDeleteEntries(); | 952 DeletePendingDeleteEntries(); |
| 952 } | 953 } |
| 953 | 954 |
| 954 void PrerenderManager::RecordFinalStatus(Origin origin, | 955 void PrerenderManager::RecordFinalStatus(Origin origin, |
| 955 uint8 experiment_id, | 956 uint8 experiment_id, |
| 956 FinalStatus final_status) const { | 957 FinalStatus final_status) const { |
| 957 histograms_->RecordFinalStatus(origin, experiment_id, final_status); | 958 histograms_->RecordFinalStatus(origin, experiment_id, final_status); |
| 958 } | 959 } |
| 959 | 960 |
| 960 } // namespace prerender | 961 } // namespace prerender |
| OLD | NEW |