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

Unified Diff: chrome/browser/chromeos/drive/file_write_watcher.h

Issue 1215503010: OBSOLETE: Move (most of) chrome/browser/chromeos/drive into components/drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drive-componentize-service
Patch Set: Created 5 years, 6 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: chrome/browser/chromeos/drive/file_write_watcher.h
diff --git a/chrome/browser/chromeos/drive/file_write_watcher.h b/chrome/browser/chromeos/drive/file_write_watcher.h
deleted file mode 100644
index f90bd75cd0e184b0e4b6cc6509dba4dd5c01fab5..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/file_write_watcher.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_WATCHER_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_WATCHER_H_
-
-#include "base/callback_forward.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/threading/thread_checker.h"
-#include "chrome/browser/chromeos/drive/file_system_core_util.h"
-
-namespace base {
-class FilePath;
-class SingleThreadTaskRunner;
-} // namespace base
-
-namespace drive {
-
-namespace internal {
-
-typedef base::Callback<void(bool)> StartWatchCallback;
-
-// The class watches modification to Drive files in the cache directory.
-// This is used for returning a local writable snapshot of Drive files from the
-// Save-As file dialog, so that the callers of the dialog can save to Drive
-// without any special handling about Drive.
-class FileWriteWatcher {
- public:
- explicit FileWriteWatcher(base::SingleThreadTaskRunner* file_task_runner);
- ~FileWriteWatcher();
-
- // Starts watching the modification to |path|. When it successfully started
- // watching, it runs |on_start_callback| by passing true as the argument.
- // Or if it failed, the callback is run with false.
- // Detected modification is notified by calling |on_write_callback|.
- //
- // Currently, the modification is watched in "one-shot" manner. That is, once
- // a modification is notified, the watch is deactivated for freeing system
- // resources. As a heuristic to capture the real end of write operations that
- // might be done by several chunked writes, the notification is fired after
- // 5 seconds has passed after the last write operation is detected.
- //
- // TODO(kinaba): investigate the possibility to continuously watch the whole
- // cache directory. http://crbug.com/269424
- void StartWatch(const base::FilePath& path,
- const StartWatchCallback& on_start_callback,
- const base::Closure& on_write_callback);
-
- // For testing purpose, stops inserting delay between the write detection and
- // notification to the |on_write_callback|.
- void DisableDelayForTesting();
-
- private:
- class FileWriteWatcherImpl;
- scoped_ptr<FileWriteWatcherImpl, util::DestroyHelper> watcher_impl_;
-
- base::ThreadChecker thread_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(FileWriteWatcher);
-};
-
-} // namespace internal
-} // namespace drive
-
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_WATCHER_H_

Powered by Google App Engine
This is Rietveld 408576698