• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "net/url_request/url_request_context_getter.h"
6 
7 #include "base/message_loop_proxy.h"
8 #include "net/url_request/url_request_context.h"
9 
10 namespace net {
DONTUSEME_GetCookieStore()11 CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() {
12   return NULL;
13 }
14 
URLRequestContextGetter()15 URLRequestContextGetter::URLRequestContextGetter() : is_main_(false) {}
16 
~URLRequestContextGetter()17 URLRequestContextGetter::~URLRequestContextGetter() {}
18 
OnDestruct() const19 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);
28     }
29   }
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.
32 }
33 
34 }  // namespace net
35