OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/download/download_file.h" | 9 #include "content/browser/download/download_file.h" |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "content/browser/download/base_file.h" | 12 #include "content/browser/download/base_file.h" |
13 #include "content/browser/download/byte_stream.h" | |
13 #include "content/browser/download/download_request_handle.h" | 14 #include "content/browser/download/download_request_handle.h" |
14 | 15 |
15 struct DownloadCreateInfo; | 16 struct DownloadCreateInfo; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 class DownloadManager; | 19 class DownloadManager; |
19 } | 20 } |
20 | 21 |
21 class CONTENT_EXPORT DownloadFileImpl : virtual public content::DownloadFile { | 22 class CONTENT_EXPORT DownloadFileImpl : virtual public content::DownloadFile { |
22 public: | 23 public: |
(...skipping 21 matching lines...) Expand all Loading... | |
44 virtual int64 CurrentSpeed() const OVERRIDE; | 45 virtual int64 CurrentSpeed() const OVERRIDE; |
45 virtual bool GetHash(std::string* hash) OVERRIDE; | 46 virtual bool GetHash(std::string* hash) OVERRIDE; |
46 virtual std::string GetHashState() OVERRIDE; | 47 virtual std::string GetHashState() OVERRIDE; |
47 virtual void CancelDownloadRequest() OVERRIDE; | 48 virtual void CancelDownloadRequest() OVERRIDE; |
48 virtual int Id() const OVERRIDE; | 49 virtual int Id() const OVERRIDE; |
49 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; | 50 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; |
50 virtual const content::DownloadId& GlobalId() const OVERRIDE; | 51 virtual const content::DownloadId& GlobalId() const OVERRIDE; |
51 virtual std::string DebugString() const OVERRIDE; | 52 virtual std::string DebugString() const OVERRIDE; |
52 | 53 |
53 private: | 54 private: |
55 void PipeActive(); | |
ahendrickson
2012/04/16 15:14:27
I was not clear as to what this function does. Ne
Randy Smith (Not in Mondays)
2012/04/18 19:10:38
Added comment; let me know if you still think I ne
| |
56 | |
54 // The base file instance. | 57 // The base file instance. |
55 BaseFile file_; | 58 BaseFile file_; |
56 | 59 |
60 // The pipe through which data comes. | |
61 // TODO(rdsmith): Move this into BaseFile; requires using the same | |
62 // pipe semantics in SavePackage. | |
63 scoped_refptr<content::ByteStream> input_pipe_; | |
64 | |
57 // The unique identifier for this download, assigned at creation by | 65 // The unique identifier for this download, assigned at creation by |
58 // the DownloadFileManager for its internal record keeping. | 66 // the DownloadFileManager for its internal record keeping. |
59 content::DownloadId id_; | 67 content::DownloadId id_; |
60 | 68 |
61 // The handle to the request information. Used for operations outside the | 69 // The handle to the request information. Used for operations outside the |
62 // download system, specifically canceling a download. | 70 // download system, specifically canceling a download. |
63 scoped_ptr<DownloadRequestHandleInterface> request_handle_; | 71 scoped_ptr<DownloadRequestHandleInterface> request_handle_; |
64 | 72 |
65 // DownloadManager this download belongs to. | 73 // DownloadManager this download belongs to. |
66 scoped_refptr<content::DownloadManager> download_manager_; | 74 scoped_refptr<content::DownloadManager> download_manager_; |
67 | 75 |
68 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); | 76 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); |
69 }; | 77 }; |
70 | 78 |
71 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 79 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
OLD | NEW |