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

Side by Side Diff: Source/core/platform/network/ResourceLoadTiming.h

Issue 15265004: Fix ResourceLoadTiming resolution lose issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Step1 Created 7 years, 7 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
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 bool operator!=(const ResourceLoadTiming& other) const 78 bool operator!=(const ResourceLoadTiming& other) const
79 { 79 {
80 return !(*this == other); 80 return !(*this == other);
81 } 81 }
82 82
83 // We want to present a unified timeline to Javascript. Using walltime is pr oblematic, because the clock may skew while resources 83 // We want to present a unified timeline to Javascript. Using walltime is pr oblematic, because the clock may skew while resources
84 // load. To prevent that skew, we record a single reference walltime when ro ot document navigation begins. All other times are 84 // load. To prevent that skew, we record a single reference walltime when ro ot document navigation begins. All other times are
85 // recorded using monotonicallyIncreasingTime(). When a time needs to be pre sented to Javascript, we build a pseudo-walltime 85 // recorded using monotonicallyIncreasingTime(). When a time needs to be pre sented to Javascript, we build a pseudo-walltime
86 #ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
87 // using the following equation (requestTime as example):
88 // pseudo time = document wall reference + (requestTime - document monoton ic reference).
89 double requestTime; // All monotonicallyIncreasingTime() in seconds
90 double proxyStart;
91 double proxyEnd;
92 double dnsStart;
93 double dnsEnd;
94 double connectStart;
95 double connectEnd;
96 double sendStart;
97 double sendEnd;
98 double receiveHeadersEnd;
99 double sslStart;
100 double sslEnd;
101 #else
86 // using the following equation: 102 // using the following equation:
87 // pseudo time = document wall reference + (resource request time - docume nt monotonic reference) + deltaMilliseconds / 1000.0. 103 // pseudo time = document wall reference + (resource request time - docume nt monotonic reference) + deltaMilliseconds / 1000.0.
88 double convertResourceLoadTimeToMonotonicTime(int deltaMilliseconds) const; 104 double convertResourceLoadTimeToMonotonicTime(int deltaMilliseconds) const;
89 105
90 double requestTime; // monotonicallyIncreasingTime() when the port started h andling this request. 106 double requestTime; // monotonicallyIncreasingTime() when the port started h andling this request.
91 int proxyStart; // The rest of these are millisecond deltas, using monotonic allyIncreasingTime(), from requestTime. 107 int proxyStart; // The rest of these are millisecond deltas, using monotonic allyIncreasingTime(), from requestTime.
92 int proxyEnd; 108 int proxyEnd;
93 int dnsStart; 109 int dnsStart;
94 int dnsEnd; 110 int dnsEnd;
95 int connectStart; 111 int connectStart;
96 int connectEnd; 112 int connectEnd;
97 int sendStart; 113 int sendStart;
98 int sendEnd; 114 int sendEnd;
99 int receiveHeadersEnd; 115 int receiveHeadersEnd;
100 int sslStart; 116 int sslStart;
101 int sslEnd; 117 int sslEnd;
118 #endif
102 119
103 private: 120 private:
104 ResourceLoadTiming() 121 ResourceLoadTiming()
122 #ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
105 : requestTime(0) 123 : requestTime(0)
106 , proxyStart(-1) 124 , proxyStart(0)
107 , proxyEnd(-1) 125 , proxyEnd(0)
108 , dnsStart(-1) 126 , dnsStart(0)
109 , dnsEnd(-1) 127 , dnsEnd(0)
110 , connectStart(-1) 128 , connectStart(0)
111 , connectEnd(-1) 129 , connectEnd(0)
112 , sendStart(0) 130 , sendStart(0)
113 , sendEnd(0) 131 , sendEnd(0)
114 , receiveHeadersEnd(0) 132 , receiveHeadersEnd(0)
115 , sslStart(-1) 133 , sslStart(0)
116 , sslEnd(-1) 134 , sslEnd(0)
135 #else
136 : requestTime(0)
137 , proxyStart(-1)
138 , proxyEnd(-1)
139 , dnsStart(-1)
140 , dnsEnd(-1)
141 , connectStart(-1)
142 , connectEnd(-1)
143 , sendStart(0)
144 , sendEnd(0)
145 , receiveHeadersEnd(0)
146 , sslStart(-1)
147 , sslEnd(-1)
148 #endif
117 { 149 {
118 } 150 }
119 }; 151 };
120 152
121 } 153 }
122 154
123 #endif 155 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698