OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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/worker_pool_mac.h" | 5 #include "base/worker_pool_mac.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #import "base/scoped_nsautorelease_pool.h" | 9 #import "base/scoped_nsautorelease_pool.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 DCHECK(!task_.get()) | 89 DCHECK(!task_.get()) |
90 << "-[TaskOperation dealloc] called without running task"; | 90 << "-[TaskOperation dealloc] called without running task"; |
91 | 91 |
92 [super dealloc]; | 92 [super dealloc]; |
93 } | 93 } |
94 | 94 |
95 @end // @implementation TaskOperation | 95 @end // @implementation TaskOperation |
96 | 96 |
97 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, | 97 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, |
98 Task* task, bool task_is_slow) { | 98 Task* task, bool task_is_slow) { |
| 99 base::ScopedNSAutoreleasePool autorelease_pool; |
| 100 |
99 // Ignore |task_is_slow|, it doesn't map directly to any tunable aspect of | 101 // Ignore |task_is_slow|, it doesn't map directly to any tunable aspect of |
100 // an NSOperation. | 102 // an NSOperation. |
101 | 103 |
102 DCHECK(task) << "WorkerPool::PostTask called with no task"; | 104 DCHECK(task) << "WorkerPool::PostTask called with no task"; |
103 if (!task) { | 105 if (!task) { |
104 return false; | 106 return false; |
105 } | 107 } |
106 | 108 |
107 task->SetBirthPlace(from_here); | 109 task->SetBirthPlace(from_here); |
108 | 110 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Don't report "nothing to report". | 149 // Don't report "nothing to report". |
148 const size_t kUnaccountedOpsDelta = 10; | 150 const size_t kUnaccountedOpsDelta = 10; |
149 if (hung_ops.size() > 0 || outstanding_delta > kUnaccountedOpsDelta) { | 151 if (hung_ops.size() > 0 || outstanding_delta > kUnaccountedOpsDelta) { |
150 UMA_HISTOGRAM_COUNTS_100("OSX.HungWorkers", hung_ops.size()); | 152 UMA_HISTOGRAM_COUNTS_100("OSX.HungWorkers", hung_ops.size()); |
151 UMA_HISTOGRAM_COUNTS_100("OSX.OutstandingDelta", outstanding_delta); | 153 UMA_HISTOGRAM_COUNTS_100("OSX.OutstandingDelta", outstanding_delta); |
152 UMA_HISTOGRAM_COUNTS_100("OSX.RunningOps", running_ops); | 154 UMA_HISTOGRAM_COUNTS_100("OSX.RunningOps", running_ops); |
153 } | 155 } |
154 | 156 |
155 return true; | 157 return true; |
156 } | 158 } |
OLD | NEW |