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