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

Side by Side Diff: net/url_request/url_request_file_job.h

Issue 10701050: net: Implement canceling of all async operations in FileStream. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Update after http://crrev.com/159454 Created 8 years, 2 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 unified diff | Download patch
OLDNEW
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 NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "net/base/file_stream.h" 12 #include "net/base/file_stream.h"
willchan no longer on Chromium 2012/10/30 18:01:27 forward declare instead now?
pivanof 2012/10/30 18:54:21 Yep, will do.
13 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
14 #include "net/http/http_byte_range.h" 14 #include "net/http/http_byte_range.h"
15 #include "net/url_request/url_request.h" 15 #include "net/url_request/url_request.h"
16 #include "net/url_request/url_request_job.h" 16 #include "net/url_request/url_request_job.h"
17 17
18 namespace file_util { 18 namespace file_util {
19 struct FileInfo; 19 struct FileInfo;
20 } 20 }
21 21
22 namespace net { 22 namespace net {
(...skipping 26 matching lines...) Expand all
49 // The OS-specific full path name of the file 49 // The OS-specific full path name of the file
50 FilePath file_path_; 50 FilePath file_path_;
51 51
52 private: 52 private:
53 // Callback after fetching file info on a background thread. 53 // Callback after fetching file info on a background thread.
54 void DidResolve(bool exists, const base::PlatformFileInfo& file_info); 54 void DidResolve(bool exists, const base::PlatformFileInfo& file_info);
55 55
56 // Callback after data is asynchronously read from the file. 56 // Callback after data is asynchronously read from the file.
57 void DidRead(int result); 57 void DidRead(int result);
58 58
59 FileStream stream_; 59 scoped_ptr<FileStream> stream_;
60 bool is_directory_; 60 bool is_directory_;
61 61
62 HttpByteRange byte_range_; 62 HttpByteRange byte_range_;
63 int64 remaining_bytes_; 63 int64 remaining_bytes_;
64 64
65 // The initial file metadata is fetched on a background thread. 65 // The initial file metadata is fetched on a background thread.
66 // AsyncResolver runs that task. 66 // AsyncResolver runs that task.
67 class AsyncResolver; 67 class AsyncResolver;
68 friend class AsyncResolver; 68 friend class AsyncResolver;
69 scoped_refptr<AsyncResolver> async_resolver_; 69 scoped_refptr<AsyncResolver> async_resolver_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob); 71 DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob);
72 }; 72 };
73 73
74 } // namespace net 74 } // namespace net
75 75
76 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_ 76 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698