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

Side by Side Diff: content/browser/renderer_host/buffered_resource_handler.cc

Issue 11266008: Fix certificate and keychain installation on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 (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 #include "content/browser/renderer_host/buffered_resource_handler.h" 5 #include "content/browser/renderer_host/buffered_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "content/browser/download/download_resource_handler.h" 13 #include "content/browser/download/download_resource_handler.h"
14 #include "content/browser/download/download_stats.h" 14 #include "content/browser/download/download_stats.h"
15 #include "content/browser/plugin_service_impl.h" 15 #include "content/browser/plugin_service_impl.h"
16 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 16 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
17 #include "content/browser/renderer_host/resource_request_info_impl.h" 17 #include "content/browser/renderer_host/resource_request_info_impl.h"
18 #include "content/browser/renderer_host/x509_user_cert_resource_handler.h" 18 #include "content/browser/renderer_host/certificate_resource_handler.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/content_browser_client.h" 20 #include "content/public/browser/content_browser_client.h"
21 #include "content/public/browser/download_save_info.h" 21 #include "content/public/browser/download_save_info.h"
22 #include "content/public/browser/resource_context.h" 22 #include "content/public/browser/resource_context.h"
23 #include "content/public/browser/resource_dispatcher_host_delegate.h" 23 #include "content/public/browser/resource_dispatcher_host_delegate.h"
24 #include "content/public/common/resource_response.h" 24 #include "content/public/common/resource_response.h"
25 #include "net/base/io_buffer.h" 25 #include "net/base/io_buffer.h"
26 #include "net/base/mime_sniffer.h" 26 #include "net/base/mime_sniffer.h"
27 #include "net/base/mime_util.h" 27 #include "net/base/mime_util.h"
28 #include "net/base/net_errors.h" 28 #include "net/base/net_errors.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 return made_final_decision; 297 return made_final_decision;
298 } 298 }
299 299
300 bool BufferedResourceHandler::SelectNextHandler(bool* defer) { 300 bool BufferedResourceHandler::SelectNextHandler(bool* defer) {
301 DCHECK(!response_->head.mime_type.empty()); 301 DCHECK(!response_->head.mime_type.empty());
302 302
303 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request_); 303 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request_);
304 const std::string& mime_type = response_->head.mime_type; 304 const std::string& mime_type = response_->head.mime_type;
305 305
306 if (mime_type == "application/x-x509-user-cert") { 306 if (net::IsSupportedCertificateMimeType(mime_type)) {
darin (slow to review) 2012/10/26 07:34:05 I'm pretty sure the existing code is wrongly integ
digit1 2012/10/26 11:38:10 In his original comment at https://codereview.chro
307 // Install X509 handler. 307 // Install crypto file.
Ryan Sleevi 2012/11/13 19:37:50 nit: crypto file
digit1 2012/11/15 17:42:14 Done.
308 scoped_ptr<ResourceHandler> handler( 308 scoped_ptr<ResourceHandler> handler(
309 new X509UserCertResourceHandler(request_, 309 new CertificateResourceHandler(request_,
310 info->GetChildID(), 310 info->GetChildID(),
311 info->GetRouteID())); 311 info->GetRouteID()));
312 return UseAlternateNextHandler(handler.Pass()); 312 return UseAlternateNextHandler(handler.Pass());
313 } 313 }
314 314
315 if (!info->allow_download()) 315 if (!info->allow_download())
316 return true; 316 return true;
317 317
318 if (!MustDownload()) { 318 if (!MustDownload()) {
319 if (net::IsSupportedMimeType(mime_type)) 319 if (net::IsSupportedMimeType(mime_type))
320 return true; 320 return true;
321 321
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 const std::vector<webkit::WebPluginInfo>& plugins) { 453 const std::vector<webkit::WebPluginInfo>& plugins) {
454 bool defer = false; 454 bool defer = false;
455 if (!ProcessResponse(&defer)) { 455 if (!ProcessResponse(&defer)) {
456 controller()->Cancel(); 456 controller()->Cancel();
457 } else if (!defer) { 457 } else if (!defer) {
458 controller()->Resume(); 458 controller()->Resume();
459 } 459 }
460 } 460 }
461 461
462 } // namespace content 462 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698