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

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

Issue 1997253002: webRequest: Set frameId on beacon/ping requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webRequest-tabId
Patch Set: Make test more deterministic + adjust expectation Created 4 years, 7 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 | « chrome/test/data/extensions/api_test/webrequest/test_types.js ('k') | no next file » | 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) 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ASSERT_UNUSED(loader, loader); 130 ASSERT_UNUSED(loader, loader);
131 } 131 }
132 132
133 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) 133 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed)
134 : LocalFrameLifecycleObserver(frame) 134 : LocalFrameLifecycleObserver(frame)
135 , m_timeout(this, &PingLoader::timeout) 135 , m_timeout(this, &PingLoader::timeout)
136 , m_url(request.url()) 136 , m_url(request.url())
137 , m_identifier(createUniqueIdentifier()) 137 , m_identifier(createUniqueIdentifier())
138 , m_keepAlive(this) 138 , m_keepAlive(this)
139 { 139 {
140 ResourceResponse redirectResponse;
140 frame->loader().client()->didDispatchPingLoader(request.url()); 141 frame->loader().client()->didDispatchPingLoader(request.url());
142 frame->loader().client()->dispatchWillSendRequest(frame->loader().documentLo ader(), m_identifier, request, redirectResponse);
Nate Chapin 2016/05/23 21:28:04 Could we call frame->document()->fetcher()->contex
robwu 2016/05/23 22:28:31 Done.
141 143
142 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceSendRequest", TRACE_EVENT _SCOPE_THREAD, "data", InspectorSendRequestEvent::data(m_identifier, frame, requ est)); 144 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceSendRequest", TRACE_EVENT _SCOPE_THREAD, "data", InspectorSendRequestEvent::data(m_identifier, frame, requ est));
143 InspectorInstrumentation::willSendRequest(frame, m_identifier, frame->loader ().documentLoader(), request, ResourceResponse(), initiatorInfo); 145 InspectorInstrumentation::willSendRequest(frame, m_identifier, frame->loader ().documentLoader(), request, redirectResponse, initiatorInfo);
144 146
145 m_loader = adoptPtr(Platform::current()->createURLLoader()); 147 m_loader = adoptPtr(Platform::current()->createURLLoader());
146 ASSERT(m_loader); 148 ASSERT(m_loader);
147 WrappedResourceRequest wrappedRequest(request); 149 WrappedResourceRequest wrappedRequest(request);
148 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr edentials); 150 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr edentials);
149 m_loader->loadAsynchronously(wrappedRequest, this); 151 m_loader->loadAsynchronously(wrappedRequest, this);
150 152
151 // If the server never responds, FrameLoader won't be able to cancel this lo ad and 153 // 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 . 154 // we'll sit here waiting forever. Set a very generous timeout, just in case .
153 m_timeout.startOneShot(60000, BLINK_FROM_HERE); 155 m_timeout.startOneShot(60000, BLINK_FROM_HERE);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError: :cancelledError(m_url)); 222 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError: :cancelledError(m_url));
221 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError( m_url)); 223 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError( m_url));
222 } 224 }
223 225
224 DEFINE_TRACE(PingLoader) 226 DEFINE_TRACE(PingLoader)
225 { 227 {
226 LocalFrameLifecycleObserver::trace(visitor); 228 LocalFrameLifecycleObserver::trace(visitor);
227 } 229 }
228 230
229 } // namespace blink 231 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/webrequest/test_types.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698