| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 | 749 |
| 750 // static | 750 // static |
| 751 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { | 751 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { |
| 752 return (url.SchemeIsHTTPOrHTTPS() || | 752 return (url.SchemeIsHTTPOrHTTPS() || |
| 753 url.SchemeIs(extensions::kExtensionScheme) || | 753 url.SchemeIs(extensions::kExtensionScheme) || |
| 754 url.SchemeIs("data")); | 754 url.SchemeIs("data")); |
| 755 } | 755 } |
| 756 | 756 |
| 757 // static | 757 // static |
| 758 bool PrerenderManager::DoesSubresourceURLHaveValidScheme(const GURL& url) { | 758 bool PrerenderManager::DoesSubresourceURLHaveValidScheme(const GURL& url) { |
| 759 return DoesURLHaveValidScheme(url) || url == GURL(url::kAboutBlankURL); | 759 return DoesURLHaveValidScheme(url) || url.spec() == url::kAboutBlankURL; |
| 760 } | 760 } |
| 761 | 761 |
| 762 std::unique_ptr<base::DictionaryValue> PrerenderManager::GetAsValue() const { | 762 std::unique_ptr<base::DictionaryValue> PrerenderManager::GetAsValue() const { |
| 763 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 763 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 764 | 764 |
| 765 auto dict_value = base::MakeUnique<base::DictionaryValue>(); | 765 auto dict_value = base::MakeUnique<base::DictionaryValue>(); |
| 766 dict_value->Set("history", prerender_history_->GetEntriesAsValue()); | 766 dict_value->Set("history", prerender_history_->GetEntriesAsValue()); |
| 767 dict_value->Set("active", GetActivePrerendersAsValue()); | 767 dict_value->Set("active", GetActivePrerendersAsValue()); |
| 768 dict_value->SetBoolean("enabled", | 768 dict_value->SetBoolean("enabled", |
| 769 GetPredictionStatus() == NetworkPredictionStatus::ENABLED); | 769 GetPredictionStatus() == NetworkPredictionStatus::ENABLED); |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 DCHECK_EQ(1u, erased); | 1366 DCHECK_EQ(1u, erased); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 void PrerenderManager::SetPrerenderContentsFactoryForTest( | 1369 void PrerenderManager::SetPrerenderContentsFactoryForTest( |
| 1370 PrerenderContents::Factory* prerender_contents_factory) { | 1370 PrerenderContents::Factory* prerender_contents_factory) { |
| 1371 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1371 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1372 prerender_contents_factory_.reset(prerender_contents_factory); | 1372 prerender_contents_factory_.reset(prerender_contents_factory); |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 } // namespace prerender | 1375 } // namespace prerender |
| OLD | NEW |