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

Side by Side Diff: content/browser/service_worker/service_worker_read_from_cache_job.h

Issue 1439953006: Reland: URLRequestJob: change ReadRawData contract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address David's comment Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // net::URLRequestJob overrides 45 // net::URLRequestJob overrides
46 void Start() override; 46 void Start() override;
47 void Kill() override; 47 void Kill() override;
48 net::LoadState GetLoadState() const override; 48 net::LoadState GetLoadState() const override;
49 bool GetCharset(std::string* charset) override; 49 bool GetCharset(std::string* charset) override;
50 bool GetMimeType(std::string* mime_type) const override; 50 bool GetMimeType(std::string* mime_type) const override;
51 void GetResponseInfo(net::HttpResponseInfo* info) override; 51 void GetResponseInfo(net::HttpResponseInfo* info) override;
52 int GetResponseCode() const override; 52 int GetResponseCode() const override;
53 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; 53 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
54 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; 54 int ReadRawData(net::IOBuffer* buf, int buf_size) override;
55 55
56 // Reader completion callbacks. 56 // Reader completion callbacks.
57 void OnReadInfoComplete(int result); 57 void OnReadInfoComplete(int result);
58 void OnReadComplete(int result); 58 void OnReadComplete(int result);
59 59
60 // Helpers 60 // Helpers
61 void StartAsync();
61 const net::HttpResponseInfo* http_info() const; 62 const net::HttpResponseInfo* http_info() const;
62 bool is_range_request() const { return range_requested_.IsValid(); } 63 bool is_range_request() const { return range_requested_.IsValid(); }
63 void SetupRangeResponse(int response_data_size); 64 void SetupRangeResponse(int response_data_size);
64 void Done(const net::URLRequestStatus& status); 65 void Done(const net::URLRequestStatus& status);
65 66
66 ResourceType resource_type_; 67 ResourceType resource_type_;
67 base::WeakPtr<ServiceWorkerContextCore> context_; 68 base::WeakPtr<ServiceWorkerContextCore> context_;
68 scoped_refptr<ServiceWorkerVersion> version_; 69 scoped_refptr<ServiceWorkerVersion> version_;
69 int64 resource_id_; 70 int64 resource_id_;
70 scoped_ptr<ServiceWorkerResponseReader> reader_; 71 scoped_ptr<ServiceWorkerResponseReader> reader_;
71 scoped_refptr<HttpResponseInfoIOBuffer> http_info_io_buffer_; 72 scoped_refptr<HttpResponseInfoIOBuffer> http_info_io_buffer_;
72 scoped_ptr<net::HttpResponseInfo> http_info_; 73 scoped_ptr<net::HttpResponseInfo> http_info_;
73 net::HttpByteRange range_requested_; 74 net::HttpByteRange range_requested_;
74 scoped_ptr<net::HttpResponseInfo> range_response_info_; 75 scoped_ptr<net::HttpResponseInfo> range_response_info_;
75 bool has_been_killed_; 76 bool has_been_killed_;
76 base::WeakPtrFactory<ServiceWorkerReadFromCacheJob> weak_factory_; 77 base::WeakPtrFactory<ServiceWorkerReadFromCacheJob> weak_factory_;
77 78
78 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerReadFromCacheJob); 79 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerReadFromCacheJob);
79 }; 80 };
80 81
81 } // namespace content 82 } // namespace content
82 83
83 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_ 84 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_READ_FROM_CACHE_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698