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
3 // found in the LICENSE file.
5 #include "content/browser/frame_host/cross_site_transferring_request.h"
7 #include "base/logging.h"
8 #include "content/browser/loader/cross_site_resource_handler.h"
9 #include "content/browser/loader/resource_dispatcher_host_impl.h"
10 #include "content/public/browser/browser_thread.h"
16 void CancelRequestOnIOThread(GlobalRequestID global_request_id
) {
17 DCHECK_CURRENTLY_ON(BrowserThread::IO
);
19 ResourceDispatcherHostImpl::Get()->CancelTransferringNavigation(
25 CrossSiteTransferringRequest::CrossSiteTransferringRequest(
26 GlobalRequestID global_request_id
)
27 : global_request_id_(global_request_id
) {
28 DCHECK(global_request_id_
!= GlobalRequestID());
31 CrossSiteTransferringRequest::~CrossSiteTransferringRequest() {
32 if (global_request_id_
== GlobalRequestID())
34 BrowserThread::PostTask(
37 base::Bind(&CancelRequestOnIOThread
, global_request_id_
));
40 void CrossSiteTransferringRequest::ReleaseRequest() {
41 DCHECK_NE(-1, global_request_id_
.child_id
);
42 DCHECK_NE(-1, global_request_id_
.request_id
);
43 global_request_id_
= GlobalRequestID();
46 } // namespace content