WebKit roll 90808:90810
[chromium-blink-merge.git] / net / url_request / url_request_context_getter.cc
blob8d21bce87605ce1b62dfe231f4158589c62d2cde
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
3 // found in the LICENSE file.
5 #include "net/url_request/url_request_context_getter.h"
7 #include "base/message_loop_proxy.h"
8 #include "net/url_request/url_request_context.h"
10 namespace net {
11 CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() {
12 return NULL;
15 URLRequestContextGetter::URLRequestContextGetter() {}
17 URLRequestContextGetter::~URLRequestContextGetter() {}
19 void URLRequestContextGetter::OnDestruct() const {
20 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy =
21 GetIOMessageLoopProxy();
22 DCHECK(io_message_loop_proxy);
23 if (io_message_loop_proxy) {
24 if (io_message_loop_proxy->BelongsToCurrentThread()) {
25 delete this;
26 } else {
27 io_message_loop_proxy->DeleteSoon(FROM_HERE, this);
30 // If no IO message loop proxy was available, we will just leak memory.
31 // This is also true if the IO thread is gone.
34 } // namespace net