Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceLoadTiming.h

Issue 2746113002: platform/loader: move network/Resource* to loader/fetch (Closed)
Patch Set: git rebase master Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 #ifndef ResourceLoadTiming_h
27 #define ResourceLoadTiming_h
28
29 #include "platform/PlatformExport.h"
30 #include "wtf/PassRefPtr.h"
31 #include "wtf/RefCounted.h"
32 #include "wtf/RefPtr.h"
33
34 namespace blink {
35
36 class PLATFORM_EXPORT ResourceLoadTiming
37 : public RefCounted<ResourceLoadTiming> {
38 public:
39 static PassRefPtr<ResourceLoadTiming> create();
40
41 PassRefPtr<ResourceLoadTiming> deepCopy();
42 bool operator==(const ResourceLoadTiming&) const;
43 bool operator!=(const ResourceLoadTiming&) const;
44
45 void setDnsStart(double);
46 void setRequestTime(double);
47 void setProxyStart(double);
48 void setProxyEnd(double);
49 void setDnsEnd(double);
50 void setConnectStart(double);
51 void setConnectEnd(double);
52 void setWorkerStart(double);
53 void setWorkerReady(double);
54 void setSendStart(double);
55 void setSendEnd(double);
56 void setReceiveHeadersEnd(double);
57 void setSslStart(double);
58 void setSslEnd(double);
59 void setPushStart(double);
60 void setPushEnd(double);
61
62 double dnsStart() const { return m_dnsStart; }
63 double requestTime() const { return m_requestTime; }
64 double proxyStart() const { return m_proxyStart; }
65 double proxyEnd() const { return m_proxyEnd; }
66 double dnsEnd() const { return m_dnsEnd; }
67 double connectStart() const { return m_connectStart; }
68 double connectEnd() const { return m_connectEnd; }
69 double workerStart() const { return m_workerStart; }
70 double workerReady() const { return m_workerReady; }
71 double sendStart() const { return m_sendStart; }
72 double sendEnd() const { return m_sendEnd; }
73 double receiveHeadersEnd() const { return m_receiveHeadersEnd; }
74 double sslStart() const { return m_sslStart; }
75 double sslEnd() const { return m_sslEnd; }
76 double pushStart() const { return m_pushStart; }
77 double pushEnd() const { return m_pushEnd; }
78
79 double calculateMillisecondDelta(double) const;
80
81 private:
82 ResourceLoadTiming();
83
84 // We want to present a unified timeline to Javascript. Using walltime is
85 // problematic, because the clock may skew while resources load. To prevent
86 // that skew, we record a single reference walltime when root document
87 // navigation begins. All other times are recorded using
88 // monotonicallyIncreasingTime(). When a time needs to be presented to
89 // Javascript, we build a pseudo-walltime using the following equation
90 // (m_requestTime as example):
91 // pseudo time = document wall reference +
92 // (m_requestTime - document monotonic reference).
93
94 // All monotonicallyIncreasingTime() in seconds
95 double m_requestTime;
96 double m_proxyStart;
97 double m_proxyEnd;
98 double m_dnsStart;
99 double m_dnsEnd;
100 double m_connectStart;
101 double m_connectEnd;
102 double m_workerStart;
103 double m_workerReady;
104 double m_sendStart;
105 double m_sendEnd;
106 double m_receiveHeadersEnd;
107 double m_sslStart;
108 double m_sslEnd;
109 double m_pushStart;
110 double m_pushEnd;
111 };
112
113 } // namespace blink
114
115 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698