Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: chrome/common/net/url_request_context_getter.cc

Issue 3869003: Const-ify RefCountedThreadSafe::AddRef and Release. (Closed)
Patch Set: actually remove the cast Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/net/url_request_context_getter.h" 6 #include "chrome/common/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 URLRequestContextGetter::URLRequestContextGetter() : is_main_(false) {} 13 URLRequestContextGetter::URLRequestContextGetter() : is_main_(false) {}
14 14
15 URLRequestContextGetter::~URLRequestContextGetter() {} 15 URLRequestContextGetter::~URLRequestContextGetter() {}
16 16
17 void URLRequestContextGetter::OnDestruct() { 17 void URLRequestContextGetter::OnDestruct() const {
18 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = 18 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy =
19 GetIOMessageLoopProxy(); 19 GetIOMessageLoopProxy();
20 DCHECK(io_message_loop_proxy); 20 DCHECK(io_message_loop_proxy);
21 if (io_message_loop_proxy) { 21 if (io_message_loop_proxy) {
22 if (io_message_loop_proxy->BelongsToCurrentThread()) { 22 if (io_message_loop_proxy->BelongsToCurrentThread()) {
23 delete this; 23 delete this;
24 } else { 24 } else {
25 io_message_loop_proxy->DeleteSoon(FROM_HERE, this); 25 io_message_loop_proxy->DeleteSoon(FROM_HERE, this);
26 } 26 }
27 } 27 }
28 // If no IO message loop proxy was available, we will just leak memory. 28 // If no IO message loop proxy was available, we will just leak memory.
29 // This is also true if the IO thread is gone. 29 // This is also true if the IO thread is gone.
30 } 30 }
OLDNEW
« no previous file with comments | « chrome/common/net/url_request_context_getter.h ('k') | chrome/service/net/service_url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698