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

Side by Side Diff: chrome/browser/renderer_host/chrome_navigation_data.cc

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/renderer_host/chrome_navigation_data.h"
6
7 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
8 #include "net/url_request/url_request.h"
9
10 const void* const kChromeNavigationDataUserDataKey =
11 &kChromeNavigationDataUserDataKey;
12
13 ChromeNavigationData::ChromeNavigationData() {}
14
15 ChromeNavigationData::~ChromeNavigationData() {}
16
17 ChromeNavigationData* ChromeNavigationData::GetDataAndCreateIfNecessary(
18 net::URLRequest* request) {
19 if (!request)
20 return nullptr;
21 ChromeNavigationData* data = static_cast<ChromeNavigationData*>(
22 request->GetUserData(kChromeNavigationDataUserDataKey));
23 if (data)
24 return data;
25 data = new ChromeNavigationData();
26 request->SetUserData(kChromeNavigationDataUserDataKey, data);
27 return data;
28 }
29
30 std::unique_ptr<content::NavigationData> ChromeNavigationData::Clone() const {
31 std::unique_ptr<ChromeNavigationData> copy(new ChromeNavigationData());
32 if (data_reduction_proxy_data_)
33 copy->SetDataReductionProxyData(data_reduction_proxy_data_->DeepCopy());
34 return std::move(copy);
35 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/chrome_navigation_data.h ('k') | chrome/browser/renderer_host/chrome_navigation_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698