Fix build break
[chromium-blink-merge.git] / chrome / browser / renderer_host / chrome_url_request_user_data.h
blob63981ba57356b73ae50e2fb98a3cb72ec87cd801
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"
10 namespace net {
11 class URLRequest;
14 class ChromeURLRequestUserData : public base::SupportsUserData::Data {
15 public:
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
26 // non-NULL.
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);
33 private:
34 ChromeURLRequestUserData();
36 bool is_prerender_;
38 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestUserData);
41 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_