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

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

Issue 10378005: Add more variables to the URLRequest leak assertion crash dumps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « net/url_request/url_request.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_context.h" 5 #include "net/url_request/url_request_context.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/debug/alias.h" 8 #include "base/debug/alias.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/host_resolver.h" 10 #include "net/base/host_resolver.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 void URLRequestContext::AssertNoURLRequests() const { 70 void URLRequestContext::AssertNoURLRequests() const {
71 int num_requests = url_requests_->size(); 71 int num_requests = url_requests_->size();
72 if (num_requests != 0) { 72 if (num_requests != 0) {
73 // We're leaking URLRequests :( Dump the URL of the first one and record how 73 // We're leaking URLRequests :( Dump the URL of the first one and record how
74 // many we leaked so we have an idea of how bad it is. 74 // many we leaked so we have an idea of how bad it is.
75 char url_buf[128]; 75 char url_buf[128];
76 const URLRequest* request = *url_requests_->begin(); 76 const URLRequest* request = *url_requests_->begin();
77 base::strlcpy(url_buf, request->url().spec().c_str(), arraysize(url_buf)); 77 base::strlcpy(url_buf, request->url().spec().c_str(), arraysize(url_buf));
78 bool has_delegate = request->has_delegate();
79 int load_flags = request->load_flags();
78 base::debug::Alias(url_buf); 80 base::debug::Alias(url_buf);
79 base::debug::Alias(&num_requests); 81 base::debug::Alias(&num_requests);
82 base::debug::Alias(&has_delegate);
83 base::debug::Alias(&load_flags);
80 CHECK(false); 84 CHECK(false);
81 } 85 }
82 } 86 }
83 87
84 URLRequestContext::~URLRequestContext() { 88 URLRequestContext::~URLRequestContext() {
85 AssertNoURLRequests(); 89 AssertNoURLRequests();
86 } 90 }
87 91
88 } // namespace net 92 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698