| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 chrome_browser_net::LoadTimeStats* load_time_stats); | 40 chrome_browser_net::LoadTimeStats* load_time_stats); |
| 41 virtual ~ChromeURLRequestContext(); | 41 virtual ~ChromeURLRequestContext(); |
| 42 | 42 |
| 43 base::WeakPtr<ChromeURLRequestContext> GetWeakPtr() { | 43 base::WeakPtr<ChromeURLRequestContext> GetWeakPtr() { |
| 44 return weak_factory_.GetWeakPtr(); | 44 return weak_factory_.GetWeakPtr(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Copies the state from |other| into this context. | 47 // Copies the state from |other| into this context. |
| 48 void CopyFrom(ChromeURLRequestContext* other); | 48 void CopyFrom(ChromeURLRequestContext* other); |
| 49 | 49 |
| 50 bool is_incognito() const { | |
| 51 return is_incognito_; | |
| 52 } | |
| 53 | |
| 54 void set_is_incognito(bool is_incognito) { | |
| 55 is_incognito_ = is_incognito; | |
| 56 } | |
| 57 | |
| 58 private: | 50 private: |
| 59 base::WeakPtrFactory<ChromeURLRequestContext> weak_factory_; | 51 base::WeakPtrFactory<ChromeURLRequestContext> weak_factory_; |
| 60 | 52 |
| 61 // --------------------------------------------------------------------------- | 53 // --------------------------------------------------------------------------- |
| 62 // Important: When adding any new members below, consider whether they need to | 54 // Important: When adding any new members below, consider whether they need to |
| 63 // be added to CopyFrom. | 55 // be added to CopyFrom. |
| 64 // --------------------------------------------------------------------------- | 56 // --------------------------------------------------------------------------- |
| 65 | 57 |
| 66 bool is_incognito_; | |
| 67 chrome_browser_net::LoadTimeStats* load_time_stats_; | 58 chrome_browser_net::LoadTimeStats* load_time_stats_; |
| 68 | 59 |
| 69 // --------------------------------------------------------------------------- | 60 // --------------------------------------------------------------------------- |
| 70 // Important: When adding any new members above, consider whether they need to | 61 // Important: When adding any new members above, consider whether they need to |
| 71 // be added to CopyFrom. | 62 // be added to CopyFrom. |
| 72 // --------------------------------------------------------------------------- | 63 // --------------------------------------------------------------------------- |
| 73 | 64 |
| 74 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 65 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
| 75 }; | 66 }; |
| 76 | 67 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 154 |
| 164 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext | 155 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext |
| 165 // instance that was lazily created by GetURLRequestContext(). | 156 // instance that was lazily created by GetURLRequestContext(). |
| 166 // Access only from the IO thread. | 157 // Access only from the IO thread. |
| 167 base::WeakPtr<ChromeURLRequestContext> url_request_context_; | 158 base::WeakPtr<ChromeURLRequestContext> url_request_context_; |
| 168 | 159 |
| 169 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 160 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
| 170 }; | 161 }; |
| 171 | 162 |
| 172 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 163 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |