Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/renderer_host/chrome_url_request_user_data.h

Issue 9348109: Add extra data to BrowserContext so that content layer and other embedders can stash data with it t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "net/url_request/url_request.h" 9 #include "base/supports_user_data.h"
10 10
11 class ChromeURLRequestUserData : public net::URLRequest::UserData { 11 namespace net {
12 class URLRequest;
13 }
14
15 class ChromeURLRequestUserData : public base::SupportsUserData::Data {
12 public: 16 public:
13 bool is_prerender() const { return is_prerender_; } 17 bool is_prerender() const { return is_prerender_; }
14 void set_is_prerender(bool is_prerender) { is_prerender_ = is_prerender; } 18 void set_is_prerender(bool is_prerender) { is_prerender_ = is_prerender; }
15 19
16 // Creates a new ChromeURLRequestUserData instance and attaches it 20 // Creates a new ChromeURLRequestUserData instance and attaches it
17 // to |request|. |request| must not have an existing ChromeURLRequestUserData 21 // to |request|. |request| must not have an existing ChromeURLRequestUserData
18 // instance attached to it, and must be non-NULL. The returned instance 22 // instance attached to it, and must be non-NULL. The returned instance
19 // is owned by |request|. 23 // is owned by |request|.
20 static ChromeURLRequestUserData* Create(net::URLRequest* request); 24 static ChromeURLRequestUserData* Create(net::URLRequest* request);
21 25
22 // Delete the ChromeURLRequestUserData from a |request|. |request| must be 26 // Delete the ChromeURLRequestUserData from a |request|. |request| must be
23 // non-NULL. 27 // non-NULL.
24 static void Delete(net::URLRequest* request); 28 static void Delete(net::URLRequest* request);
25 29
26 // Gets the ChromeURLRequestUserData instance attached to |request|, or 30 // Gets the ChromeURLRequestUserData instance attached to |request|, or
27 // returns NULL if one is not attached. |request| must be non-NULL. 31 // returns NULL if one is not attached. |request| must be non-NULL.
28 static ChromeURLRequestUserData* Get(const net::URLRequest* request); 32 static ChromeURLRequestUserData* Get(const net::URLRequest* request);
29 33
30 private: 34 private:
31 ChromeURLRequestUserData(); 35 ChromeURLRequestUserData();
32 36
33 bool is_prerender_; 37 bool is_prerender_;
34 38
35 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestUserData); 39 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestUserData);
36 }; 40 };
37 41
38 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_ 42 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_URL_REQUEST_USER_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698