| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 current = edge.url; | 399 current = edge.url; |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 void ClearResources() { resources_.clear(); } | 403 void ClearResources() { resources_.clear(); } |
| 404 | 404 |
| 405 void ClearCache() { | 405 void ClearCache() { |
| 406 BrowsingDataRemover* remover = | 406 BrowsingDataRemover* remover = |
| 407 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 407 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
| 408 BrowsingDataRemoverObserver observer(remover); | 408 BrowsingDataRemoverObserver observer(remover); |
| 409 remover->RemoveAndReply(BrowsingDataRemover::Unbounded(), | 409 remover->RemoveAndReply(base::Time(), base::Time::Max(), |
| 410 BrowsingDataRemover::REMOVE_CACHE, | 410 BrowsingDataRemover::REMOVE_CACHE, |
| 411 BrowsingDataHelper::UNPROTECTED_WEB, &observer); | 411 BrowsingDataHelper::UNPROTECTED_WEB, &observer); |
| 412 observer.Wait(); | 412 observer.Wait(); |
| 413 | 413 |
| 414 for (auto& kv : resources_) | 414 for (auto& kv : resources_) |
| 415 kv.second.request.was_cached = false; | 415 kv.second.request.was_cached = false; |
| 416 } | 416 } |
| 417 | 417 |
| 418 // Shortcut for convenience. | 418 // Shortcut for convenience. |
| 419 GURL GetURL(const std::string& path) const { | 419 GURL GetURL(const std::string& path) const { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 net::MEDIUM), | 791 net::MEDIUM), |
| 792 AddResource(GetURL(kFontPath), content::RESOURCE_TYPE_FONT_RESOURCE, | 792 AddResource(GetURL(kFontPath), content::RESOURCE_TYPE_FONT_RESOURCE, |
| 793 net::HIGHEST), | 793 net::HIGHEST), |
| 794 }; | 794 }; |
| 795 for (auto& resource : resources) | 795 for (auto& resource : resources) |
| 796 resource->request.always_revalidate = true; | 796 resource->request.always_revalidate = true; |
| 797 TestLearningAndPrefetching(GetURL(kHtmlSubresourcesPath)); | 797 TestLearningAndPrefetching(GetURL(kHtmlSubresourcesPath)); |
| 798 } | 798 } |
| 799 | 799 |
| 800 } // namespace predictors | 800 } // namespace predictors |
| OLD | NEW |