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

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

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: Created 3 years, 11 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 <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 bool allow_download = request_data.allow_download && 1494 bool allow_download = request_data.allow_download &&
1495 IsResourceTypeFrame(request_data.resource_type); 1495 IsResourceTypeFrame(request_data.resource_type);
1496 bool do_not_prompt_for_login = request_data.do_not_prompt_for_login; 1496 bool do_not_prompt_for_login = request_data.do_not_prompt_for_login;
1497 bool is_sync_load = !!sync_result_handler; 1497 bool is_sync_load = !!sync_result_handler;
1498 1498
1499 // Raw headers are sensitive, as they include Cookie/Set-Cookie, so only 1499 // Raw headers are sensitive, as they include Cookie/Set-Cookie, so only
1500 // allow requesting them if requester has ReadRawCookies permission. 1500 // allow requesting them if requester has ReadRawCookies permission.
1501 ChildProcessSecurityPolicyImpl* policy = 1501 ChildProcessSecurityPolicyImpl* policy =
1502 ChildProcessSecurityPolicyImpl::GetInstance(); 1502 ChildProcessSecurityPolicyImpl::GetInstance();
1503 bool report_raw_headers = request_data.report_raw_headers; 1503 bool report_raw_headers = request_data.report_raw_headers;
1504 if (report_raw_headers && !policy->CanReadRawCookies(child_id)) { 1504 if (report_raw_headers && !policy->CanReadRawCookies(child_id) &&
1505 !requester_info->IsNavigationPreload()) {
falken 2017/01/17 14:38:36 Can you add a comment about why navigation preload
horo 2017/01/18 14:25:02 Done.
1505 // TODO: crbug.com/523063 can we call bad_message::ReceivedBadMessage here? 1506 // TODO: crbug.com/523063 can we call bad_message::ReceivedBadMessage here?
1506 VLOG(1) << "Denied unauthorized request for raw headers"; 1507 VLOG(1) << "Denied unauthorized request for raw headers";
1507 report_raw_headers = false; 1508 report_raw_headers = false;
1508 } 1509 }
1509 int load_flags = BuildLoadFlagsForRequest(request_data, is_sync_load); 1510 int load_flags = BuildLoadFlagsForRequest(request_data, is_sync_load);
1510 if (request_data.resource_type == RESOURCE_TYPE_PREFETCH || 1511 if (request_data.resource_type == RESOURCE_TYPE_PREFETCH ||
1511 request_data.resource_type == RESOURCE_TYPE_FAVICON) { 1512 request_data.resource_type == RESOURCE_TYPE_FAVICON) {
1512 do_not_prompt_for_login = true; 1513 do_not_prompt_for_login = true;
1513 } 1514 }
1514 if (request_data.resource_type == RESOURCE_TYPE_IMAGE && 1515 if (request_data.resource_type == RESOURCE_TYPE_IMAGE &&
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 &throttles); 2832 &throttles);
2832 if (!throttles.empty()) { 2833 if (!throttles.empty()) {
2833 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2834 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2834 std::move(throttles))); 2835 std::move(throttles)));
2835 } 2836 }
2836 } 2837 }
2837 return handler; 2838 return handler;
2838 } 2839 }
2839 2840
2840 } // namespace content 2841 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698