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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NavigationData final draft before adding tests Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index b1ee0283b3b175f4dd3e5ad4d1a26a1afd5bffec..20cca64789cc458776a68afcca2322ea9fd91310 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -5,52 +5,56 @@
#include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h"
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
#include "base/base64.h"
#include "base/guid.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/component_updater/component_updater_resource_throttle.h"
#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/download/download_resource_throttle.h"
#include "chrome/browser/mod_pagespeed/mod_pagespeed_metrics.h"
#include "chrome/browser/net/resource_prefetch_predictor_observer.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/prerender/prerender_manager.h"
#include "chrome/browser/prerender/prerender_manager_factory.h"
#include "chrome/browser/prerender/prerender_resource_throttle.h"
#include "chrome/browser/prerender/prerender_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_io_data.h"
+#include "chrome/browser/renderer_host/chrome_navigation_data.h"
#include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
#include "chrome/browser/renderer_host/thread_hop_resource_throttle.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/signin/chrome_signin_helper.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/features.h"
#include "chrome/common/url_constants.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/google/core/browser/google_util.h"
#include "components/policy/core/common/cloud/policy_header_io_helper.h"
#include "components/variations/net/variations_http_headers.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_data.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/plugin_service_filter.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/service_worker_context.h"
#include "content/public/browser/stream_info.h"
@@ -714,10 +718,23 @@ bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode(
return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
return false;
}
// static
void ChromeResourceDispatcherHostDelegate::
SetExternalProtocolHandlerDelegateForTesting(
ExternalProtocolHandler::Delegate* delegate) {
g_external_protocol_handler_delegate = delegate;
}
+
+std::unique_ptr<content::NavigationData>
+ChromeResourceDispatcherHostDelegate::GetNavigationData(
+ net::URLRequest* request) const {
+ ChromeNavigationData* data = new ChromeNavigationData();
nasko 2016/04/26 20:18:39 Use unique_ptr.
RyanSturm 2016/04/27 23:27:46 Done.
+ // Get the existing Data instance off of URLRequest.
+ data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data =
+ data_reduction_proxy::DataReductionProxyData::DataForRequest(request,
+ false);
+ if (data_reduction_proxy_data)
+ data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
nasko 2016/04/26 20:18:39 So we end up doing two deep copies of data_reducti
RyanSturm 2016/04/27 23:27:46 I'll add a comment about this; the basic idea I ha
+ return base::WrapUnique(data);
+}

Powered by Google App Engine
This is Rietveld 408576698