| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_NET_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_ |
| 6 #define CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_ |
| 7 | 7 |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "chrome/browser/chrome_thread.h" |
| 9 | 10 |
| 10 namespace net { | 11 namespace net { |
| 11 class CookieStore; | 12 class CookieStore; |
| 12 } | 13 } |
| 13 | 14 |
| 14 class URLRequestContext; | 15 class URLRequestContext; |
| 15 | 16 |
| 16 // Interface for retrieving an URLRequestContext. | 17 // Interface for retrieving an URLRequestContext. |
| 17 class URLRequestContextGetter | 18 class URLRequestContextGetter |
| 18 : public base::RefCountedThreadSafe<URLRequestContextGetter> { | 19 : public base::RefCountedThreadSafe<URLRequestContextGetter, |
| 20 ChromeThread::DeleteOnIOThread> { |
| 19 public: | 21 public: |
| 20 virtual URLRequestContext* GetURLRequestContext() = 0; | 22 virtual URLRequestContext* GetURLRequestContext() = 0; |
| 21 | 23 |
| 22 // Defaults to GetURLRequestContext()->cookie_store(), but | 24 // Defaults to GetURLRequestContext()->cookie_store(), but |
| 23 // implementations can override it. | 25 // implementations can override it. |
| 24 virtual net::CookieStore* GetCookieStore(); | 26 virtual net::CookieStore* GetCookieStore(); |
| 25 | 27 |
| 26 protected: | 28 protected: |
| 27 friend class base::RefCountedThreadSafe<URLRequestContextGetter>; | 29 friend class ChromeThread; |
| 30 friend class DeleteTask<URLRequestContextGetter>; |
| 28 | 31 |
| 29 virtual ~URLRequestContextGetter() {} | 32 virtual ~URLRequestContextGetter() {} |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 #endif // CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_ | 35 #endif // CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_ |
| 33 | 36 |
| OLD | NEW |