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

Unified Diff: chrome/browser/chromeos/drive/file_system/truncate_operation.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_system/truncate_operation.h
diff --git a/chrome/browser/chromeos/drive/file_system/truncate_operation.h b/chrome/browser/chromeos/drive/file_system/truncate_operation.h
deleted file mode 100644
index 5067c6b971a6f6b94832045e727b3dd16b0e11af..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/file_system/truncate_operation.h
+++ /dev/null
@@ -1,88 +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_SYSTEM_TRUNCATE_OPERATION_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_TRUNCATE_OPERATION_H_
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/thread_checker.h"
-#include "chrome/browser/chromeos/drive/file_errors.h"
-
-namespace base {
-class FilePath;
-class SequencedTaskRunner;
-} // namespace base
-
-namespace drive {
-
-class JobScheduler;
-class ResourceEntry;
-
-namespace internal {
-class FileCache;
-class ResourceMetadata;
-} // namespace internal
-
-namespace file_system {
-
-class OperationDelegate;
-class DownloadOperation;
-
-// This class encapsulates the drive Truncate function. It is responsible for
-// fetching the content from the Drive server if necessary, truncating the
-// file content actually, and then notifying the file is locally modified and
-// that it is necessary to upload the file to the server.
-class TruncateOperation {
- public:
- TruncateOperation(base::SequencedTaskRunner* blocking_task_runner,
- OperationDelegate* delegate,
- JobScheduler* scheduler,
- internal::ResourceMetadata* metadata,
- internal::FileCache* cache,
- const base::FilePath& temporary_file_directory);
- ~TruncateOperation();
-
- // Performs the truncate operation on the file at drive path |file_path| to
- // |length| bytes. Invokes |callback| when finished with the result of the
- // operation. |callback| must not be null.
- void Truncate(const base::FilePath& file_path,
- int64 length,
- const FileOperationCallback& callback);
- private:
- // Part of Truncate(). Called after EnsureFileDownloadedByPath() is complete.
- void TruncateAfterEnsureFileDownloadedByPath(
- int64 length,
- const FileOperationCallback& callback,
- FileError error,
- const base::FilePath& local_file_path,
- scoped_ptr<ResourceEntry> resource_entry);
-
- // Part of Truncate(). Called after TruncateOnBlockingPool() is complete.
- void TruncateAfterTruncateOnBlockingPool(
- const std::string& local_id,
- const FileOperationCallback& callback,
- FileError error);
-
- scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
- OperationDelegate* delegate_;
- internal::ResourceMetadata* metadata_;
- internal::FileCache* cache_;
-
- scoped_ptr<DownloadOperation> download_operation_;
-
- base::ThreadChecker thread_checker_;
-
- // Note: This should remain the last member so it'll be destroyed and
- // invalidate the weak pointers before any other members are destroyed.
- base::WeakPtrFactory<TruncateOperation> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(TruncateOperation);
-};
-
-} // namespace file_system
-} // namespace drive
-
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_TRUNCATE_OPERATION_H_

Powered by Google App Engine
This is Rietveld 408576698