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

Side by Side Diff: content/common/file_path_watcher/file_path_watcher_mac.cc

Issue 6693075: Fix up leak in FilePathWatcherTest and UserStyleSheetTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
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 "content/common/file_path_watcher/file_path_watcher.h" 5 #include "content/common/file_path_watcher/file_path_watcher.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/event.h> 8 #include <sys/event.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 10
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 467 }
468 468
469 void FilePathWatcherImpl::CancelOnMessageLoopThread() { 469 void FilePathWatcherImpl::CancelOnMessageLoopThread() {
470 DCHECK(MessageLoopForIO::current()); 470 DCHECK(MessageLoopForIO::current());
471 if (!is_cancelled()) { 471 if (!is_cancelled()) {
472 set_cancelled(); 472 set_cancelled();
473 kqueue_watcher_.StopWatchingFileDescriptor(); 473 kqueue_watcher_.StopWatchingFileDescriptor();
474 CloseFileDescriptor(&kqueue_); 474 CloseFileDescriptor(&kqueue_);
475 std::for_each(events_.begin(), events_.end(), ReleaseEvent); 475 std::for_each(events_.begin(), events_.end(), ReleaseEvent);
476 events_.clear(); 476 events_.clear();
477 io_message_loop_.release(); 477 io_message_loop_ = NULL;
478 MessageLoop::current()->RemoveDestructionObserver(this); 478 MessageLoop::current()->RemoveDestructionObserver(this);
479 delegate_ = NULL; 479 delegate_ = NULL;
480 } 480 }
481 } 481 }
482 482
483 } // namespace 483 } // namespace
484 484
485 FilePathWatcher::FilePathWatcher() { 485 FilePathWatcher::FilePathWatcher() {
486 impl_ = new FilePathWatcherImpl(); 486 impl_ = new FilePathWatcherImpl();
487 } 487 }
OLDNEW
« no previous file with comments | « chrome/browser/user_style_sheet_watcher_unittest.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698