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

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: 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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 1432
1432 PluginService* plugin_service = nullptr; 1433 PluginService* plugin_service = nullptr;
1433 #if defined(ENABLE_PLUGINS) 1434 #if defined(ENABLE_PLUGINS)
1434 plugin_service = PluginService::GetInstance(); 1435 plugin_service = PluginService::GetInstance();
1435 #endif 1436 #endif
1436 // Insert a buffered event handler before the actual one. 1437 // Insert a buffered event handler before the actual one.
1437 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this, 1438 handler.reset(new MimeTypeResourceHandler(handler.Pass(), this,
1438 plugin_service, request)); 1439 plugin_service, request));
1439 1440
1440 ScopedVector<ResourceThrottle> throttles; 1441 ScopedVector<ResourceThrottle> throttles;
1442
1443 // Add a NavigationResourceThrottle for navigations.
1444 // PlzNavigate: the thottle is unnecessary as communication with the UI
davidben 2015/09/01 21:55:18 Nit: throttle
clamy 2015/09/03 15:30:52 Done.
1445 // thread is handled by the NavigationURLloader.
1446 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1447 switches::kEnableBrowserSideNavigation) &&
1448 (resource_type == RESOURCE_TYPE_MAIN_FRAME ||
1449 resource_type == RESOURCE_TYPE_SUB_FRAME)) {
davidben 2015/09/01 21:55:18 IsResourceTypeFrame?
clamy 2015/09/03 15:30:52 Done.
1450 throttles.push_back(new NavigationResourceThrottle(request));
1451 }
1452
1441 if (delegate_) { 1453 if (delegate_) {
1442 delegate_->RequestBeginning(request, 1454 delegate_->RequestBeginning(request,
1443 resource_context, 1455 resource_context,
1444 appcache_service, 1456 appcache_service,
1445 resource_type, 1457 resource_type,
1446 &throttles); 1458 &throttles);
1447 } 1459 }
1448 1460
1449 if (request->has_upload()) { 1461 if (request->has_upload()) {
1450 // Block power save while uploading data. 1462 // Block power save while uploading data.
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 2398 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
2387 && !policy->CanReadRawCookies(child_id)) { 2399 && !policy->CanReadRawCookies(child_id)) {
2388 VLOG(1) << "Denied unauthorized request for raw headers"; 2400 VLOG(1) << "Denied unauthorized request for raw headers";
2389 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 2401 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
2390 } 2402 }
2391 2403
2392 return load_flags; 2404 return load_flags;
2393 } 2405 }
2394 2406
2395 } // namespace content 2407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698