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

Unified Diff: content/common/file_path_watcher/file_path_watcher.cc

Issue 6670081: Move FilePathWatcher class from browser/... to common/... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up linux clang issue, and clean up bad commented block 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 side-by-side diff with in-line comments
Download patch
Index: content/common/file_path_watcher/file_path_watcher.cc
diff --git a/content/common/file_path_watcher/file_path_watcher.cc b/content/common/file_path_watcher/file_path_watcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..19cee5fdea6995a65983945e6bdfbf3c85ca96d3
--- /dev/null
+++ b/content/common/file_path_watcher/file_path_watcher.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Cross platform methods for FilePathWatcher. See the various platform
+// specific implementation files, too.
+
+#include "content/common/file_path_watcher/file_path_watcher.h"
+
+#include "base/logging.h"
+#include "base/message_loop.h"
+
+FilePathWatcher::~FilePathWatcher() {
+ impl_->Cancel();
+}
+
+bool FilePathWatcher::Watch(const FilePath& path,
+ Delegate* delegate,
+ base::MessageLoopProxy* loop) {
+ DCHECK(path.IsAbsolute());
+ return impl_->Watch(path, delegate, loop);
+}
+
+FilePathWatcher::PlatformDelegate::PlatformDelegate() {
+}
+
+FilePathWatcher::PlatformDelegate::~PlatformDelegate() {
+}
+
+void FilePathWatcher::DeletePlatformDelegate::Destruct(
+ const PlatformDelegate* delegate) {
+ scoped_refptr<base::MessageLoopProxy> loop = delegate->message_loop();
+ if (loop.get() == NULL || loop->BelongsToCurrentThread()) {
+ delete delegate;
+ } else {
+ loop->PostNonNestableTask(FROM_HERE,
+ new DeleteTask<PlatformDelegate>(delegate));
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698