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); |
77 m_navigationStart = navigationStart; | 81 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; |
78 } | 89 } |
79 | 90 |
80 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, const KURL& red
irectedUrl) | 91 void DocumentLoadTiming::addRedirect(const KURL& redirectingUrl, const KURL& red
irectedUrl) |
81 { | 92 { |
82 m_redirectCount++; | 93 m_redirectCount++; |
83 if (!m_redirectStart) | 94 if (!m_redirectStart) |
84 m_redirectStart = m_fetchStart; | 95 m_redirectStart = m_fetchStart; |
85 m_redirectEnd = m_fetchStart = monotonicallyIncreasingTime(); | 96 m_redirectEnd = m_fetchStart = monotonicallyIncreasingTime(); |
86 // Check if the redirected url is allowed to access the redirecting url's ti
ming information. | 97 // Check if the redirected url is allowed to access the redirecting url's ti
ming information. |
87 RefPtr<SecurityOrigin> redirectedSecurityOrigin = SecurityOrigin::create(red
irectedUrl); | 98 RefPtr<SecurityOrigin> redirectedSecurityOrigin = SecurityOrigin::create(red
irectedUrl); |
88 m_hasCrossOriginRedirect = !redirectedSecurityOrigin->canRequest(redirecting
Url); | 99 m_hasCrossOriginRedirect = !redirectedSecurityOrigin->canRequest(redirecting
Url); |
89 } | 100 } |
90 | 101 |
91 } // namespace WebCore | 102 } // namespace WebCore |
OLD | NEW |