| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "content/browser/download/save_file_manager.h" | 34 #include "content/browser/download/save_file_manager.h" |
| 35 #include "content/browser/download/save_file_resource_handler.h" | 35 #include "content/browser/download/save_file_resource_handler.h" |
| 36 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 36 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 37 #include "content/browser/frame_host/navigation_request_info.h" | 37 #include "content/browser/frame_host/navigation_request_info.h" |
| 38 #include "content/browser/frame_host/navigator.h" | 38 #include "content/browser/frame_host/navigator.h" |
| 39 #include "content/browser/loader/async_resource_handler.h" | 39 #include "content/browser/loader/async_resource_handler.h" |
| 40 #include "content/browser/loader/cross_site_resource_handler.h" | 40 #include "content/browser/loader/cross_site_resource_handler.h" |
| 41 #include "content/browser/loader/detachable_resource_handler.h" | 41 #include "content/browser/loader/detachable_resource_handler.h" |
| 42 #include "content/browser/loader/mime_type_resource_handler.h" | 42 #include "content/browser/loader/mime_type_resource_handler.h" |
| 43 #include "content/browser/loader/navigation_resource_handler.h" | 43 #include "content/browser/loader/navigation_resource_handler.h" |
| 44 #include "content/browser/loader/navigation_resource_throttle.h" |
| 44 #include "content/browser/loader/navigation_url_loader_impl_core.h" | 45 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 45 #include "content/browser/loader/power_save_block_resource_throttle.h" | 46 #include "content/browser/loader/power_save_block_resource_throttle.h" |
| 46 #include "content/browser/loader/redirect_to_file_resource_handler.h" | 47 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 47 #include "content/browser/loader/resource_message_filter.h" | 48 #include "content/browser/loader/resource_message_filter.h" |
| 48 #include "content/browser/loader/resource_request_info_impl.h" | 49 #include "content/browser/loader/resource_request_info_impl.h" |
| 49 #include "content/browser/loader/stream_resource_handler.h" | 50 #include "content/browser/loader/stream_resource_handler.h" |
| 50 #include "content/browser/loader/sync_resource_handler.h" | 51 #include "content/browser/loader/sync_resource_handler.h" |
| 51 #include "content/browser/loader/throttling_resource_handler.h" | 52 #include "content/browser/loader/throttling_resource_handler.h" |
| 52 #include "content/browser/loader/upload_data_stream_builder.h" | 53 #include "content/browser/loader/upload_data_stream_builder.h" |
| 53 #include "content/browser/renderer_host/render_view_host_delegate.h" | 54 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 | 1474 |
| 1474 PluginService* plugin_service = nullptr; | 1475 PluginService* plugin_service = nullptr; |
| 1475 #if defined(ENABLE_PLUGINS) | 1476 #if defined(ENABLE_PLUGINS) |
| 1476 plugin_service = PluginService::GetInstance(); | 1477 plugin_service = PluginService::GetInstance(); |
| 1477 #endif | 1478 #endif |
| 1478 // Insert a buffered event handler before the actual one. | 1479 // Insert a buffered event handler before the actual one. |
| 1479 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this, | 1480 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this, |
| 1480 plugin_service, request)); | 1481 plugin_service, request)); |
| 1481 | 1482 |
| 1482 ScopedVector<ResourceThrottle> throttles; | 1483 ScopedVector<ResourceThrottle> throttles; |
| 1484 |
| 1485 // Add a NavigationResourceThrottle for navigations. |
| 1486 // PlzNavigate: the throttle is unnecessary as communication with the UI |
| 1487 // thread is handled by the NavigationURLloader. |
| 1488 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1489 switches::kEnableBrowserSideNavigation) && |
| 1490 IsResourceTypeFrame(resource_type)) { |
| 1491 throttles.push_back(new NavigationResourceThrottle(request)); |
| 1492 } |
| 1493 |
| 1483 if (delegate_) { | 1494 if (delegate_) { |
| 1484 delegate_->RequestBeginning(request, | 1495 delegate_->RequestBeginning(request, |
| 1485 resource_context, | 1496 resource_context, |
| 1486 appcache_service, | 1497 appcache_service, |
| 1487 resource_type, | 1498 resource_type, |
| 1488 &throttles); | 1499 &throttles); |
| 1489 } | 1500 } |
| 1490 | 1501 |
| 1491 if (request->has_upload()) { | 1502 if (request->has_upload()) { |
| 1492 // Block power save while uploading data. | 1503 // Block power save while uploading data. |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2416 load_flags |= net::LOAD_PREFETCH; | 2427 load_flags |= net::LOAD_PREFETCH; |
| 2417 } | 2428 } |
| 2418 | 2429 |
| 2419 if (is_sync_load) | 2430 if (is_sync_load) |
| 2420 load_flags |= net::LOAD_IGNORE_LIMITS; | 2431 load_flags |= net::LOAD_IGNORE_LIMITS; |
| 2421 | 2432 |
| 2422 return load_flags; | 2433 return load_flags; |
| 2423 } | 2434 } |
| 2424 | 2435 |
| 2425 } // namespace content | 2436 } // namespace content |
| OLD | NEW |