1 // Copyright (c) 2011 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 CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_
8 #include "base/supports_user_data.h"
14 class ChromeURLRequestUserData
: public base::SupportsUserData::Data
{
16 bool is_prerender() const { return is_prerender_
; }
17 void set_is_prerender(bool is_prerender
) { is_prerender_
= is_prerender
; }
19 // Creates a new ChromeURLRequestUserData instance and attaches it
20 // to |request|. |request| must not have an existing ChromeURLRequestUserData
21 // instance attached to it, and must be non-NULL. The returned instance
22 // is owned by |request|.
23 static ChromeURLRequestUserData
* Create(net::URLRequest
* request
);
25 // Delete the ChromeURLRequestUserData from a |request|. |request| must be
27 static void Delete(net::URLRequest
* request
);
29 // Gets the ChromeURLRequestUserData instance attached to |request|, or
30 // returns NULL if one is not attached. |request| must be non-NULL.
31 static ChromeURLRequestUserData
* Get(const net::URLRequest
* request
);
34 ChromeURLRequestUserData();
38 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestUserData
);
41 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_