| 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_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 IPC_END_MESSAGE_MAP() | 495 IPC_END_MESSAGE_MAP() |
| 496 | 496 |
| 497 return handled; | 497 return handled; |
| 498 } | 498 } |
| 499 | 499 |
| 500 bool PrerenderContents::CheckURL(const GURL& url) { | 500 bool PrerenderContents::CheckURL(const GURL& url) { |
| 501 if (!url.SchemeIsHTTPOrHTTPS()) { | 501 if (!url.SchemeIsHTTPOrHTTPS()) { |
| 502 Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME); | 502 Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME); |
| 503 return false; | 503 return false; |
| 504 } | 504 } |
| 505 if (prerender_manager_->HasRecentlyBeenNavigatedTo(origin(), url)) { | 505 if (origin() != ORIGIN_OFFLINE && |
| 506 prerender_manager_->HasRecentlyBeenNavigatedTo(origin(), url)) { |
| 506 Destroy(FINAL_STATUS_RECENTLY_VISITED); | 507 Destroy(FINAL_STATUS_RECENTLY_VISITED); |
| 507 return false; | 508 return false; |
| 508 } | 509 } |
| 509 return true; | 510 return true; |
| 510 } | 511 } |
| 511 | 512 |
| 512 bool PrerenderContents::AddAliasURL(const GURL& url) { | 513 bool PrerenderContents::AddAliasURL(const GURL& url) { |
| 513 if (!CheckURL(url)) | 514 if (!CheckURL(url)) |
| 514 return false; | 515 return false; |
| 515 | 516 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 void PrerenderContents::AddResourceThrottle( | 757 void PrerenderContents::AddResourceThrottle( |
| 757 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 758 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 758 resource_throttles_.push_back(throttle); | 759 resource_throttles_.push_back(throttle); |
| 759 } | 760 } |
| 760 | 761 |
| 761 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 762 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
| 762 network_bytes_ += bytes; | 763 network_bytes_ += bytes; |
| 763 } | 764 } |
| 764 | 765 |
| 765 } // namespace prerender | 766 } // namespace prerender |
| OLD | NEW |