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

Side by Side Diff: storage/browser/blob/blob_url_request_job.h

Issue 2940553003: Failure in reading Blob URL should results in network error
Patch Set: . Created 3 years, 6 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 STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_ 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_
6 #define STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_ 6 #define STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Helper method to create the HTTP headers for the response. 55 // Helper method to create the HTTP headers for the response.
56 // |blob_handles|, |blob_reader|, |byte_range| and |content_size| are only 56 // |blob_handles|, |blob_reader|, |byte_range| and |content_size| are only
57 // used if status_code isn't an error. 57 // used if status_code isn't an error.
58 static scoped_refptr<net::HttpResponseHeaders> GenerateHeaders( 58 static scoped_refptr<net::HttpResponseHeaders> GenerateHeaders(
59 net::HttpStatusCode status_code, 59 net::HttpStatusCode status_code,
60 BlobDataHandle* blob_handle, 60 BlobDataHandle* blob_handle,
61 BlobReader* blob_reader, 61 BlobReader* blob_reader,
62 net::HttpByteRange* byte_range, 62 net::HttpByteRange* byte_range,
63 int64_t* content_size); 63 int64_t* content_size);
64 64
65 // Helper method to map from a net error to an http status code.
66 static net::HttpStatusCode NetErrorToHttpStatusCode(int error_code);
67
68 protected: 65 protected:
69 ~BlobURLRequestJob() override; 66 ~BlobURLRequestJob() override;
70 67
71 private: 68 private:
72 typedef std::map<size_t, FileStreamReader*> IndexToReaderMap; 69 typedef std::map<size_t, FileStreamReader*> IndexToReaderMap;
73 70
74 // For preparing for read: get the size, apply the range and perform seek. 71 // For preparing for read: get the size, apply the range and perform seek.
75 void DidStart(); 72 void DidStart();
76 void DidCalculateSize(int result); 73 void DidCalculateSize(int result);
77 void DidReadMetadata(BlobReader::Status result); 74 void DidReadMetadata(BlobReader::Status result);
(...skipping 13 matching lines...) Expand all
91 std::unique_ptr<net::HttpResponseInfo> response_info_; 88 std::unique_ptr<net::HttpResponseInfo> response_info_;
92 89
93 base::WeakPtrFactory<BlobURLRequestJob> weak_factory_; 90 base::WeakPtrFactory<BlobURLRequestJob> weak_factory_;
94 91
95 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); 92 DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob);
96 }; 93 };
97 94
98 } // namespace storage 95 } // namespace storage
99 96
100 #endif // STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_ 97 #endif // STORAGE_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_browsertest.cc ('k') | storage/browser/blob/blob_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698