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 "WebURLLoadTiming.h" 33 34 #include "ResourceLoadTiming.h" 35 #include "WebString.h" 36 37 using namespace WebCore; 38 39 namespace WebKit { 40 41 void WebURLLoadTiming::initialize() 42 { 43 m_private = ResourceLoadTiming::create(); 44 } 45 46 void WebURLLoadTiming::reset() 47 { 48 m_private.reset(); 49 } 50 51 void WebURLLoadTiming::assign(const WebURLLoadTiming& other) 52 { 53 m_private = other.m_private; 54 } 55 56 double WebURLLoadTiming::requestTime() const 57 { 58 return m_private->requestTime; 59 } 60 61 void WebURLLoadTiming::setRequestTime(double time) 62 { 63 m_private->requestTime = time; 64 } 65 66 int WebURLLoadTiming::proxyStart() const 67 { 68 return m_private->proxyStart; 69 } 70 71 void WebURLLoadTiming::setProxyStart(int start) 72 { 73 m_private->proxyStart = start; 74 } 75 76 int WebURLLoadTiming::proxyEnd() const 77 { 78 return m_private->proxyEnd; 79 } 80 81 void WebURLLoadTiming::setProxyEnd(int end) 82 { 83 m_private->proxyEnd = end; 84 } 85 86 int WebURLLoadTiming::dnsStart() const 87 { 88 return m_private->dnsStart; 89 } 90 91 void WebURLLoadTiming::setDNSStart(int start) 92 { 93 m_private->dnsStart = start; 94 } 95 96 int WebURLLoadTiming::dnsEnd() const 97 { 98 return m_private->dnsEnd; 99 } 100 101 void WebURLLoadTiming::setDNSEnd(int end) 102 { 103 m_private->dnsEnd = end; 104 } 105 106 int WebURLLoadTiming::connectStart() const 107 { 108 return m_private->connectStart; 109 } 110 111 void WebURLLoadTiming::setConnectStart(int start) 112 { 113 m_private->connectStart = start; 114 } 115 116 int WebURLLoadTiming::connectEnd() const 117 { 118 return m_private->connectEnd; 119 } 120 121 void WebURLLoadTiming::setConnectEnd(int end) 122 { 123 m_private->connectEnd = end; 124 } 125 126 int WebURLLoadTiming::sendStart() const 127 { 128 return m_private->sendStart; 129 } 130 131 void WebURLLoadTiming::setSendStart(int start) 132 { 133 m_private->sendStart = start; 134 } 135 136 int WebURLLoadTiming::sendEnd() const 137 { 138 return m_private->sendEnd; 139 } 140 141 void WebURLLoadTiming::setSendEnd(int end) 142 { 143 m_private->sendEnd = end; 144 } 145 146 int WebURLLoadTiming::receiveHeadersEnd() const 147 { 148 return m_private->receiveHeadersEnd; 149 } 150 151 void WebURLLoadTiming::setReceiveHeadersEnd(int end) 152 { 153 m_private->receiveHeadersEnd = end; 154 } 155 156 int WebURLLoadTiming::sslStart() const 157 { 158 return m_private->sslStart; 159 } 160 161 void WebURLLoadTiming::setSSLStart(int start) 162 { 163 m_private->sslStart = start; 164 } 165 166 int WebURLLoadTiming::sslEnd() const 167 { 168 return m_private->sslEnd; 169 } 170 171 void WebURLLoadTiming::setSSLEnd(int end) 172 { 173 m_private->sslEnd = end; 174 } 175 176 WebURLLoadTiming::WebURLLoadTiming(const PassRefPtr<ResourceLoadTiming>& value) 177 : m_private(value) 178 { 179 } 180 181 WebURLLoadTiming& WebURLLoadTiming::operator=(const PassRefPtr<ResourceLoadTiming>& value) 182 { 183 m_private = value; 184 return *this; 185 } 186 187 WebURLLoadTiming::operator PassRefPtr<ResourceLoadTiming>() const 188 { 189 return m_private.get(); 190 } 191 192 } // namespace WebKit 193