OLD | NEW |
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 #include "net/url_request/url_request_context_getter.h" | 5 #include "net/url_request/url_request_context_getter.h" |
6 | 6 |
| 7 #include "base/location.h" |
7 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
8 #include "net/url_request/url_request_context.h" | 9 #include "net/url_request/url_request_context.h" |
9 | 10 |
10 namespace net { | 11 namespace net { |
11 CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() { | 12 CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() { |
12 return NULL; | 13 return NULL; |
13 } | 14 } |
14 | 15 |
15 URLRequestContextGetter::URLRequestContextGetter() {} | 16 URLRequestContextGetter::URLRequestContextGetter() {} |
16 | 17 |
17 URLRequestContextGetter::~URLRequestContextGetter() {} | 18 URLRequestContextGetter::~URLRequestContextGetter() {} |
18 | 19 |
19 void URLRequestContextGetter::OnDestruct() const { | 20 void URLRequestContextGetter::OnDestruct() const { |
20 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = | 21 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = |
21 GetIOMessageLoopProxy(); | 22 GetIOMessageLoopProxy(); |
22 DCHECK(io_message_loop_proxy); | 23 DCHECK(io_message_loop_proxy); |
23 if (io_message_loop_proxy) { | 24 if (io_message_loop_proxy) { |
24 if (io_message_loop_proxy->BelongsToCurrentThread()) | 25 if (io_message_loop_proxy->BelongsToCurrentThread()) |
25 delete this; | 26 delete this; |
26 else | 27 else |
27 io_message_loop_proxy->DeleteSoon(FROM_HERE, this); | 28 io_message_loop_proxy->DeleteSoon(FROM_HERE, this); |
28 } | 29 } |
29 // If no IO message loop proxy was available, we will just leak memory. | 30 // If no IO message loop proxy was available, we will just leak memory. |
30 // This is also true if the IO thread is gone. | 31 // This is also true if the IO thread is gone. |
31 } | 32 } |
32 | 33 |
33 } // namespace net | 34 } // namespace net |
OLD | NEW |