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/buffered_resource_handler.h" | 5 #include "content/browser/loader/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" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 313 } |
314 | 314 |
315 if (!info->allow_download()) | 315 if (!info->allow_download()) |
316 return true; | 316 return true; |
317 | 317 |
318 bool must_download = MustDownload(); | 318 bool must_download = MustDownload(); |
319 if (!must_download) { | 319 if (!must_download) { |
320 if (net::IsSupportedMimeType(mime_type)) | 320 if (net::IsSupportedMimeType(mime_type)) |
321 return true; | 321 return true; |
322 | 322 |
| 323 scoped_ptr<ResourceHandler> handler( |
| 324 host_->MaybeInterceptAsStream(request_, response_)); |
| 325 if (handler) |
| 326 return UseAlternateNextHandler(handler.Pass()); |
| 327 |
323 #if defined(ENABLE_PLUGINS) | 328 #if defined(ENABLE_PLUGINS) |
324 bool stale; | 329 bool stale; |
325 bool has_plugin = HasSupportingPlugin(&stale); | 330 bool has_plugin = HasSupportingPlugin(&stale); |
326 if (stale) { | 331 if (stale) { |
327 // Refresh the plugins asynchronously. | 332 // Refresh the plugins asynchronously. |
328 PluginServiceImpl::GetInstance()->GetPlugins( | 333 PluginServiceImpl::GetInstance()->GetPlugins( |
329 base::Bind(&BufferedResourceHandler::OnPluginsLoaded, | 334 base::Bind(&BufferedResourceHandler::OnPluginsLoaded, |
330 weak_ptr_factory_.GetWeakPtr())); | 335 weak_ptr_factory_.GetWeakPtr())); |
331 *defer = true; | 336 *defer = true; |
332 return true; | 337 return true; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 const std::vector<webkit::WebPluginInfo>& plugins) { | 463 const std::vector<webkit::WebPluginInfo>& plugins) { |
459 bool defer = false; | 464 bool defer = false; |
460 if (!ProcessResponse(&defer)) { | 465 if (!ProcessResponse(&defer)) { |
461 controller()->Cancel(); | 466 controller()->Cancel(); |
462 } else if (!defer) { | 467 } else if (!defer) { |
463 controller()->Resume(); | 468 controller()->Resume(); |
464 } | 469 } |
465 } | 470 } |
466 | 471 |
467 } // namespace content | 472 } // namespace content |
OLD | NEW |