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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (mime_util::IsSupportedMimeType(mime_type)) | 399 if (mime_util::IsSupportedMimeType(mime_type)) |
400 return true; | 400 return true; |
401 | 401 |
402 bool handled_by_plugin; | 402 bool handled_by_plugin; |
403 if (!CheckForPluginHandler(defer, &handled_by_plugin)) | 403 if (!CheckForPluginHandler(defer, &handled_by_plugin)) |
404 return false; | 404 return false; |
405 if (handled_by_plugin || *defer) | 405 if (handled_by_plugin || *defer) |
406 return true; | 406 return true; |
407 } | 407 } |
408 | 408 |
409 // This is request is a download, | 409 // This request is a download. |
410 | 410 |
411 if (!CheckResponseIsNotProvisional()) | 411 if (!CheckResponseIsNotProvisional()) |
412 return false; | 412 return false; |
413 | 413 |
414 info->set_is_download(true); | 414 info->set_is_download(true); |
415 std::unique_ptr<ResourceHandler> handler( | 415 std::unique_ptr<ResourceHandler> handler( |
416 host_->CreateResourceHandlerForDownload(request(), | 416 host_->CreateResourceHandlerForDownload(request(), |
417 true, // is_content_initiated | 417 true, // is_content_initiated |
418 must_download, | 418 must_download, |
419 false /* is_new_request */)); | 419 false /* is_new_request */)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 void MimeSniffingResourceHandler::OnPluginsLoaded( | 517 void MimeSniffingResourceHandler::OnPluginsLoaded( |
518 const std::vector<WebPluginInfo>& plugins) { | 518 const std::vector<WebPluginInfo>& plugins) { |
519 // No longer blocking on the plugins being loaded. | 519 // No longer blocking on the plugins being loaded. |
520 request()->LogUnblocked(); | 520 request()->LogUnblocked(); |
521 if (state_ == STATE_BUFFERING) | 521 if (state_ == STATE_BUFFERING) |
522 AdvanceState(); | 522 AdvanceState(); |
523 } | 523 } |
524 | 524 |
525 } // namespace content | 525 } // namespace content |
OLD | NEW |