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::MixedContentType::Enum getMixedContentType(const ResourceRequest& request) | |
pfeldman
2015/08/17 20:32:52
no get prefixes in Blink please.
| |
208 { | |
209 switch (request.contextType()) { | |
210 case ResourceRequest::ContextTypeNotMixedContent: | |
211 return TypeBuilder::Network::Request::MixedContentType::None; | |
212 case ResourceRequest::ContextTypeBlockable: | |
213 return TypeBuilder::Network::Request::MixedContentType::Blockable; | |
214 case ResourceRequest::ContextTypeOptionallyBlockable: | |
215 case ResourceRequest::ContextTypeShouldBeBlockable: | |
216 return TypeBuilder::Network::Request::MixedContentType::Optionally_block able; | |
217 } | |
218 | |
219 return TypeBuilder::Network::Request::MixedContentType::None; | |
220 } | |
221 | |
207 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request) | 222 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request) |
208 { | 223 { |
209 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create() | 224 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create() |
210 .setUrl(urlWithoutFragment(request.url()).string()) | 225 .setUrl(urlWithoutFragment(request.url()).string()) |
211 .setMethod(request.httpMethod()) | 226 .setMethod(request.httpMethod()) |
212 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); | 227 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); |
228 requestObject->setMixedContentType(getMixedContentType(request)); | |
229 | |
213 if (request.httpBody() && !request.httpBody()->isEmpty()) { | 230 if (request.httpBody() && !request.httpBody()->isEmpty()) { |
214 Vector<char> bytes; | 231 Vector<char> bytes; |
215 request.httpBody()->flatten(bytes); | 232 request.httpBody()->flatten(bytes); |
216 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data (), bytes.size())); | 233 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data (), bytes.size())); |
217 } | 234 } |
218 return requestObject; | 235 return requestObject; |
219 } | 236 } |
220 | 237 |
221 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse (const ResourceResponse& response) | 238 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse (const ResourceResponse& response) |
222 { | 239 { |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
988 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) | 1005 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) |
989 { | 1006 { |
990 } | 1007 } |
991 | 1008 |
992 bool InspectorResourceAgent::shouldForceCORSPreflight() | 1009 bool InspectorResourceAgent::shouldForceCORSPreflight() |
993 { | 1010 { |
994 return m_state->getBoolean(ResourceAgentState::cacheDisabled); | 1011 return m_state->getBoolean(ResourceAgentState::cacheDisabled); |
995 } | 1012 } |
996 | 1013 |
997 } // namespace blink | 1014 } // namespace blink |
OLD | NEW |