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

Unified Diff: net/base/upload_file_element_reader.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/base/upload_element_reader.cc ('k') | net/base/upload_file_element_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_file_element_reader.h
diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h
deleted file mode 100644
index fc3f3349a8bbac7c7efacf2173b65c6df1efa000..0000000000000000000000000000000000000000
--- a/net/base/upload_file_element_reader.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2012 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 NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
-#define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
-
-#include "base/compiler_specific.h"
-#include "base/files/file.h"
-#include "base/files/file_path.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/time/time.h"
-#include "net/base/upload_element_reader.h"
-
-namespace base {
-class TaskRunner;
-}
-
-namespace net {
-
-class FileStream;
-
-// An UploadElementReader implementation for file.
-class NET_EXPORT UploadFileElementReader : public UploadElementReader {
- public:
- // |task_runner| is used to perform file operations. It must not be NULL.
- UploadFileElementReader(base::TaskRunner* task_runner,
- const base::FilePath& path,
- uint64 range_offset,
- uint64 range_length,
- const base::Time& expected_modification_time);
- ~UploadFileElementReader() override;
-
- const base::FilePath& path() const { return path_; }
- uint64 range_offset() const { return range_offset_; }
- uint64 range_length() const { return range_length_; }
- const base::Time& expected_modification_time() const {
- return expected_modification_time_;
- }
-
- // UploadElementReader overrides:
- const UploadFileElementReader* AsFileReader() const override;
- int Init(const CompletionCallback& callback) override;
- uint64 GetContentLength() const override;
- uint64 BytesRemaining() const override;
- int Read(IOBuffer* buf,
- int buf_length,
- const CompletionCallback& callback) override;
-
- private:
- FRIEND_TEST_ALL_PREFIXES(ElementsUploadDataStreamTest, FileSmallerThanLength);
- FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
- UploadFileSmallerThanLength);
-
- // Resets this instance to the uninitialized state.
- void Reset();
-
- // These methods are used to implement Init().
- void OnOpenCompleted(const CompletionCallback& callback, int result);
- void OnSeekCompleted(const CompletionCallback& callback, int64 result);
- void OnGetFileInfoCompleted(const CompletionCallback& callback,
- base::File::Info* file_info,
- bool result);
-
- // This method is used to implement Read().
- int OnReadCompleted(const CompletionCallback& callback, int result);
-
- // Sets an value to override the result for GetContentLength().
- // Used for tests.
- struct NET_EXPORT_PRIVATE ScopedOverridingContentLengthForTests {
- ScopedOverridingContentLengthForTests(uint64 value);
- ~ScopedOverridingContentLengthForTests();
- };
-
- scoped_refptr<base::TaskRunner> task_runner_;
- const base::FilePath path_;
- const uint64 range_offset_;
- const uint64 range_length_;
- const base::Time expected_modification_time_;
- scoped_ptr<FileStream> file_stream_;
- uint64 content_length_;
- uint64 bytes_remaining_;
- base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader);
-};
-
-} // namespace net
-
-#endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
« no previous file with comments | « net/base/upload_element_reader.cc ('k') | net/base/upload_file_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698