| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 { | 67 { |
| 68 ASSERT(!m_navigationStart && !m_referenceMonotonicTime && !m_referenceWallTi
me); | 68 ASSERT(!m_navigationStart && !m_referenceMonotonicTime && !m_referenceWallTi
me); |
| 69 | 69 |
| 70 m_navigationStart = m_referenceMonotonicTime = monotonicallyIncreasingTime()
; | 70 m_navigationStart = m_referenceMonotonicTime = monotonicallyIncreasingTime()
; |
| 71 m_referenceWallTime = currentTime(); | 71 m_referenceWallTime = currentTime(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void DocumentLoadTiming::setNavigationStart(double navigationStart) | 74 void DocumentLoadTiming::setNavigationStart(double navigationStart) |
| 75 { | 75 { |
| 76 ASSERT(m_referenceMonotonicTime && m_referenceWallTime); | 76 ASSERT(m_referenceMonotonicTime && m_referenceWallTime); |
| 77 | |
| 78 // This should be used only to indicate that the navigation started in the | |
| 79 // embedder before the renderer was created. | |
| 80 ASSERT(navigationStart <= m_navigationStart); | |
| 81 m_navigationStart = navigationStart; | 77 m_navigationStart = navigationStart; |
| 82 | |
| 83 // |m_referenceMonotonicTime| and |m_referenceWallTime| represent | |
| 84 // navigationStart. When the embedder sets navigationStart (because the | |
| 85 // navigation started earlied on the browser side), we need to adjust these | |
| 86 // as well. | |
| 87 m_referenceWallTime = monotonicTimeToPseudoWallTime(navigationStart); | |
| 88 m_referenceMonotonicTime = navigationStart; | |
| 89 } | 78 } |
| 90 | 79 |
| 91 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, const KURL& red
irectedUrl) | 80 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, const KURL& red
irectedUrl) |
| 92 { | 81 { |
| 93 m_redirectCount++; | 82 m_redirectCount++; |
| 94 if (!m_redirectStart) | 83 if (!m_redirectStart) |
| 95 m_redirectStart = m_fetchStart; | 84 m_redirectStart = m_fetchStart; |
| 96 m_redirectEnd = m_fetchStart = monotonicallyIncreasingTime(); | 85 m_redirectEnd = m_fetchStart = monotonicallyIncreasingTime(); |
| 97 // Check if the redirected url is allowed to access the redirecting url's ti
ming information. | 86 // Check if the redirected url is allowed to access the redirecting url's ti
ming information. |
| 98 RefPtr<SecurityOrigin> redirectedSecurityOrigin = SecurityOrigin::create(red
irectedUrl); | 87 RefPtr<SecurityOrigin> redirectedSecurityOrigin = SecurityOrigin::create(red
irectedUrl); |
| 99 m_hasCrossOriginRedirect = !redirectedSecurityOrigin->canRequest(redirecting
Url); | 88 m_hasCrossOriginRedirect = !redirectedSecurityOrigin->canRequest(redirecting
Url); |
| 100 } | 89 } |
| 101 | 90 |
| 102 } // namespace WebCore | 91 } // namespace WebCore |
| OLD | NEW |