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

Side by Side Diff: content/browser/loader/certificate_resource_handler.h

Issue 25536005: Clean up ResourceHandler API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | Annotate | Revision Log
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 CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ResourceResponse* resp, 49 ResourceResponse* resp,
50 bool* defer) OVERRIDE; 50 bool* defer) OVERRIDE;
51 51
52 // Pass-through implementation. 52 // Pass-through implementation.
53 virtual bool OnWillStart(int request_id, 53 virtual bool OnWillStart(int request_id,
54 const GURL& url, 54 const GURL& url,
55 bool* defer) OVERRIDE; 55 bool* defer) OVERRIDE;
56 56
57 // Create a new buffer to store received data. 57 // Create a new buffer to store received data.
58 virtual bool OnWillRead(int request_id, 58 virtual bool OnWillRead(int request_id,
59 net::IOBuffer** buf, 59 scoped_refptr<net::IOBuffer>* buf,
60 int* buf_size, 60 int* buf_size,
61 int min_size) OVERRIDE; 61 int min_size) OVERRIDE;
62 62
63 // A read was completed, maybe allocate a new buffer for further data. 63 // A read was completed, maybe allocate a new buffer for further data.
64 virtual bool OnReadCompleted(int request_id, 64 virtual bool OnReadCompleted(int request_id,
65 int bytes_read, 65 int bytes_read,
66 bool* defer) OVERRIDE; 66 bool* defer) OVERRIDE;
67 67
68 // Done downloading the certificate. 68 // Done downloading the certificate.
69 virtual bool OnResponseCompleted(int request_id, 69 virtual bool OnResponseCompleted(int request_id,
70 const net::URLRequestStatus& urs, 70 const net::URLRequestStatus& urs,
71 const std::string& sec_info) OVERRIDE; 71 const std::string& sec_info) OVERRIDE;
72 72
73 // N/A to cert downloading. 73 // N/A to cert downloading.
74 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE; 74 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE;
75 75
76 private: 76 private:
77 typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>, 77 typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>,
78 size_t> > ContentVector; 78 size_t> > ContentVector;
79 79
80 void AssembleResource(); 80 void AssembleResource();
81 81
82 GURL url_; 82 GURL url_;
83 net::URLRequest* request_;
84 size_t content_length_; 83 size_t content_length_;
85 ContentVector buffer_; 84 ContentVector buffer_;
86 scoped_refptr<net::IOBuffer> read_buffer_; 85 scoped_refptr<net::IOBuffer> read_buffer_;
87 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate. 86 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate.
88 net::CertificateMimeType cert_type_; 87 net::CertificateMimeType cert_type_;
89 DISALLOW_COPY_AND_ASSIGN(CertificateResourceHandler); 88 DISALLOW_COPY_AND_ASSIGN(CertificateResourceHandler);
90 }; 89 };
91 90
92 } // namespace content 91 } // namespace content
93 92
94 #endif // CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ 93 #endif // CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/buffered_resource_handler.cc ('k') | content/browser/loader/certificate_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698