15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_ 6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/basictypes.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "content/common/content_export.h" 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "content/public/browser/global_request_id.h" 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace content { 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class CrossSiteResourceHandler; 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// A UI thread object that owns a request being transferred. Deleting the 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// object without releasing the request will delete the underlying URLRequest. 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// This is needed to clean up the URLRequest when a cross site navigation is 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// cancelled. 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class CONTENT_EXPORT CrossSiteTransferringRequest { 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) explicit CrossSiteTransferringRequest(GlobalRequestID global_request_id); 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ~CrossSiteTransferringRequest(); 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Relinquishes ownership of the request, so another process can take 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // control of it. 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) void ReleaseRequest(); 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 2903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) GlobalRequestID request_id() const { return global_request_id_; } 3003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) 315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private: 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // No need for a weak pointer here - nothing should have ownership of the 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // cross site request until after |this| is deleted, or ReleaseRequest is 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // called. 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) GlobalRequestID global_request_id_; 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(CrossSiteTransferringRequest); 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} // namespace content 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 42a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif // CONTENT_BROWSER_FRAME_HOST_CROSS_SITE_TRANSFERRING_REQUEST_H_ 43