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

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

Issue 2831033002: Use unique_ptr for Platform::CreateURLLoader (Closed)
Patch Set: Created 3 years, 8 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 FetchInitiatorInfo initiator_info; 261 FetchInitiatorInfo initiator_info;
262 initiator_info.name = initiator; 262 initiator_info.name = initiator;
263 fetch_context.DispatchWillSendRequest(identifier_, request, 263 fetch_context.DispatchWillSendRequest(identifier_, request,
264 ResourceResponse(), initiator_info); 264 ResourceResponse(), initiator_info);
265 265
266 // Make sure the scheduler doesn't wait for the ping. 266 // Make sure the scheduler doesn't wait for the ping.
267 if (frame->FrameScheduler()) 267 if (frame->FrameScheduler())
268 frame->FrameScheduler()->DidStopLoading(identifier_); 268 frame->FrameScheduler()->DidStopLoading(identifier_);
269 269
270 loader_ = WTF::WrapUnique(Platform::Current()->CreateURLLoader()); 270 loader_ = Platform::Current()->CreateURLLoader();
271 DCHECK(loader_); 271 DCHECK(loader_);
272 WrappedResourceRequest wrapped_request(request); 272 WrappedResourceRequest wrapped_request(request);
273 wrapped_request.SetAllowStoredCredentials(credentials_allowed == 273 wrapped_request.SetAllowStoredCredentials(credentials_allowed ==
274 kAllowStoredCredentials); 274 kAllowStoredCredentials);
275 loader_->LoadAsynchronously(wrapped_request, this); 275 loader_->LoadAsynchronously(wrapped_request, this);
276 276
277 // If the server never responds, FrameLoader won't be able to cancel this load 277 // If the server never responds, FrameLoader won't be able to cancel this load
278 // and we'll sit here waiting forever. Set a very generous timeout, just in 278 // and we'll sit here waiting forever. Set a very generous timeout, just in
279 // case. 279 // case.
280 timeout_.StartOneShot(60000, BLINK_FROM_HERE); 280 timeout_.StartOneShot(60000, BLINK_FROM_HERE);
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 bool PingLoader::SendBeacon(LocalFrame* frame, 582 bool PingLoader::SendBeacon(LocalFrame* frame,
583 int allowance, 583 int allowance,
584 const KURL& beacon_url, 584 const KURL& beacon_url,
585 Blob* data, 585 Blob* data,
586 size_t& beacon_size) { 586 size_t& beacon_size) {
587 BeaconBlob beacon(data); 587 BeaconBlob beacon(data);
588 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size); 588 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size);
589 } 589 }
590 590
591 } // namespace blink 591 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/test_blink_web_unit_test_support.cc ('k') | third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698