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