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

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

Issue 1350913008: Revert of Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Created 5 years, 2 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
« no previous file with comments | « content/browser/loader/navigation_resource_throttle.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
45 #include "content/browser/loader/navigation_url_loader_impl_core.h" 44 #include "content/browser/loader/navigation_url_loader_impl_core.h"
46 #include "content/browser/loader/power_save_block_resource_throttle.h" 45 #include "content/browser/loader/power_save_block_resource_throttle.h"
47 #include "content/browser/loader/redirect_to_file_resource_handler.h" 46 #include "content/browser/loader/redirect_to_file_resource_handler.h"
48 #include "content/browser/loader/resource_message_filter.h" 47 #include "content/browser/loader/resource_message_filter.h"
49 #include "content/browser/loader/resource_request_info_impl.h" 48 #include "content/browser/loader/resource_request_info_impl.h"
50 #include "content/browser/loader/stream_resource_handler.h" 49 #include "content/browser/loader/stream_resource_handler.h"
51 #include "content/browser/loader/sync_resource_handler.h" 50 #include "content/browser/loader/sync_resource_handler.h"
52 #include "content/browser/loader/throttling_resource_handler.h" 51 #include "content/browser/loader/throttling_resource_handler.h"
53 #include "content/browser/loader/upload_data_stream_builder.h" 52 #include "content/browser/loader/upload_data_stream_builder.h"
54 #include "content/browser/renderer_host/render_view_host_delegate.h" 53 #include "content/browser/renderer_host/render_view_host_delegate.h"
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1474
1476 PluginService* plugin_service = nullptr; 1475 PluginService* plugin_service = nullptr;
1477 #if defined(ENABLE_PLUGINS) 1476 #if defined(ENABLE_PLUGINS)
1478 plugin_service = PluginService::GetInstance(); 1477 plugin_service = PluginService::GetInstance();
1479 #endif 1478 #endif
1480 // Insert a buffered event handler before the actual one. 1479 // Insert a buffered event handler before the actual one.
1481 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this, 1480 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this,
1482 plugin_service, request)); 1481 plugin_service, request));
1483 1482
1484 ScopedVector<ResourceThrottle> throttles; 1483 ScopedVector<ResourceThrottle> throttles;
1485
1486 // Add a NavigationResourceThrottle for navigations.
1487 // PlzNavigate: the throttle is unnecessary as communication with the UI
1488 // thread is handled by the NavigationURLloader.
1489 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1490 switches::kEnableBrowserSideNavigation) &&
1491 IsResourceTypeFrame(resource_type)) {
1492 throttles.push_back(new NavigationResourceThrottle(request));
1493 }
1494
1495 if (delegate_) { 1484 if (delegate_) {
1496 delegate_->RequestBeginning(request, 1485 delegate_->RequestBeginning(request,
1497 resource_context, 1486 resource_context,
1498 appcache_service, 1487 appcache_service,
1499 resource_type, 1488 resource_type,
1500 &throttles); 1489 &throttles);
1501 } 1490 }
1502 1491
1503 if (request->has_upload()) { 1492 if (request->has_upload()) {
1504 // Block power save while uploading data. 1493 // Block power save while uploading data.
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 load_flags |= net::LOAD_PREFETCH; 2417 load_flags |= net::LOAD_PREFETCH;
2429 } 2418 }
2430 2419
2431 if (is_sync_load) 2420 if (is_sync_load)
2432 load_flags |= net::LOAD_IGNORE_LIMITS; 2421 load_flags |= net::LOAD_IGNORE_LIMITS;
2433 2422
2434 return load_flags; 2423 return load_flags;
2435 } 2424 }
2436 2425
2437 } // namespace content 2426 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_resource_throttle.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698