| OLD | NEW |
| 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_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> |
| 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 13 #include "content/browser/download/download_buffer.h" | |
| 14 #include "content/browser/renderer_host/resource_handler.h" | 16 #include "content/browser/renderer_host/resource_handler.h" |
| 15 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 16 | 18 |
| 17 namespace net { | 19 namespace net { |
| 18 class IOBuffer; | 20 class IOBuffer; |
| 19 class URLRequest; | 21 class URLRequest; |
| 20 class URLRequestStatus; | 22 class URLRequestStatus; |
| 21 } // namespace net | 23 } // namespace net |
| 22 | 24 |
| 23 namespace content { | 25 namespace content { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual bool OnReadCompleted(int request_id, | 65 virtual bool OnReadCompleted(int request_id, |
| 64 int* bytes_read, | 66 int* bytes_read, |
| 65 bool* defer) OVERRIDE; | 67 bool* defer) OVERRIDE; |
| 66 | 68 |
| 67 // Done downloading the certificate. | 69 // Done downloading the certificate. |
| 68 virtual bool OnResponseCompleted(int request_id, | 70 virtual bool OnResponseCompleted(int request_id, |
| 69 const net::URLRequestStatus& urs, | 71 const net::URLRequestStatus& urs, |
| 70 const std::string& sec_info) OVERRIDE; | 72 const std::string& sec_info) OVERRIDE; |
| 71 | 73 |
| 72 private: | 74 private: |
| 75 typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>, |
| 76 size_t> > ContentVector; |
| 77 |
| 73 void AssembleResource(); | 78 void AssembleResource(); |
| 74 | 79 |
| 75 GURL url_; | 80 GURL url_; |
| 76 net::URLRequest* request_; | 81 net::URLRequest* request_; |
| 77 size_t content_length_; | 82 size_t content_length_; |
| 78 ContentVector buffer_; | 83 ContentVector buffer_; |
| 79 scoped_refptr<net::IOBuffer> read_buffer_; | 84 scoped_refptr<net::IOBuffer> read_buffer_; |
| 80 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate. | 85 scoped_refptr<net::IOBuffer> resource_buffer_; // Downloaded certificate. |
| 81 // The id of the |RenderProcessHost| which started the download. | 86 // The id of the |RenderProcessHost| which started the download. |
| 82 int render_process_host_id_; | 87 int render_process_host_id_; |
| 83 // The id of the |RenderView| which started the download. | 88 // The id of the |RenderView| which started the download. |
| 84 int render_view_id_; | 89 int render_view_id_; |
| 85 | 90 |
| 86 DISALLOW_COPY_AND_ASSIGN(X509UserCertResourceHandler); | 91 DISALLOW_COPY_AND_ASSIGN(X509UserCertResourceHandler); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace content | 94 } // namespace content |
| 90 | 95 |
| 91 #endif // CONTENT_BROWSER_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ | 96 #endif // CONTENT_BROWSER_RENDERER_HOST_X509_USER_CERT_RESOURCE_HANDLER_H_ |
| OLD | NEW |