| 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 NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ |
| 7 | 7 |
| 8 #include "base/debug/stack_trace.h" | |
| 9 #include "base/macros.h" | 8 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 11 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 12 #include "base/sequenced_task_runner_helpers.h" | 11 #include "base/sequenced_task_runner_helpers.h" |
| 13 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 14 | 13 |
| 15 namespace base { | 14 namespace base { |
| 16 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
| 17 } // namespace base | 16 } // namespace base |
| 18 | 17 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // against reentrancy. | 63 // against reentrancy. |
| 65 void NotifyContextShuttingDown(); | 64 void NotifyContextShuttingDown(); |
| 66 | 65 |
| 67 private: | 66 private: |
| 68 // OnDestruct is used to ensure deletion on the thread on which the request | 67 // OnDestruct is used to ensure deletion on the thread on which the request |
| 69 // IO happens. | 68 // IO happens. |
| 70 void OnDestruct() const; | 69 void OnDestruct() const; |
| 71 | 70 |
| 72 base::ObserverList<URLRequestContextGetterObserver> observer_list_; | 71 base::ObserverList<URLRequestContextGetterObserver> observer_list_; |
| 73 | 72 |
| 74 #if !defined(NDEBUG) | |
| 75 base::debug::StackTrace created_at; | |
| 76 #endif // !defined(NDEBUG) | |
| 77 | |
| 78 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); | 73 DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); |
| 79 }; | 74 }; |
| 80 | 75 |
| 81 struct URLRequestContextGetterTraits { | 76 struct URLRequestContextGetterTraits { |
| 82 static void Destruct(const URLRequestContextGetter* context_getter) { | 77 static void Destruct(const URLRequestContextGetter* context_getter) { |
| 83 context_getter->OnDestruct(); | 78 context_getter->OnDestruct(); |
| 84 } | 79 } |
| 85 }; | 80 }; |
| 86 | 81 |
| 87 // For use in shimming a URLRequestContext into a URLRequestContextGetter. | 82 // For use in shimming a URLRequestContext into a URLRequestContextGetter. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 103 | 98 |
| 104 URLRequestContext* context_; | 99 URLRequestContext* context_; |
| 105 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 100 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 106 | 101 |
| 107 DISALLOW_COPY_AND_ASSIGN(TrivialURLRequestContextGetter); | 102 DISALLOW_COPY_AND_ASSIGN(TrivialURLRequestContextGetter); |
| 108 }; | 103 }; |
| 109 | 104 |
| 110 } // namespace net | 105 } // namespace net |
| 111 | 106 |
| 112 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ | 107 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |