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

Side by Side Diff: webkit/fileapi/file_system_url_request_job.h

Issue 10080001: Reland 132134 with memory fix - Use LocalFileReader in FileSystemURLRequestJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Read return value fix Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/blob/local_file_reader.cc ('k') | webkit/fileapi/file_system_url_request_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/message_loop_proxy.h" 14 #include "base/message_loop_proxy.h"
15 #include "base/platform_file.h" 15 #include "base/platform_file.h"
16 #include "net/http/http_byte_range.h" 16 #include "net/http/http_byte_range.h"
17 #include "net/url_request/url_request_job.h" 17 #include "net/url_request/url_request_job.h"
18 18
19 class GURL; 19 class GURL;
20 class FilePath; 20 class FilePath;
21 21
22 namespace net {
23 class FileStream;
24 }
25
26 namespace webkit_blob { 22 namespace webkit_blob {
23 class LocalFileReader;
27 class ShareableFileReference; 24 class ShareableFileReference;
28 } 25 }
29 26
30 namespace fileapi { 27 namespace fileapi {
31 class FileSystemContext; 28 class FileSystemContext;
32 29
33 // A request job that handles reading filesystem: URLs 30 // A request job that handles reading filesystem: URLs
34 class FileSystemURLRequestJob : public net::URLRequestJob { 31 class FileSystemURLRequestJob : public net::URLRequestJob {
35 public: 32 public:
36 FileSystemURLRequestJob( 33 FileSystemURLRequestJob(
(...skipping 29 matching lines...) Expand all
66 const FilePath& platform_path, 63 const FilePath& platform_path,
67 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); 64 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
68 void DidOpen(base::PlatformFileError error_code, 65 void DidOpen(base::PlatformFileError error_code,
69 base::PassPlatformFile file, bool created); 66 base::PassPlatformFile file, bool created);
70 void DidRead(int result); 67 void DidRead(int result);
71 void NotifyFailed(int rv); 68 void NotifyFailed(int rv);
72 69
73 FileSystemContext* file_system_context_; 70 FileSystemContext* file_system_context_;
74 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; 71 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_;
75 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_; 72 base::WeakPtrFactory<FileSystemURLRequestJob> weak_factory_;
76 scoped_ptr<net::FileStream> stream_; 73 scoped_ptr<webkit_blob::LocalFileReader> reader_;
77 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; 74 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_;
78 bool is_directory_; 75 bool is_directory_;
79 scoped_ptr<net::HttpResponseInfo> response_info_; 76 scoped_ptr<net::HttpResponseInfo> response_info_;
80 int64 remaining_bytes_; 77 int64 remaining_bytes_;
81 net::HttpByteRange byte_range_; 78 net::HttpByteRange byte_range_;
82 79
83 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); 80 DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob);
84 }; 81 };
85 82
86 } // namespace fileapi 83 } // namespace fileapi
87 84
88 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ 85 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « webkit/blob/local_file_reader.cc ('k') | webkit/fileapi/file_system_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698