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

Side by Side Diff: base/message_loop.cc

Issue 7528010: Remove Purify and Quantify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/memory/singleton_unittest.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 if (incoming_queue_.empty()) 519 if (incoming_queue_.empty())
520 return; 520 return;
521 incoming_queue_.Swap(&work_queue_); // Constant time 521 incoming_queue_.Swap(&work_queue_); // Constant time
522 DCHECK(incoming_queue_.empty()); 522 DCHECK(incoming_queue_.empty());
523 } 523 }
524 } 524 }
525 525
526 bool MessageLoop::DeletePendingTasks() { 526 bool MessageLoop::DeletePendingTasks() {
527 bool did_work = !work_queue_.empty(); 527 bool did_work = !work_queue_.empty();
528 // TODO(darin): Delete all tasks once it is safe to do so. 528 // TODO(darin): Delete all tasks once it is safe to do so.
529 // Until it is totally safe, just do it when running Purify or 529 // Until it is totally safe, just do it when running Valgrind.
530 // Valgrind.
531 // 530 //
532 // See http://crbug.com/61131 531 // See http://crbug.com/61131
533 // 532 //
534 #if defined(PURIFY) || defined(USE_HEAPCHECKER) 533 #ifdef USE_HEAPCHECKER
jam 2011/08/10 02:55:28 nit: i think #if defined() is the convention
535 should_leak_tasks_ = false; 534 should_leak_tasks_ = false;
536 #else 535 #else
537 if (RunningOnValgrind()) 536 if (RunningOnValgrind())
538 should_leak_tasks_ = false; 537 should_leak_tasks_ = false;
539 #endif // defined(OS_POSIX) 538 #endif // defined(OS_POSIX)
540 while (!work_queue_.empty()) { 539 while (!work_queue_.empty()) {
541 PendingTask pending_task = work_queue_.front(); 540 PendingTask pending_task = work_queue_.front();
542 work_queue_.pop(); 541 work_queue_.pop();
543 if (!pending_task.delayed_run_time.is_null()) { 542 if (!pending_task.delayed_run_time.is_null()) {
544 // We want to delete delayed tasks in the same order in which they would 543 // We want to delete delayed tasks in the same order in which they would
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 Watcher *delegate) { 840 Watcher *delegate) {
842 return pump_libevent()->WatchFileDescriptor( 841 return pump_libevent()->WatchFileDescriptor(
843 fd, 842 fd,
844 persistent, 843 persistent,
845 static_cast<base::MessagePumpLibevent::Mode>(mode), 844 static_cast<base::MessagePumpLibevent::Mode>(mode),
846 controller, 845 controller,
847 delegate); 846 delegate);
848 } 847 }
849 848
850 #endif 849 #endif
OLDNEW
« no previous file with comments | « base/memory/singleton_unittest.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698