| 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 | 919 |
| 920 // static | 920 // static |
| 921 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { | 921 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { |
| 922 return (url.SchemeIsHTTPOrHTTPS() || | 922 return (url.SchemeIsHTTPOrHTTPS() || |
| 923 url.SchemeIs(extensions::kExtensionScheme) || | 923 url.SchemeIs(extensions::kExtensionScheme) || |
| 924 url.SchemeIs("data")); | 924 url.SchemeIs("data")); |
| 925 } | 925 } |
| 926 | 926 |
| 927 // static | 927 // static |
| 928 bool PrerenderManager::DoesSubresourceURLHaveValidScheme(const GURL& url) { | 928 bool PrerenderManager::DoesSubresourceURLHaveValidScheme(const GURL& url) { |
| 929 return DoesURLHaveValidScheme(url) || url == GURL(content::kAboutBlankURL); | 929 return DoesURLHaveValidScheme(url) || url == GURL(url::kAboutBlankURL); |
| 930 } | 930 } |
| 931 | 931 |
| 932 base::DictionaryValue* PrerenderManager::GetAsValue() const { | 932 base::DictionaryValue* PrerenderManager::GetAsValue() const { |
| 933 DCHECK(CalledOnValidThread()); | 933 DCHECK(CalledOnValidThread()); |
| 934 base::DictionaryValue* dict_value = new base::DictionaryValue(); | 934 base::DictionaryValue* dict_value = new base::DictionaryValue(); |
| 935 dict_value->Set("history", prerender_history_->GetEntriesAsValue()); | 935 dict_value->Set("history", prerender_history_->GetEntriesAsValue()); |
| 936 dict_value->Set("active", GetActivePrerendersAsValue()); | 936 dict_value->Set("active", GetActivePrerendersAsValue()); |
| 937 dict_value->SetBoolean("enabled", enabled_); | 937 dict_value->SetBoolean("enabled", enabled_); |
| 938 dict_value->SetBoolean("omnibox_enabled", IsOmniboxEnabled(profile_)); | 938 dict_value->SetBoolean("omnibox_enabled", IsOmniboxEnabled(profile_)); |
| 939 // If prerender is disabled via a flag this method is not even called. | 939 // If prerender is disabled via a flag this method is not even called. |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 content::RenderProcessHost* host) { | 1913 content::RenderProcessHost* host) { |
| 1914 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1914 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1915 prerender_process_hosts_.erase(host); | 1915 prerender_process_hosts_.erase(host); |
| 1916 BrowserThread::PostTask( | 1916 BrowserThread::PostTask( |
| 1917 BrowserThread::IO, FROM_HERE, | 1917 BrowserThread::IO, FROM_HERE, |
| 1918 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread, | 1918 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread, |
| 1919 base::Unretained(prerender_tracker()), host->GetID(), false)); | 1919 base::Unretained(prerender_tracker()), host->GetID(), false)); |
| 1920 } | 1920 } |
| 1921 | 1921 |
| 1922 } // namespace prerender | 1922 } // namespace prerender |
| OLD | NEW |