OLD | NEW |
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/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 // However, what if new conditions are added and | 609 // However, what if new conditions are added and |
610 // NeedMatchCompleteDummyForFinalStatus is not being updated. Not sure | 610 // NeedMatchCompleteDummyForFinalStatus is not being updated. Not sure |
611 // what's the best thing to do here. For now, I will just check whether | 611 // what's the best thing to do here. For now, I will just check whether |
612 // we are actually prerendering. | 612 // we are actually prerendering. |
613 (*it)->MakeIntoMatchCompleteReplacement(); | 613 (*it)->MakeIntoMatchCompleteReplacement(); |
614 } else { | 614 } else { |
615 to_delete_prerenders_.push_back(*it); | 615 to_delete_prerenders_.push_back(*it); |
616 active_prerenders_.weak_erase(it); | 616 active_prerenders_.weak_erase(it); |
617 } | 617 } |
618 | 618 |
619 // Destroy the old WebContents relatively promptly to reduce resource usage, | 619 // Destroy the old WebContents relatively promptly to reduce resource usage. |
620 // and in the case of HTML5 media, reduce the chance of playing any sound. | |
621 PostCleanupTask(); | 620 PostCleanupTask(); |
622 } | 621 } |
623 | 622 |
624 // static | 623 // static |
625 void PrerenderManager::RecordPerceivedPageLoadTime( | 624 void PrerenderManager::RecordPerceivedPageLoadTime( |
626 base::TimeDelta perceived_page_load_time, | 625 base::TimeDelta perceived_page_load_time, |
627 double fraction_plt_elapsed_at_swap_in, | 626 double fraction_plt_elapsed_at_swap_in, |
628 WebContents* web_contents, | 627 WebContents* web_contents, |
629 const GURL& url) { | 628 const GURL& url) { |
630 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 629 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 logged_in_state_->erase(domain_key); | 1565 logged_in_state_->erase(domain_key); |
1567 } | 1566 } |
1568 | 1567 |
1569 void PrerenderManager::LoggedInPredictorDataReceived( | 1568 void PrerenderManager::LoggedInPredictorDataReceived( |
1570 scoped_ptr<LoggedInStateMap> new_map) { | 1569 scoped_ptr<LoggedInStateMap> new_map) { |
1571 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1570 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1572 logged_in_state_.swap(new_map); | 1571 logged_in_state_.swap(new_map); |
1573 } | 1572 } |
1574 | 1573 |
1575 } // namespace prerender | 1574 } // namespace prerender |
OLD | NEW |