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 #include "content/browser/loader/mime_sniffing_resource_handler.h" | 5 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 bool MimeSniffingResourceHandler::MaybeStartInterception(bool* defer) { | 359 bool MimeSniffingResourceHandler::MaybeStartInterception(bool* defer) { |
360 if (!CanBeIntercepted()) | 360 if (!CanBeIntercepted()) |
361 return true; | 361 return true; |
362 | 362 |
363 DCHECK(!response_->head.mime_type.empty()); | 363 DCHECK(!response_->head.mime_type.empty()); |
364 | 364 |
365 ResourceRequestInfoImpl* info = GetRequestInfo(); | 365 ResourceRequestInfoImpl* info = GetRequestInfo(); |
366 const std::string& mime_type = response_->head.mime_type; | 366 const std::string& mime_type = response_->head.mime_type; |
367 | 367 |
368 // https://crbug.com/568184 - Temporary hack to track servers that aren't | |
369 // setting Content-Disposition when sending x-x509-user-cert and expecting | |
370 // the browser to automatically install certificates; this is being | |
371 // deprecated and will be removed upon full <keygen> removal. | |
372 if (mime_type == "application/x-x509-user-cert" && response_->head.headers) { | |
373 UMA_HISTOGRAM_BOOLEAN( | |
374 "UserCert.ContentDisposition", | |
375 response_->head.headers->HasHeader("Content-Disposition")); | |
376 } | |
377 | |
378 // Allow requests for object/embed tags to be intercepted as streams. | 368 // Allow requests for object/embed tags to be intercepted as streams. |
379 if (info->GetResourceType() == content::RESOURCE_TYPE_OBJECT) { | 369 if (info->GetResourceType() == content::RESOURCE_TYPE_OBJECT) { |
380 DCHECK(!info->allow_download()); | 370 DCHECK(!info->allow_download()); |
381 | 371 |
382 bool handled_by_plugin; | 372 bool handled_by_plugin; |
383 if (!CheckForPluginHandler(defer, &handled_by_plugin)) | 373 if (!CheckForPluginHandler(defer, &handled_by_plugin)) |
384 return false; | 374 return false; |
385 if (handled_by_plugin || *defer) | 375 if (handled_by_plugin || *defer) |
386 return true; | 376 return true; |
387 } | 377 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 507 |
518 void MimeSniffingResourceHandler::OnPluginsLoaded( | 508 void MimeSniffingResourceHandler::OnPluginsLoaded( |
519 const std::vector<WebPluginInfo>& plugins) { | 509 const std::vector<WebPluginInfo>& plugins) { |
520 // No longer blocking on the plugins being loaded. | 510 // No longer blocking on the plugins being loaded. |
521 request()->LogUnblocked(); | 511 request()->LogUnblocked(); |
522 if (state_ == STATE_BUFFERING) | 512 if (state_ == STATE_BUFFERING) |
523 AdvanceState(); | 513 AdvanceState(); |
524 } | 514 } |
525 | 515 |
526 } // namespace content | 516 } // namespace content |
OLD | NEW |