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

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

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_job_tracker.h" 5 #include "net/url_request/url_request_job_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/url_request/url_request_job.h" 10 #include "net/url_request/url_request_job.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 URLRequestJobTracker g_url_request_job_tracker; 14 URLRequestJobTracker g_url_request_job_tracker;
15 15
16 URLRequestJobTracker::URLRequestJobTracker() { 16 URLRequestJobTracker::URLRequestJobTracker() {
17 } 17 }
18 18
19 URLRequestJobTracker::~URLRequestJobTracker() { 19 URLRequestJobTracker::~URLRequestJobTracker() {
20 DLOG_IF(WARNING, active_jobs_.size() != 0) << 20 DLOG_IF(WARNING, !active_jobs_.empty()) <<
21 "Leaking " << active_jobs_.size() << " URLRequestJob object(s), this " 21 "Leaking " << active_jobs_.size() << " URLRequestJob object(s), this "
22 "could be because the URLRequest forgot to free it (bad), or if the " 22 "could be because the URLRequest forgot to free it (bad), or if the "
23 "program was terminated while a request was active (normal)."; 23 "program was terminated while a request was active (normal).";
24 } 24 }
25 25
26 void URLRequestJobTracker::AddNewJob(URLRequestJob* job) { 26 void URLRequestJobTracker::AddNewJob(URLRequestJob* job) {
27 active_jobs_.push_back(job); 27 active_jobs_.push_back(job);
28 FOR_EACH_OBSERVER(JobObserver, observers_, OnJobAdded(job)); 28 FOR_EACH_OBSERVER(JobObserver, observers_, OnJobAdded(job));
29 } 29 }
30 30
(...skipping 22 matching lines...) Expand all
53 } 53 }
54 54
55 void URLRequestJobTracker::OnBytesRead(URLRequestJob* job, 55 void URLRequestJobTracker::OnBytesRead(URLRequestJob* job,
56 const char* buf, 56 const char* buf,
57 int byte_count) { 57 int byte_count) {
58 FOR_EACH_OBSERVER(JobObserver, observers_, 58 FOR_EACH_OBSERVER(JobObserver, observers_,
59 OnBytesRead(job, buf, byte_count)); 59 OnBytesRead(job, buf, byte_count));
60 } 60 }
61 61
62 } // namespace net 62 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/flip_server/output_ordering.cc ('k') | net/url_request/url_request_throttler_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698