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

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

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 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/supports_user_data.h"
12 #include "content/public/browser/navigation_data.h"
13
14 namespace data_reduction_proxy {
15 class DataReductionProxyData;
16 }
17
18 namespace net {
19 class URLRequest;
20 }
21
22 class ChromeNavigationData : public content::NavigationData,
23 public base::SupportsUserData::Data {
24 public:
25 ChromeNavigationData();
26 ~ChromeNavigationData() override;
27
28 // Creates a new ChromeNavigationData that is a deep copy of the original. Any
29 // changes to the original after the clone is created will not be reflected in
30 // the clone.
31 // |data_reduction_proxy_data_| is deep copied.
32 std::unique_ptr<content::NavigationData> Clone() const override;
33
34 // Takes ownership of |data_reduction_proxy_data|.
35 void SetDataReductionProxyData(
36 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
37 data_reduction_proxy_data) {
38 data_reduction_proxy_data_ = std::move(data_reduction_proxy_data);
39 }
40
41 data_reduction_proxy::DataReductionProxyData* GetDataReductionProxyData()
42 const {
43 return data_reduction_proxy_data_.get();
44 }
45
46 static ChromeNavigationData* GetDataAndCreateIfNecessary(
47 net::URLRequest* request);
48
49 private:
50 // Manages the lifetime of optional DataReductionProxy information.
51 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
52 data_reduction_proxy_data_;
53
54 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationData);
55 };
56
57 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698