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

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

Issue 1953593002: Move DevToolsNetLogObserver to c/b/loader and create stub of network service interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 7 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/DEPS ('k') | content/browser/loader/navigation_resource_handler.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/async_resource_handler.h" 5 #include "content/browser/loader/async_resource_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
12 #include "base/debug/alias.h" 12 #include "base/debug/alias.h"
13 #include "base/feature_list.h" 13 #include "base/feature_list.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/shared_memory.h" 16 #include "base/memory/shared_memory.h"
17 #include "base/metrics/histogram_macros.h" 17 #include "base/metrics/histogram_macros.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "content/browser/devtools/devtools_netlog_observer.h"
21 #include "content/browser/host_zoom_map_impl.h" 20 #include "content/browser/host_zoom_map_impl.h"
21 #include "content/browser/loader/netlog_observer.h"
22 #include "content/browser/loader/resource_buffer.h" 22 #include "content/browser/loader/resource_buffer.h"
23 #include "content/browser/loader/resource_dispatcher_host_impl.h" 23 #include "content/browser/loader/resource_dispatcher_host_impl.h"
24 #include "content/browser/loader/resource_message_filter.h" 24 #include "content/browser/loader/resource_message_filter.h"
25 #include "content/browser/loader/resource_request_info_impl.h" 25 #include "content/browser/loader/resource_request_info_impl.h"
26 #include "content/browser/resource_context_impl.h" 26 #include "content/browser/resource_context_impl.h"
27 #include "content/common/resource_messages.h" 27 #include "content/common/resource_messages.h"
28 #include "content/common/view_messages.h" 28 #include "content/common/view_messages.h"
29 #include "content/public/browser/resource_dispatcher_host_delegate.h" 29 #include "content/public/browser/resource_dispatcher_host_delegate.h"
30 #include "content/public/common/content_features.h" 30 #include "content/public/common/content_features.h"
31 #include "content/public/common/resource_response.h" 31 #include "content/public/common/resource_response.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return false; 294 return false;
295 295
296 *defer = did_defer_ = true; 296 *defer = did_defer_ = true;
297 OnDefer(); 297 OnDefer();
298 298
299 if (rdh_->delegate()) { 299 if (rdh_->delegate()) {
300 rdh_->delegate()->OnRequestRedirected( 300 rdh_->delegate()->OnRequestRedirected(
301 redirect_info.new_url, request(), info->GetContext(), response); 301 redirect_info.new_url, request(), info->GetContext(), response);
302 } 302 }
303 303
304 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); 304 NetLogObserver::PopulateResponseInfo(request(), response);
305 response->head.encoded_data_length = request()->GetTotalReceivedBytes(); 305 response->head.encoded_data_length = request()->GetTotalReceivedBytes();
306 reported_transfer_size_ = 0; 306 reported_transfer_size_ = 0;
307 response->head.request_start = request()->creation_time(); 307 response->head.request_start = request()->creation_time();
308 response->head.response_start = TimeTicks::Now(); 308 response->head.response_start = TimeTicks::Now();
309 // TODO(davidben): Is it necessary to pass the new first party URL for 309 // TODO(davidben): Is it necessary to pass the new first party URL for
310 // cookies? The only case where it can change is top-level navigation requests 310 // cookies? The only case where it can change is top-level navigation requests
311 // and hopefully those will eventually all be owned by the browser. It's 311 // and hopefully those will eventually all be owned by the browser. It's
312 // possible this is still needed while renderer-owned ones exist. 312 // possible this is still needed while renderer-owned ones exist.
313 return info->filter()->Send(new ResourceMsg_ReceivedRedirect( 313 return info->filter()->Send(new ResourceMsg_ReceivedRedirect(
314 GetRequestID(), redirect_info, response->head)); 314 GetRequestID(), redirect_info, response->head));
(...skipping 20 matching lines...) Expand all
335 if (info->is_upload_progress_enabled()) { 335 if (info->is_upload_progress_enabled()) {
336 waiting_for_upload_progress_ack_ = false; 336 waiting_for_upload_progress_ack_ = false;
337 ReportUploadProgress(); 337 ReportUploadProgress();
338 } 338 }
339 339
340 if (rdh_->delegate()) { 340 if (rdh_->delegate()) {
341 rdh_->delegate()->OnResponseStarted( 341 rdh_->delegate()->OnResponseStarted(
342 request(), info->GetContext(), response, info->filter()); 342 request(), info->GetContext(), response, info->filter());
343 } 343 }
344 344
345 DevToolsNetLogObserver::PopulateResponseInfo(request(), response); 345 NetLogObserver::PopulateResponseInfo(request(), response);
346 346
347 const HostZoomMapImpl* host_zoom_map = 347 const HostZoomMapImpl* host_zoom_map =
348 static_cast<const HostZoomMapImpl*>(info->filter()->GetHostZoomMap()); 348 static_cast<const HostZoomMapImpl*>(info->filter()->GetHostZoomMap());
349 349
350 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) { 350 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) {
351 const GURL& request_url = request()->url(); 351 const GURL& request_url = request()->url();
352 int render_process_id = info->GetChildID(); 352 int render_process_id = info->GetChildID();
353 int render_view_id = info->GetRouteID(); 353 int render_view_id = info->GetRouteID();
354 354
355 double zoom_level = host_zoom_map->GetZoomLevelForView( 355 double zoom_level = host_zoom_map->GetZoomLevelForView(
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } else { 601 } else {
602 UMA_HISTOGRAM_CUSTOM_COUNTS( 602 UMA_HISTOGRAM_CUSTOM_COUNTS(
603 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", 603 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB",
604 elapsed_time, 1, 100000, 100); 604 elapsed_time, 1, 100000, 100);
605 } 605 }
606 606
607 inlining_helper_->RecordHistogram(elapsed_time); 607 inlining_helper_->RecordHistogram(elapsed_time);
608 } 608 }
609 609
610 } // namespace content 610 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/DEPS ('k') | content/browser/loader/navigation_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698