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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart())) | 197 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart())) |
198 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd())) | 198 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd())) |
199 .setWorkerStart(timing.calculateMillisecondDelta(timing.workerStart())) | 199 .setWorkerStart(timing.calculateMillisecondDelta(timing.workerStart())) |
200 .setWorkerReady(timing.calculateMillisecondDelta(timing.workerReady())) | 200 .setWorkerReady(timing.calculateMillisecondDelta(timing.workerReady())) |
201 .setSendStart(timing.calculateMillisecondDelta(timing.sendStart())) | 201 .setSendStart(timing.calculateMillisecondDelta(timing.sendStart())) |
202 .setSendEnd(timing.calculateMillisecondDelta(timing.sendEnd())) | 202 .setSendEnd(timing.calculateMillisecondDelta(timing.sendEnd())) |
203 .setReceiveHeadersEnd(timing.calculateMillisecondDelta(timing.receiveHea
dersEnd())) | 203 .setReceiveHeadersEnd(timing.calculateMillisecondDelta(timing.receiveHea
dersEnd())) |
204 .release(); | 204 .release(); |
205 } | 205 } |
206 | 206 |
| 207 TypeBuilder::Network::Request::MixedContentStatus::Enum getMixedContentStatus(Re
sourceRequest::MixedContentStatus requestStatus) |
| 208 { |
| 209 switch (requestStatus) { |
| 210 case ResourceRequest::NotMixedContent: |
| 211 return TypeBuilder::Network::Request::MixedContentStatus::None; |
| 212 case ResourceRequest::PassiveMixedContent: |
| 213 return TypeBuilder::Network::Request::MixedContentStatus::Passive; |
| 214 case ResourceRequest::ActiveMixedContent: |
| 215 return TypeBuilder::Network::Request::MixedContentStatus::Active; |
| 216 } |
| 217 return TypeBuilder::Network::Request::MixedContentStatus::None; |
| 218 } |
| 219 |
207 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c
onst ResourceRequest& request) | 220 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c
onst ResourceRequest& request) |
208 { | 221 { |
209 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network::
Request::create() | 222 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network::
Request::create() |
210 .setUrl(urlWithoutFragment(request.url()).string()) | 223 .setUrl(urlWithoutFragment(request.url()).string()) |
211 .setMethod(request.httpMethod()) | 224 .setMethod(request.httpMethod()) |
212 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); | 225 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); |
| 226 requestObject->setMixedContentStatus(getMixedContentStatus(request.mixedCont
entStatus())); |
| 227 |
213 if (request.httpBody() && !request.httpBody()->isEmpty()) { | 228 if (request.httpBody() && !request.httpBody()->isEmpty()) { |
214 Vector<char> bytes; | 229 Vector<char> bytes; |
215 request.httpBody()->flatten(bytes); | 230 request.httpBody()->flatten(bytes); |
216 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data
(), bytes.size())); | 231 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data
(), bytes.size())); |
217 } | 232 } |
218 return requestObject; | 233 return requestObject; |
219 } | 234 } |
220 | 235 |
221 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse
(const ResourceResponse& response) | 236 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse
(const ResourceResponse& response) |
222 { | 237 { |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish
edReplayXHRFired) | 1003 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish
edReplayXHRFired) |
989 { | 1004 { |
990 } | 1005 } |
991 | 1006 |
992 bool InspectorResourceAgent::shouldForceCORSPreflight() | 1007 bool InspectorResourceAgent::shouldForceCORSPreflight() |
993 { | 1008 { |
994 return m_state->getBoolean(ResourceAgentState::cacheDisabled); | 1009 return m_state->getBoolean(ResourceAgentState::cacheDisabled); |
995 } | 1010 } |
996 | 1011 |
997 } // namespace blink | 1012 } // namespace blink |
OLD | NEW |