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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 13 matching lines...) Expand all
24 namespace content { 24 namespace content {
25 25
26 // This class handles certificate mime types such as: 26 // This class handles certificate mime types such as:
27 // - "application/x-x509-user-cert" 27 // - "application/x-x509-user-cert"
28 // - "application/x-x509-ca-cert" 28 // - "application/x-x509-ca-cert"
29 // - "application/x-pkcs12" 29 // - "application/x-pkcs12"
30 // 30 //
31 class CertificateResourceHandler : public ResourceHandler { 31 class CertificateResourceHandler : public ResourceHandler {
32 public: 32 public:
33 explicit CertificateResourceHandler(net::URLRequest* request); 33 explicit CertificateResourceHandler(net::URLRequest* request);
34 virtual ~CertificateResourceHandler(); 34 ~CertificateResourceHandler() override;
35 35
36 virtual bool OnUploadProgress(uint64 position, uint64 size) override; 36 bool OnUploadProgress(uint64 position, uint64 size) override;
37 37
38 // Not needed, as this event handler ought to be the final resource. 38 // Not needed, as this event handler ought to be the final resource.
39 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 39 bool OnRequestRedirected(const net::RedirectInfo& redirect_info,
40 ResourceResponse* resp, 40 ResourceResponse* resp,
41 bool* defer) override; 41 bool* defer) override;
42 42
43 // Check if this indeed an X509 cert. 43 // Check if this indeed an X509 cert.
44 virtual bool OnResponseStarted(ResourceResponse* resp, 44 bool OnResponseStarted(ResourceResponse* resp, bool* defer) override;
45 bool* defer) override;
46 45
47 // Pass-through implementation. 46 // Pass-through implementation.
48 virtual bool OnWillStart(const GURL& url, bool* defer) override; 47 bool OnWillStart(const GURL& url, bool* defer) override;
49 48
50 // Pass-through implementation. 49 // Pass-through implementation.
51 virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; 50 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override;
52 51
53 // Create a new buffer to store received data. 52 // Create a new buffer to store received data.
54 virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 53 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
55 int* buf_size, 54 int* buf_size,
56 int min_size) override; 55 int min_size) override;
57 56
58 // A read was completed, maybe allocate a new buffer for further data. 57 // A read was completed, maybe allocate a new buffer for further data.
59 virtual bool OnReadCompleted(int bytes_read, bool* defer) override; 58 bool OnReadCompleted(int bytes_read, bool* defer) override;
60 59
61 // Done downloading the certificate. 60 // Done downloading the certificate.
62 virtual void OnResponseCompleted(const net::URLRequestStatus& urs, 61 void OnResponseCompleted(const net::URLRequestStatus& urs,
63 const std::string& sec_info, 62 const std::string& sec_info,
64 bool* defer) override; 63 bool* defer) override;
65 64
66 // N/A to cert downloading. 65 // N/A to cert downloading.
67 virtual void OnDataDownloaded(int bytes_downloaded) override; 66 void OnDataDownloaded(int bytes_downloaded) override;
68 67
69 private: 68 private:
70 typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>, 69 typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>,
71 size_t> > ContentVector; 70 size_t> > ContentVector;
72 71
73 void AssembleResource(); 72 void AssembleResource();
74 73
75 size_t content_length_; 74 size_t content_length_;
76 ContentVector buffer_; 75 ContentVector buffer_;
77 scoped_refptr<net::IOBuffer> read_buffer_; 76 scoped_refptr<net::IOBuffer> read_buffer_;
78 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate. 77 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate.
79 net::CertificateMimeType cert_type_; 78 net::CertificateMimeType cert_type_;
80 DISALLOW_COPY_AND_ASSIGN(CertificateResourceHandler); 79 DISALLOW_COPY_AND_ASSIGN(CertificateResourceHandler);
81 }; 80 };
82 81
83 } // namespace content 82 } // namespace content
84 83
85 #endif // CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ 84 #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/cross_site_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698