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

Side by Side Diff: net/url_request/url_request.cc

Issue 255017: Disable the leak tracking of URLRequests.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/leak_tracker.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 "net/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/stats_counters.h" 10 #include "base/stats_counters.h"
(...skipping 23 matching lines...) Expand all
34 34
35 /////////////////////////////////////////////////////////////////////////////// 35 ///////////////////////////////////////////////////////////////////////////////
36 // URLRequest::InstanceTracker 36 // URLRequest::InstanceTracker
37 37
38 const size_t URLRequest::InstanceTracker::kMaxGraveyardSize = 25; 38 const size_t URLRequest::InstanceTracker::kMaxGraveyardSize = 25;
39 const size_t URLRequest::InstanceTracker::kMaxGraveyardURLSize = 1000; 39 const size_t URLRequest::InstanceTracker::kMaxGraveyardURLSize = 1000;
40 40
41 URLRequest::InstanceTracker::~InstanceTracker() { 41 URLRequest::InstanceTracker::~InstanceTracker() {
42 base::LeakTracker<URLRequest>::CheckForLeaks(); 42 base::LeakTracker<URLRequest>::CheckForLeaks();
43 43
44 // Check in release mode as well, since we have the info. 44 // Only check in Debug mode, because this is triggered too often.
45 CHECK(0u == GetLiveRequests().size()); 45 // See http://crbug.com/21199, http://crbug.com/18372
46 DCHECK_EQ(0u, GetLiveRequests().size());
46 } 47 }
47 48
48 // static 49 // static
49 URLRequest::InstanceTracker* URLRequest::InstanceTracker::Get() { 50 URLRequest::InstanceTracker* URLRequest::InstanceTracker::Get() {
50 return Singleton<InstanceTracker>::get(); 51 return Singleton<InstanceTracker>::get();
51 } 52 }
52 53
53 std::vector<URLRequest*> URLRequest::InstanceTracker::GetLiveRequests() { 54 std::vector<URLRequest*> URLRequest::InstanceTracker::GetLiveRequests() {
54 std::vector<URLRequest*> list; 55 std::vector<URLRequest*> list;
55 for (base::LinkNode<InstanceTrackerNode>* node = live_instances_.head(); 56 for (base::LinkNode<InstanceTrackerNode>* node = live_instances_.head();
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 URLRequest::UserData* URLRequest::GetUserData(const void* key) const { 601 URLRequest::UserData* URLRequest::GetUserData(const void* key) const {
601 UserDataMap::const_iterator found = user_data_.find(key); 602 UserDataMap::const_iterator found = user_data_.find(key);
602 if (found != user_data_.end()) 603 if (found != user_data_.end())
603 return found->second.get(); 604 return found->second.get();
604 return NULL; 605 return NULL;
605 } 606 }
606 607
607 void URLRequest::SetUserData(const void* key, UserData* data) { 608 void URLRequest::SetUserData(const void* key, UserData* data) {
608 user_data_[key] = linked_ptr<UserData>(data); 609 user_data_[key] = linked_ptr<UserData>(data);
609 } 610 }
OLDNEW
« no previous file with comments | « base/leak_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698