| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, | 131 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, |
| 132 const KURL& redirectedUrl) { | 132 const KURL& redirectedUrl) { |
| 133 m_redirectCount++; | 133 m_redirectCount++; |
| 134 if (!m_redirectStart) { | 134 if (!m_redirectStart) { |
| 135 setRedirectStart(m_fetchStart); | 135 setRedirectStart(m_fetchStart); |
| 136 } | 136 } |
| 137 markRedirectEnd(); | 137 markRedirectEnd(); |
| 138 markFetchStart(); | 138 markFetchStart(); |
| 139 | 139 |
| 140 // Check if the redirected url is allowed to access the redirecting url's timi
ng information. | 140 // Check if the redirected url is allowed to access the redirecting url's |
| 141 // timing information. |
| 141 RefPtr<SecurityOrigin> redirectedSecurityOrigin = | 142 RefPtr<SecurityOrigin> redirectedSecurityOrigin = |
| 142 SecurityOrigin::create(redirectedUrl); | 143 SecurityOrigin::create(redirectedUrl); |
| 143 m_hasCrossOriginRedirect |= | 144 m_hasCrossOriginRedirect |= |
| 144 !redirectedSecurityOrigin->canRequest(redirectingUrl); | 145 !redirectedSecurityOrigin->canRequest(redirectingUrl); |
| 145 } | 146 } |
| 146 | 147 |
| 147 void DocumentLoadTiming::setRedirectStart(double redirectStart) { | 148 void DocumentLoadTiming::setRedirectStart(double redirectStart) { |
| 148 m_redirectStart = redirectStart; | 149 m_redirectStart = redirectStart; |
| 149 TRACE_EVENT_MARK_WITH_TIMESTAMP1( | 150 TRACE_EVENT_MARK_WITH_TIMESTAMP1( |
| 150 "blink.user_timing", "redirectStart", | 151 "blink.user_timing", "redirectStart", |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 215 |
| 215 void DocumentLoadTiming::markRedirectEnd() { | 216 void DocumentLoadTiming::markRedirectEnd() { |
| 216 m_redirectEnd = monotonicallyIncreasingTime(); | 217 m_redirectEnd = monotonicallyIncreasingTime(); |
| 217 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "redirectEnd", | 218 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "redirectEnd", |
| 218 TraceEvent::toTraceTimestamp(m_redirectEnd), | 219 TraceEvent::toTraceTimestamp(m_redirectEnd), |
| 219 "frame", frame()); | 220 "frame", frame()); |
| 220 notifyDocumentTimingChanged(); | 221 notifyDocumentTimingChanged(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace blink | 224 } // namespace blink |
| OLD | NEW |