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

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

Issue 1311433008: Migrate PingLoader to be a LocalFrameLifecycleObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style. Created 5 years, 3 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/html/HTMLAnchorElement.cpp ('k') | Source/core/loader/PingLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/loader/BeaconLoader.h" 6 #include "core/loader/BeaconLoader.h"
7 7
8 #include "core/dom/DOMArrayBufferView.h" 8 #include "core/dom/DOMArrayBufferView.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/fetch/CrossOriginAccessControl.h" 10 #include "core/fetch/CrossOriginAccessControl.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); 141 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest());
142 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse()); 142 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse());
143 143
144 ASSERT(!newRequest.isNull()); 144 ASSERT(!newRequest.isNull());
145 ASSERT(!redirectResponse.isNull()); 145 ASSERT(!redirectResponse.isNull());
146 146
147 String errorDescription; 147 String errorDescription;
148 StoredCredentials withCredentials = AllowStoredCredentials; 148 StoredCredentials withCredentials = AllowStoredCredentials;
149 ResourceLoaderOptions options; 149 ResourceLoaderOptions options;
150 if (!CrossOriginAccessControl::handleRedirect(m_beaconOrigin.get(), newReque st, redirectResponse, withCredentials, options, errorDescription)) { 150 if (!CrossOriginAccessControl::handleRedirect(m_beaconOrigin.get(), newReque st, redirectResponse, withCredentials, options, errorDescription)) {
151 if (page() && page()->mainFrame()) { 151 if (LocalFrame* localFrame = frame()) {
152 if (page()->mainFrame()->isLocalFrame()) { 152 if (localFrame->document())
153 LocalFrame* localFrame = toLocalFrame(page()->mainFrame()); 153 localFrame->document()->addConsoleMessage(ConsoleMessage::create (JSMessageSource, ErrorMessageLevel, errorDescription));
154 if (localFrame->document())
155 localFrame->document()->addConsoleMessage(ConsoleMessage::cr eate(JSMessageSource, ErrorMessageLevel, errorDescription));
156 }
157 } 154 }
158 // Cancel the load and self destruct. 155 // Cancel the load and self destruct.
159 dispose(); 156 dispose();
160 return; 157 return;
161 } 158 }
162 // FIXME: http://crbug.com/427429 is needed to correctly propagate 159 // FIXME: http://crbug.com/427429 is needed to correctly propagate
163 // updates of Origin: following this successful redirect. 160 // updates of Origin: following this successful redirect.
164 } 161 }
165 162
166 namespace { 163 namespace {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 request.setHTTPBody(entityBody.release()); 234 request.setHTTPBody(entityBody.release());
238 request.setHTTPContentType(contentType); 235 request.setHTTPContentType(contentType);
239 236
240 payloadLength = entitySize; 237 payloadLength = entitySize;
241 return true; 238 return true;
242 } 239 }
243 240
244 } // namespace 241 } // namespace
245 242
246 } // namespace blink 243 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | Source/core/loader/PingLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698