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

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

Issue 375513002: [ServiceWorker] Propagates ServiceWorker fetched response's URL and wasFetchedViaServiceWorker flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: *original_url_via_service_worker = GURL(); Created 6 years, 5 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 | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('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 #include "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "content/browser/appcache/appcache_interceptor.h" 11 #include "content/browser/appcache/appcache_interceptor.h"
12 #include "content/browser/child_process_security_policy_impl.h" 12 #include "content/browser/child_process_security_policy_impl.h"
13 #include "content/browser/loader/cross_site_resource_handler.h" 13 #include "content/browser/loader/cross_site_resource_handler.h"
14 #include "content/browser/loader/detachable_resource_handler.h" 14 #include "content/browser/loader/detachable_resource_handler.h"
15 #include "content/browser/loader/resource_loader_delegate.h" 15 #include "content/browser/loader/resource_loader_delegate.h"
16 #include "content/browser/loader/resource_request_info_impl.h" 16 #include "content/browser/loader/resource_request_info_impl.h"
17 #include "content/browser/service_worker/service_worker_request_handler.h"
17 #include "content/browser/ssl/ssl_client_auth_handler.h" 18 #include "content/browser/ssl/ssl_client_auth_handler.h"
18 #include "content/browser/ssl/ssl_manager.h" 19 #include "content/browser/ssl/ssl_manager.h"
19 #include "content/common/ssl_status_serialization.h" 20 #include "content/common/ssl_status_serialization.h"
20 #include "content/public/browser/cert_store.h" 21 #include "content/public/browser/cert_store.h"
21 #include "content/public/browser/resource_context.h" 22 #include "content/public/browser/resource_context.h"
22 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" 23 #include "content/public/browser/resource_dispatcher_host_login_delegate.h"
23 #include "content/public/browser/signed_certificate_timestamp_store.h" 24 #include "content/public/browser/signed_certificate_timestamp_store.h"
24 #include "content/public/common/content_client.h" 25 #include "content/public/common/content_client.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "content/public/common/process_type.h" 27 #include "content/public/common/process_type.h"
(...skipping 20 matching lines...) Expand all
47 response->head.content_length = request->GetExpectedContentSize(); 48 response->head.content_length = request->GetExpectedContentSize();
48 request->GetMimeType(&response->head.mime_type); 49 request->GetMimeType(&response->head.mime_type);
49 net::HttpResponseInfo response_info = request->response_info(); 50 net::HttpResponseInfo response_info = request->response_info();
50 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; 51 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy;
51 response->head.was_npn_negotiated = response_info.was_npn_negotiated; 52 response->head.was_npn_negotiated = response_info.was_npn_negotiated;
52 response->head.npn_negotiated_protocol = 53 response->head.npn_negotiated_protocol =
53 response_info.npn_negotiated_protocol; 54 response_info.npn_negotiated_protocol;
54 response->head.connection_info = response_info.connection_info; 55 response->head.connection_info = response_info.connection_info;
55 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); 56 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy();
56 response->head.socket_address = request->GetSocketAddress(); 57 response->head.socket_address = request->GetSocketAddress();
58 if (ServiceWorkerRequestHandler* handler =
59 ServiceWorkerRequestHandler::GetHandler(request)) {
60 handler->GetExtraResponseInfo(
61 &response->head.was_fetched_via_service_worker,
62 &response->head.original_url_via_service_worker);
63 }
57 AppCacheInterceptor::GetExtraResponseInfo( 64 AppCacheInterceptor::GetExtraResponseInfo(
58 request, 65 request,
59 &response->head.appcache_id, 66 &response->head.appcache_id,
60 &response->head.appcache_manifest_url); 67 &response->head.appcache_manifest_url);
61 // TODO(mmenke): Figure out if LOAD_ENABLE_LOAD_TIMING is safe to remove. 68 // TODO(mmenke): Figure out if LOAD_ENABLE_LOAD_TIMING is safe to remove.
62 if (request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING) 69 if (request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING)
63 request->GetLoadTimingInfo(&response->head.load_timing); 70 request->GetLoadTimingInfo(&response->head.load_timing);
64 } 71 }
65 72
66 } // namespace 73 } // namespace
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 case net::URLRequestStatus::FAILED: 703 case net::URLRequestStatus::FAILED:
697 status = STATUS_UNDEFINED; 704 status = STATUS_UNDEFINED;
698 break; 705 break;
699 } 706 }
700 707
701 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 708 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
702 } 709 }
703 } 710 }
704 711
705 } // namespace content 712 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698