15267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)/*
25267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * Copyright (C) 2010 Google Inc. All rights reserved.
35267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
45267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
55267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * modification, are permitted provided that the following conditions are
65267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * met:
75267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
85267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Redistributions of source code must retain the above copyright
95267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * notice, this list of conditions and the following disclaimer.
105267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Redistributions in binary form must reproduce the above
115267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
125267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * in the documentation and/or other materials provided with the
135267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * distribution.
145267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
155267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * contributors may be used to endorse or promote products derived from
165267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * this software without specific prior written permission.
175267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
185267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
195267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
205267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
215267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
225267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
235267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
245267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
255267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
265267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
275267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
285267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
295267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) */
305267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
315267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#ifndef WebPerformance_h
325267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#define WebPerformance_h
335267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
345267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "../platform/WebCommon.h"
355267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "../platform/WebPrivatePtr.h"
365267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "WebNavigationType.h"
375267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
3843e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)#if BLINK_IMPLEMENTATION
39f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "platform/heap/Handle.h"
4043e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)#endif
4143e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)
4251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
435267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
44e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)class Performance;
45e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)
465267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebPerformance {
475267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)public:
485267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    ~WebPerformance() { reset(); }
495267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
505267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    WebPerformance() { }
515267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
525267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    WebPerformance(const WebPerformance& p) { assign(p); }
535267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
545267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    WebPerformance& operator=(const WebPerformance& p)
555267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    {
565267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)        assign(p);
575267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)        return *this;
585267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    }
595267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
6006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT void reset();
6106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT void assign(const WebPerformance&);
625267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
635267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    // This only returns one of {Other|Reload|BackForward}.
645267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    // Form submits and link clicks all fall under other.
6506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT WebNavigationType navigationType() const;
665267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
6706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double navigationStart() const;
6806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double unloadEventEnd() const;
6906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double redirectStart() const;
7006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double redirectEnd() const;
7106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT unsigned short redirectCount() const;
7206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double fetchStart() const;
7306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domainLookupStart() const;
7406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domainLookupEnd() const;
7506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double connectStart() const;
7606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double connectEnd() const;
7706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double requestStart() const;
7806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double responseStart() const;
7906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double responseEnd() const;
8006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domLoading() const;
8106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domInteractive() const;
8206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domContentLoadedEventStart() const;
8306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domContentLoadedEventEnd() const;
8406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double domComplete() const;
8506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double loadEventStart() const;
8606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    BLINK_EXPORT double loadEventEnd() const;
875267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
8806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)#if BLINK_IMPLEMENTATION
89e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    WebPerformance(const PassRefPtrWillBeRawPtr<Performance>&);
90e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    WebPerformance& operator=(const PassRefPtrWillBeRawPtr<Performance>&);
915267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#endif
925267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
935267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)private:
94e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    WebPrivatePtr<Performance> m_private;
955267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)};
965267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
9751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
985267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
995267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#endif
100