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

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

Issue 2837313002: Add UMA to track the number of live URLRequests. (Closed)
Patch Set: temp Created 3 years, 8 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) 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 // This class represents contextual information (cookies, cache, etc.) 5 // This class represents contextual information (cookies, cache, etc.)
6 // that's necessary when processing resource requests. 6 // that's necessary when processing resource requests.
7 7
8 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 8 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
9 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 9 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 void set_sdch_manager(SdchManager* sdch_manager) { 218 void set_sdch_manager(SdchManager* sdch_manager) {
219 sdch_manager_ = sdch_manager; 219 sdch_manager_ = sdch_manager;
220 } 220 }
221 221
222 // Gets the URLRequest objects that hold a reference to this 222 // Gets the URLRequest objects that hold a reference to this
223 // URLRequestContext. 223 // URLRequestContext.
224 std::set<const URLRequest*>* url_requests() const { 224 std::set<const URLRequest*>* url_requests() const {
225 return url_requests_.get(); 225 return url_requests_.get();
226 } 226 }
227 227
228 void InsertURLRequest(const URLRequest* request);
229
230 void RemoveURLRequest(const URLRequest* request);
231
228 // CHECKs that no URLRequests using this context remain. Subclasses should 232 // CHECKs that no URLRequests using this context remain. Subclasses should
229 // additionally call AssertNoURLRequests() within their own destructor, 233 // additionally call AssertNoURLRequests() within their own destructor,
230 // prior to implicit destruction of subclass-owned state. 234 // prior to implicit destruction of subclass-owned state.
231 void AssertNoURLRequests() const; 235 void AssertNoURLRequests() const;
232 236
233 // Get the underlying |HttpUserAgentSettings| implementation that provides 237 // Get the underlying |HttpUserAgentSettings| implementation that provides
234 // the HTTP Accept-Language and User-Agent header values. 238 // the HTTP Accept-Language and User-Agent header values.
235 const HttpUserAgentSettings* http_user_agent_settings() const { 239 const HttpUserAgentSettings* http_user_agent_settings() const {
236 return http_user_agent_settings_; 240 return http_user_agent_settings_;
237 } 241 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 bool enable_brotli_; 322 bool enable_brotli_;
319 // Enables checking system policy before allowing a cleartext http or ws 323 // Enables checking system policy before allowing a cleartext http or ws
320 // request. Only used on Android. 324 // request. Only used on Android.
321 bool check_cleartext_permitted_; 325 bool check_cleartext_permitted_;
322 326
323 // An optional name which can be set to describe this URLRequestContext. 327 // An optional name which can be set to describe this URLRequestContext.
324 // Used in MemoryDumpProvier to annotate memory usage. The name does not need 328 // Used in MemoryDumpProvier to annotate memory usage. The name does not need
325 // to be unique. 329 // to be unique.
326 const char* name_; 330 const char* name_;
327 331
332 // The largest number of outstanding URLRequests that have been created by
333 // |this| and are not yet destroyed. This doesn't need to be in CopyFrom.
334 size_t largest_outstanding_requests_count_seen_;
335
328 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); 336 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
329 }; 337 };
330 338
331 } // namespace net 339 } // namespace net
332 340
333 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 341 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698