OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 void WebDataSourceImpl::appendRedirect(const WebURL& url) { | 69 void WebDataSourceImpl::appendRedirect(const WebURL& url) { |
70 DocumentLoader::appendRedirect(url); | 70 DocumentLoader::appendRedirect(url); |
71 } | 71 } |
72 | 72 |
73 void WebDataSourceImpl::updateNavigation( | 73 void WebDataSourceImpl::updateNavigation( |
74 double redirectStartTime, | 74 double redirectStartTime, |
75 double redirectEndTime, | 75 double redirectEndTime, |
76 double fetchStartTime, | 76 double fetchStartTime, |
77 const WebVector<WebURL>& redirectChain) { | 77 const WebVector<WebURL>& redirectChain) { |
78 for (size_t i = 0; i + 1 < redirectChain.size(); ++i) | 78 // Updates the redirection timing if there is at least one redirection |
79 didRedirect(redirectChain[i], redirectChain[i + 1]); | 79 // (between two URLs). |
80 timing().setRedirectStart(redirectStartTime); | 80 if (redirectChain.size() >= 2) { |
81 timing().setRedirectEnd(redirectEndTime); | 81 for (size_t i = 0; i + 1 < redirectChain.size(); ++i) |
| 82 didRedirect(redirectChain[i], redirectChain[i + 1]); |
| 83 timing().setRedirectStart(redirectStartTime); |
| 84 timing().setRedirectEnd(redirectEndTime); |
| 85 } |
82 timing().setFetchStart(fetchStartTime); | 86 timing().setFetchStart(fetchStartTime); |
83 } | 87 } |
84 | 88 |
85 void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const { | 89 void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const { |
86 result.assign(m_redirectChain); | 90 result.assign(m_redirectChain); |
87 } | 91 } |
88 | 92 |
89 bool WebDataSourceImpl::isClientRedirect() const { | 93 bool WebDataSourceImpl::isClientRedirect() const { |
90 return DocumentLoader::isClientRedirect(); | 94 return DocumentLoader::isClientRedirect(); |
91 } | 95 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void WebDataSourceImpl::setSubresourceFilter( | 155 void WebDataSourceImpl::setSubresourceFilter( |
152 WebDocumentSubresourceFilter* subresourceFilter) { | 156 WebDocumentSubresourceFilter* subresourceFilter) { |
153 DocumentLoader::setSubresourceFilter(WTF::wrapUnique(subresourceFilter)); | 157 DocumentLoader::setSubresourceFilter(WTF::wrapUnique(subresourceFilter)); |
154 } | 158 } |
155 | 159 |
156 DEFINE_TRACE(WebDataSourceImpl) { | 160 DEFINE_TRACE(WebDataSourceImpl) { |
157 DocumentLoader::trace(visitor); | 161 DocumentLoader::trace(visitor); |
158 } | 162 } |
159 | 163 |
160 } // namespace blink | 164 } // namespace blink |
OLD | NEW |