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

Side by Side Diff: Source/core/loader/PingLoader.cpp

Issue 600393004: [ServiceWorker] Set FetchRequestMode and handle wasFetchedViaServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add setFetchCredentialsMode in PingLoader::PingLoader() Created 6 years, 2 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 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Resour ceSendRequest", "data", InspectorSendRequestEvent::data(m_identifier, frame, req uest)); 140 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Resour ceSendRequest", "data", InspectorSendRequestEvent::data(m_identifier, frame, req uest));
141 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack()); 141 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", "stack", InspectorCallStackEvent::currentCallStack());
142 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 142 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
143 InspectorInstrumentation::willSendRequest(frame, m_identifier, frame->loader ().documentLoader(), request, ResourceResponse(), initiatorInfo); 143 InspectorInstrumentation::willSendRequest(frame, m_identifier, frame->loader ().documentLoader(), request, ResourceResponse(), initiatorInfo);
144 144
145 m_loader = adoptPtr(blink::Platform::current()->createURLLoader()); 145 m_loader = adoptPtr(blink::Platform::current()->createURLLoader());
146 ASSERT(m_loader); 146 ASSERT(m_loader);
147 blink::WrappedResourceRequest wrappedRequest(request); 147 blink::WrappedResourceRequest wrappedRequest(request);
148 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr edentials); 148 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr edentials);
149 wrappedRequest.setFetchCredentialsMode(credentialsAllowed == AllowStoredCred entials ? WebURLRequest::FetchCredentialsModeInclude : WebURLRequest::FetchCrede ntialsModeSameOrigin);
yhirano 2014/10/07 08:03:15 Can you tell me why same-origin is indicated when
149 m_loader->loadAsynchronously(wrappedRequest, this); 150 m_loader->loadAsynchronously(wrappedRequest, this);
150 151
151 // If the server never responds, FrameLoader won't be able to cancel this lo ad and 152 // If the server never responds, FrameLoader won't be able to cancel this lo ad and
152 // we'll sit here waiting forever. Set a very generous timeout, just in case . 153 // we'll sit here waiting forever. Set a very generous timeout, just in case .
153 m_timeout.startOneShot(60000, FROM_HERE); 154 m_timeout.startOneShot(60000, FROM_HERE);
154 } 155 }
155 156
156 PingLoader::~PingLoader() 157 PingLoader::~PingLoader()
157 { 158 {
158 if (m_loader) 159 if (m_loader)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 209
209 void PingLoader::didFailLoading(Page* page) 210 void PingLoader::didFailLoading(Page* page)
210 { 211 {
211 LocalFrame* frame = page->deprecatedLocalMainFrame(); 212 LocalFrame* frame = page->deprecatedLocalMainFrame();
212 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError: :cancelledError(m_url)); 213 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError: :cancelledError(m_url));
213 // Notification to FrameConsole should come AFTER Resource Agent notificatio n, front-end relies on this. 214 // Notification to FrameConsole should come AFTER Resource Agent notificatio n, front-end relies on this.
214 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError( m_url)); 215 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError( m_url));
215 } 216 }
216 217
217 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698