OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 { | 101 { |
102 RefPtr<InspectorObject> headersObject = InspectorObject::create(); | 102 RefPtr<InspectorObject> headersObject = InspectorObject::create(); |
103 HTTPHeaderMap::const_iterator end = headers.end(); | 103 HTTPHeaderMap::const_iterator end = headers.end(); |
104 for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it) | 104 for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it) |
105 headersObject->setString(it->key.string(), it->value); | 105 headersObject->setString(it->key.string(), it->value); |
106 return headersObject; | 106 return headersObject; |
107 } | 107 } |
108 | 108 |
109 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con
st ResourceLoadTiming& timing, DocumentLoader* loader) | 109 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con
st ResourceLoadTiming& timing, DocumentLoader* loader) |
110 { | 110 { |
| 111 double requestTime = timing.requestTime; |
111 return TypeBuilder::Network::ResourceTiming::create() | 112 return TypeBuilder::Network::ResourceTiming::create() |
112 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.c
onvertResourceLoadTimeToMonotonicTime(0))) | 113 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(requestT
ime)) |
113 .setProxyStart(timing.proxyStart) | 114 .setProxyStart((timing.proxyStart - requestTime) * 1000) |
114 .setProxyEnd(timing.proxyEnd) | 115 .setProxyEnd((timing.proxyEnd - requestTime) * 1000) |
115 .setDnsStart(timing.dnsStart) | 116 .setDnsStart((timing.dnsStart - requestTime) * 1000) |
116 .setDnsEnd(timing.dnsEnd) | 117 .setDnsEnd((timing.dnsEnd - requestTime) * 1000) |
117 .setConnectStart(timing.connectStart) | 118 .setConnectStart((timing.connectStart - requestTime) * 1000) |
118 .setConnectEnd(timing.connectEnd) | 119 .setConnectEnd((timing.connectEnd - requestTime) * 1000) |
119 .setSslStart(timing.sslStart) | 120 .setSslStart((timing.sslStart - requestTime) * 1000) |
120 .setSslEnd(timing.sslEnd) | 121 .setSslEnd((timing.sslEnd - requestTime) * 1000) |
121 .setSendStart(timing.sendStart) | 122 .setSendStart((timing.sendStart - requestTime) * 1000) |
122 .setSendEnd(timing.sendEnd) | 123 .setSendEnd((timing.sendEnd - requestTime) * 1000) |
123 .setReceiveHeadersEnd(timing.receiveHeadersEnd) | 124 .setReceiveHeadersEnd((timing.receiveHeadersEnd - requestTime) * 1000) |
124 .release(); | 125 .release(); |
125 } | 126 } |
126 | 127 |
127 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c
onst ResourceRequest& request) | 128 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c
onst ResourceRequest& request) |
128 { | 129 { |
129 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network::
Request::create() | 130 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network::
Request::create() |
130 .setUrl(request.url().string()) | 131 .setUrl(request.url().string()) |
131 .setMethod(request.httpMethod()) | 132 .setMethod(request.httpMethod()) |
132 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); | 133 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); |
133 if (request.httpBody() && !request.httpBody()->isEmpty()) | 134 if (request.httpBody() && !request.httpBody()->isEmpty()) |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 , m_client(client) | 666 , m_client(client) |
666 , m_frontend(0) | 667 , m_frontend(0) |
667 , m_resourcesData(adoptPtr(new NetworkResourcesData())) | 668 , m_resourcesData(adoptPtr(new NetworkResourcesData())) |
668 , m_loadingXHRSynchronously(false) | 669 , m_loadingXHRSynchronously(false) |
669 , m_isRecalculatingStyle(false) | 670 , m_isRecalculatingStyle(false) |
670 { | 671 { |
671 } | 672 } |
672 | 673 |
673 } // namespace WebCore | 674 } // namespace WebCore |
674 | 675 |
OLD | NEW |