Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / browser / frame_host / cross_site_transferring_request.h
blob0d696a3d69a8dcddff109a3dff0e1fd7be5f4f04
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 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_
8 #include "base/basictypes.h"
9 #include "content/common/content_export.h"
10 #include "content/public/browser/global_request_id.h"
12 namespace content {
14 class CrossSiteResourceHandler;
16 // A UI thread object that owns a request being transferred. Deleting the
17 // object without releasing the request will delete the underlying URLRequest.
18 // This is needed to clean up the URLRequest when a cross site navigation is
19 // cancelled.
20 class CONTENT_EXPORT CrossSiteTransferringRequest {
21 public:
22 explicit CrossSiteTransferringRequest(GlobalRequestID global_request_id);
23 ~CrossSiteTransferringRequest();
25 // Relinquishes ownership of the request, so another process can take
26 // control of it.
27 void ReleaseRequest();
29 GlobalRequestID request_id() const { return global_request_id_; }
31 private:
32 // No need for a weak pointer here - nothing should have ownership of the
33 // cross site request until after |this| is deleted, or ReleaseRequest is
34 // called.
35 GlobalRequestID global_request_id_;
37 DISALLOW_COPY_AND_ASSIGN(CrossSiteTransferringRequest);
40 } // namespace content
42 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_