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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 1299493003: Attach mixed content status to resource requests when sent to devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mkwst comments Created 5 years, 4 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
« no previous file with comments | « Source/core/fetch/ResourceFetcherTest.cpp ('k') | Source/core/loader/BeaconLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(co nst ResourceRequest& request)
208 {
209 if (!request.isMixedContent())
210 return TypeBuilder::Network::Request::MixedContentStatus::None;
211
212 switch (request.contextType()) {
213 case ResourceRequest::ContextTypeBlockable:
214 return TypeBuilder::Network::Request::MixedContentStatus::Active;
estark 2015/08/17 17:20:12 Mike, do you think we should stick with the blocka
215 case ResourceRequest::ContextTypeOptionallyBlockable:
216 case ResourceRequest::ContextTypeShouldBeBlockable:
217 return TypeBuilder::Network::Request::MixedContentStatus::Passive;
218 }
219
220 return TypeBuilder::Network::Request::MixedContentStatus::None;
221 }
222
207 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request) 223 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request)
208 { 224 {
209 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create() 225 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create()
210 .setUrl(urlWithoutFragment(request.url()).string()) 226 .setUrl(urlWithoutFragment(request.url()).string())
211 .setMethod(request.httpMethod()) 227 .setMethod(request.httpMethod())
212 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); 228 .setHeaders(buildObjectForHeaders(request.httpHeaderFields()));
229 requestObject->setMixedContentStatus(getMixedContentStatus(request));
230
213 if (request.httpBody() && !request.httpBody()->isEmpty()) { 231 if (request.httpBody() && !request.httpBody()->isEmpty()) {
214 Vector<char> bytes; 232 Vector<char> bytes;
215 request.httpBody()->flatten(bytes); 233 request.httpBody()->flatten(bytes);
216 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data (), bytes.size())); 234 requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data (), bytes.size()));
217 } 235 }
218 return requestObject; 236 return requestObject;
219 } 237 }
220 238
221 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse (const ResourceResponse& response) 239 static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse (const ResourceResponse& response)
222 { 240 {
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 1006 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
989 { 1007 {
990 } 1008 }
991 1009
992 bool InspectorResourceAgent::shouldForceCORSPreflight() 1010 bool InspectorResourceAgent::shouldForceCORSPreflight()
993 { 1011 {
994 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 1012 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
995 } 1013 }
996 1014
997 } // namespace blink 1015 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcherTest.cpp ('k') | Source/core/loader/BeaconLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698