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

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

Issue 1246753003: Move a subset of chrome/browser/chromeos/drive into components/drive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed incorrect reference to a GYP dependency. Created 5 years, 4 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/local_file_reader.h
diff --git a/chrome/browser/chromeos/drive/local_file_reader.h b/chrome/browser/chromeos/drive/local_file_reader.h
deleted file mode 100644
index 0b824da1861a31153e7a4e74c648bb6d3ff8de20..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/local_file_reader.h
+++ /dev/null
@@ -1,70 +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_LOCAL_FILE_READER_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_LOCAL_FILE_READER_H_
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "net/base/completion_callback.h"
-#include "net/base/file_stream.h"
-
-namespace base {
-class FilePath;
-class SequencedTaskRunner;
-} // namespace base
-
-namespace net {
-class IOBuffer;
-} // namespace net
-
-namespace drive {
-namespace util {
-
-// This is simple local file reader implementation focusing on Drive's use
-// case. All the operations run on |sequenced_task_runner| asynchronously and
-// the result will be notified to the caller via |callback|s on the caller's
-// thread.
-class LocalFileReader {
- public:
- explicit LocalFileReader(base::SequencedTaskRunner* sequenced_task_runner);
- ~LocalFileReader();
-
- // Opens the file at |file_path|. The initial position of the read will be
- // at |offset| from the beginning of the file.
- // Upon completion, |callback| will be called.
- // |callback| must not be null.
- void Open(const base::FilePath& file_path,
- int64 offset,
- const net::CompletionCallback& callback);
-
- // Reads the file and copies the data into |buffer|. |buffer_length|
- // is the length of |buffer|.
- // Upon completion, |callback| will be called with the result.
- // |callback| must not be null.
- void Read(net::IOBuffer* buffer,
- int buffer_length,
- const net::CompletionCallback& callback);
-
- private:
- void DidOpen(const net::CompletionCallback& callback,
- int64 offset,
- int error);
- void DidSeek(const net::CompletionCallback& callback,
- int64 offset,
- int64 error);
-
- net::FileStream file_stream_;
-
- // 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<LocalFileReader> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(LocalFileReader);
-};
-
-} // namespace util
-} // namespace drive
-
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_LOCAL_FILE_READER_H_
« no previous file with comments | « chrome/browser/chromeos/drive/job_scheduler_unittest.cc ('k') | chrome/browser/chromeos/drive/local_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698