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

Side by Side Diff: base/message_loop.cc

Issue 42083: Avoid leaks at shutdown when running purify... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 while (!work_queue_.empty()) { 358 while (!work_queue_.empty()) {
359 PendingTask pending_task = work_queue_.front(); 359 PendingTask pending_task = work_queue_.front();
360 work_queue_.pop(); 360 work_queue_.pop();
361 if (!pending_task.delayed_run_time.is_null()) { 361 if (!pending_task.delayed_run_time.is_null()) {
362 // We want to delete delayed tasks in the same order in which they would 362 // We want to delete delayed tasks in the same order in which they would
363 // normally be deleted in case of any funny dependencies between delayed 363 // normally be deleted in case of any funny dependencies between delayed
364 // tasks. 364 // tasks.
365 AddToDelayedWorkQueue(pending_task); 365 AddToDelayedWorkQueue(pending_task);
366 } else { 366 } else {
367 // TODO(darin): Delete all tasks once it is safe to do so. 367 // TODO(darin): Delete all tasks once it is safe to do so.
368 //delete task; 368 // Until it is totally safe, just do it when running purify.
369 #ifdef PURIFY
370 delete task;
371 #endif // PURIFY
369 } 372 }
370 } 373 }
371 did_work |= !deferred_non_nestable_work_queue_.empty(); 374 did_work |= !deferred_non_nestable_work_queue_.empty();
372 while (!deferred_non_nestable_work_queue_.empty()) { 375 while (!deferred_non_nestable_work_queue_.empty()) {
376 Task* task = deferred_non_nestable_work_queue_.front().task;
377 deferred_non_nestable_work_queue_.pop();
373 // TODO(darin): Delete all tasks once it is safe to do so. 378 // TODO(darin): Delete all tasks once it is safe to do so.
374 //Task* task = deferred_non_nestable_work_queue_.front().task; 379 // Until it is totaly safe, just delete them to keep purify happy.
375 deferred_non_nestable_work_queue_.pop(); 380 #ifdef PURIFY
376 //delete task; 381 delete task;
382 #endif
377 } 383 }
378 did_work |= !delayed_work_queue_.empty(); 384 did_work |= !delayed_work_queue_.empty();
379 while (!delayed_work_queue_.empty()) { 385 while (!delayed_work_queue_.empty()) {
380 Task* task = delayed_work_queue_.top().task; 386 Task* task = delayed_work_queue_.top().task;
381 delayed_work_queue_.pop(); 387 delayed_work_queue_.pop();
382 delete task; 388 delete task;
383 } 389 }
384 return did_work; 390 return did_work;
385 } 391 }
386 392
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 Watcher *delegate) { 606 Watcher *delegate) {
601 return pump_libevent()->WatchFileDescriptor( 607 return pump_libevent()->WatchFileDescriptor(
602 fd, 608 fd,
603 persistent, 609 persistent,
604 static_cast<base::MessagePumpLibevent::Mode>(mode), 610 static_cast<base::MessagePumpLibevent::Mode>(mode),
605 controller, 611 controller,
606 delegate); 612 delegate);
607 } 613 }
608 614
609 #endif 615 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698