1 /* 2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above 11 * copyright notice, this list of conditions and the following disclaimer 12 * in the documentation and/or other materials provided with the 13 * distribution. 14 * * Neither the name of Google Inc. nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #include "config.h" 32 #include "public/platform/WebURLLoadTiming.h" 33 34 #include "platform/network/ResourceLoadTiming.h" 35 #include "public/platform/WebString.h" 36 37 namespace blink { 38 39 void WebURLLoadTiming::initialize() 40 { 41 m_private = ResourceLoadTiming::create(); 42 } 43 44 void WebURLLoadTiming::reset() 45 { 46 m_private.reset(); 47 } 48 49 void WebURLLoadTiming::assign(const WebURLLoadTiming& other) 50 { 51 m_private = other.m_private; 52 } 53 54 double WebURLLoadTiming::requestTime() const 55 { 56 return m_private->requestTime; 57 } 58 59 void WebURLLoadTiming::setRequestTime(double time) 60 { 61 m_private->requestTime = time; 62 } 63 64 double WebURLLoadTiming::proxyStart() const 65 { 66 return m_private->proxyStart; 67 } 68 69 void WebURLLoadTiming::setProxyStart(double start) 70 { 71 m_private->proxyStart = start; 72 } 73 74 double WebURLLoadTiming::proxyEnd() const 75 { 76 return m_private->proxyEnd; 77 } 78 79 void WebURLLoadTiming::setProxyEnd(double end) 80 { 81 m_private->proxyEnd = end; 82 } 83 84 double WebURLLoadTiming::dnsStart() const 85 { 86 return m_private->dnsStart; 87 } 88 89 void WebURLLoadTiming::setDNSStart(double start) 90 { 91 m_private->dnsStart = start; 92 } 93 94 double WebURLLoadTiming::dnsEnd() const 95 { 96 return m_private->dnsEnd; 97 } 98 99 void WebURLLoadTiming::setDNSEnd(double end) 100 { 101 m_private->dnsEnd = end; 102 } 103 104 double WebURLLoadTiming::connectStart() const 105 { 106 return m_private->connectStart; 107 } 108 109 void WebURLLoadTiming::setConnectStart(double start) 110 { 111 m_private->connectStart = start; 112 } 113 114 double WebURLLoadTiming::connectEnd() const 115 { 116 return m_private->connectEnd; 117 } 118 119 void WebURLLoadTiming::setConnectEnd(double end) 120 { 121 m_private->connectEnd = end; 122 } 123 124 double WebURLLoadTiming::serviceWorkerFetchStart() const 125 { 126 return m_private->serviceWorkerFetchStart; 127 } 128 129 void WebURLLoadTiming::setServiceWorkerFetchStart(double start) 130 { 131 m_private->serviceWorkerFetchStart = start; 132 } 133 134 double WebURLLoadTiming::serviceWorkerFetchReady() const 135 { 136 return m_private->serviceWorkerFetchReady; 137 } 138 139 void WebURLLoadTiming::setServiceWorkerFetchReady(double time) 140 { 141 m_private->serviceWorkerFetchReady = time; 142 } 143 144 double WebURLLoadTiming::serviceWorkerFetchEnd() const 145 { 146 return m_private->serviceWorkerFetchEnd; 147 } 148 149 void WebURLLoadTiming::setServiceWorkerFetchEnd(double end) 150 { 151 m_private->serviceWorkerFetchEnd = end; 152 } 153 154 double WebURLLoadTiming::sendStart() const 155 { 156 return m_private->sendStart; 157 } 158 159 void WebURLLoadTiming::setSendStart(double start) 160 { 161 m_private->sendStart = start; 162 } 163 164 double WebURLLoadTiming::sendEnd() const 165 { 166 return m_private->sendEnd; 167 } 168 169 void WebURLLoadTiming::setSendEnd(double end) 170 { 171 m_private->sendEnd = end; 172 } 173 174 double WebURLLoadTiming::receiveHeadersEnd() const 175 { 176 return m_private->receiveHeadersEnd; 177 } 178 179 void WebURLLoadTiming::setReceiveHeadersEnd(double end) 180 { 181 m_private->receiveHeadersEnd = end; 182 } 183 184 double WebURLLoadTiming::sslStart() const 185 { 186 return m_private->sslStart; 187 } 188 189 void WebURLLoadTiming::setSSLStart(double start) 190 { 191 m_private->sslStart = start; 192 } 193 194 double WebURLLoadTiming::sslEnd() const 195 { 196 return m_private->sslEnd; 197 } 198 199 void WebURLLoadTiming::setSSLEnd(double end) 200 { 201 m_private->sslEnd = end; 202 } 203 204 WebURLLoadTiming::WebURLLoadTiming(const PassRefPtr<ResourceLoadTiming>& value) 205 : m_private(value) 206 { 207 } 208 209 WebURLLoadTiming& WebURLLoadTiming::operator=(const PassRefPtr<ResourceLoadTiming>& value) 210 { 211 m_private = value; 212 return *this; 213 } 214 215 WebURLLoadTiming::operator PassRefPtr<ResourceLoadTiming>() const 216 { 217 return m_private.get(); 218 } 219 220 } // namespace blink 221