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

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: incorporated tyoshino's comment 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
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"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 response->head.content_length = request->GetExpectedContentSize(); 47 response->head.content_length = request->GetExpectedContentSize();
48 request->GetMimeType(&response->head.mime_type); 48 request->GetMimeType(&response->head.mime_type);
49 net::HttpResponseInfo response_info = request->response_info(); 49 net::HttpResponseInfo response_info = request->response_info();
50 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; 50 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy;
51 response->head.was_npn_negotiated = response_info.was_npn_negotiated; 51 response->head.was_npn_negotiated = response_info.was_npn_negotiated;
52 response->head.npn_negotiated_protocol = 52 response->head.npn_negotiated_protocol =
53 response_info.npn_negotiated_protocol; 53 response_info.npn_negotiated_protocol;
54 response->head.connection_info = response_info.connection_info; 54 response->head.connection_info = response_info.connection_info;
55 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); 55 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy();
56 response->head.socket_address = request->GetSocketAddress(); 56 response->head.socket_address = request->GetSocketAddress();
57 response->head.was_fetched_via_service_worker =
58 request->was_fetched_via_service_worker();
59 response->head.original_url_via_service_worker =
60 request->original_url_via_service_worker();
57 AppCacheInterceptor::GetExtraResponseInfo( 61 AppCacheInterceptor::GetExtraResponseInfo(
58 request, 62 request,
59 &response->head.appcache_id, 63 &response->head.appcache_id,
60 &response->head.appcache_manifest_url); 64 &response->head.appcache_manifest_url);
61 // TODO(mmenke): Figure out if LOAD_ENABLE_LOAD_TIMING is safe to remove. 65 // TODO(mmenke): Figure out if LOAD_ENABLE_LOAD_TIMING is safe to remove.
62 if (request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING) 66 if (request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING)
63 request->GetLoadTimingInfo(&response->head.load_timing); 67 request->GetLoadTimingInfo(&response->head.load_timing);
64 } 68 }
65 69
66 } // namespace 70 } // namespace
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 case net::URLRequestStatus::FAILED: 700 case net::URLRequestStatus::FAILED:
697 status = STATUS_UNDEFINED; 701 status = STATUS_UNDEFINED;
698 break; 702 break;
699 } 703 }
700 704
701 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 705 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
702 } 706 }
703 } 707 }
704 708
705 } // namespace content 709 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698