193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)/*
293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Copyright (C) 2010 Google Inc. All rights reserved.
393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * modification, are permitted provided that the following conditions are
693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * met:
793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions of source code must retain the above copyright
993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * notice, this list of conditions and the following disclaimer.
1093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions in binary form must reproduce the above
1193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
1293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * in the documentation and/or other materials provided with the
1393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * distribution.
1493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
1593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * contributors may be used to endorse or promote products derived from
1693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * this software without specific prior written permission.
1793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
1893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) */
3093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#ifndef WebURLLoadTiming_h
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#define WebURLLoadTiming_h
3393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebCommon.h"
3593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebPrivatePtr.h"
3693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
38e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)
39e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)class ResourceLoadTiming;
4093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebString;
4193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebURLLoadTiming {
4393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)public:
4493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    ~WebURLLoadTiming() { reset(); }
4593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLLoadTiming() { }
4793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLLoadTiming(const WebURLLoadTiming& d) { assign(d); }
4893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLLoadTiming& operator=(const WebURLLoadTiming& d)
4993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    {
5093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        assign(d);
5193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        return *this;
5293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    }
5393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
54bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void initialize();
55bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void reset();
56bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void assign(const WebURLLoadTiming&);
5793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    bool isNull() const { return m_private.isNull(); }
5993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
60bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double requestTime() const;
61bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setRequestTime(double);
6293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
63bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double proxyStart() const;
64bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setProxyStart(double);
6593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
66bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double proxyEnd() const;
67bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setProxyEnd(double);
6893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
69bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double dnsStart() const;
70bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setDNSStart(double);
7193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
72bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double dnsEnd() const;
73bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setDNSEnd(double);
7493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
75bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double connectStart() const;
76bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setConnectStart(double);
7793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
78bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double connectEnd() const;
79bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setConnectEnd(double);
8093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
817242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT double serviceWorkerFetchStart() const;
827242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT void setServiceWorkerFetchStart(double);
837242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci
847242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT double serviceWorkerFetchReady() const;
857242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT void setServiceWorkerFetchReady(double);
867242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci
877242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT double serviceWorkerFetchEnd() const;
887242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT void setServiceWorkerFetchEnd(double);
897242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci
90bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double sendStart() const;
91bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setSendStart(double);
9293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
93bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double sendEnd() const;
94bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setSendEnd(double);
9593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
96bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double receiveHeadersEnd() const;
97bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setReceiveHeadersEnd(double);
9893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
99bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double sslStart() const;
100bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setSSLStart(double);
10193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
102bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT double sslEnd() const;
103bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setSSLEnd(double);
10493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
105bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#if INSIDE_BLINK
106e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    BLINK_PLATFORM_EXPORT WebURLLoadTiming(const WTF::PassRefPtr<ResourceLoadTiming>&);
107e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    BLINK_PLATFORM_EXPORT WebURLLoadTiming& operator=(const WTF::PassRefPtr<ResourceLoadTiming>&);
108e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<ResourceLoadTiming>() const;
10993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif
11093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
11193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)private:
112e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    WebPrivatePtr<ResourceLoadTiming> m_private;
11393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)};
11493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
11551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
11693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
11793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif
118