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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Rebase Created 5 years, 3 months 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 // 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
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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 1457
1457 PluginService* plugin_service = nullptr; 1458 PluginService* plugin_service = nullptr;
1458 #if defined(ENABLE_PLUGINS) 1459 #if defined(ENABLE_PLUGINS)
1459 plugin_service = PluginService::GetInstance(); 1460 plugin_service = PluginService::GetInstance();
1460 #endif 1461 #endif
1461 // Insert a buffered event handler before the actual one. 1462 // Insert a buffered event handler before the actual one.
1462 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this, 1463 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this,
1463 plugin_service, request)); 1464 plugin_service, request));
1464 1465
1465 ScopedVector<ResourceThrottle> throttles; 1466 ScopedVector<ResourceThrottle> throttles;
1467
1468 // Add a NavigationResourceThrottle for navigations.
1469 // PlzNavigate: the throttle is unnecessary as communication with the UI
1470 // thread is handled by the NavigationURLloader.
1471 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1472 switches::kEnableBrowserSideNavigation) &&
1473 IsResourceTypeFrame(resource_type)) {
1474 throttles.push_back(new NavigationResourceThrottle(request));
1475 }
1476
1466 if (delegate_) { 1477 if (delegate_) {
1467 delegate_->RequestBeginning(request, 1478 delegate_->RequestBeginning(request,
1468 resource_context, 1479 resource_context,
1469 appcache_service, 1480 appcache_service,
1470 resource_type, 1481 resource_type,
1471 &throttles); 1482 &throttles);
1472 } 1483 }
1473 1484
1474 if (request->has_upload()) { 1485 if (request->has_upload()) {
1475 // Block power save while uploading data. 1486 // Block power save while uploading data.
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2399 load_flags |= net::LOAD_PREFETCH; 2410 load_flags |= net::LOAD_PREFETCH;
2400 } 2411 }
2401 2412
2402 if (is_sync_load) 2413 if (is_sync_load)
2403 load_flags |= net::LOAD_IGNORE_LIMITS; 2414 load_flags |= net::LOAD_IGNORE_LIMITS;
2404 2415
2405 return load_flags; 2416 return load_flags;
2406 } 2417 }
2407 2418
2408 } // namespace content 2419 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698