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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/chrome_navigation_data.h
diff --git a/chrome/browser/renderer_host/chrome_navigation_data.h b/chrome/browser/renderer_host/chrome_navigation_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..b28b53fb395f93b3534c5ac160d2af2d7d8d7e74
--- /dev/null
+++ b/chrome/browser/renderer_host/chrome_navigation_data.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_
+#define CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/supports_user_data.h"
+#include "content/public/browser/navigation_data.h"
+
+namespace data_reduction_proxy {
+class DataReductionProxyData;
+}
+
+namespace net {
+class URLRequest;
+}
+
+class ChromeNavigationData : public content::NavigationData,
+ public base::SupportsUserData::Data {
+ public:
+ ChromeNavigationData();
+ ~ChromeNavigationData() override;
+
+ // Creates a new ChromeNavigationData that is a deep copy of the original. Any
+ // changes to the original after the clone is created will not be reflected in
+ // the clone.
+ // |data_reduction_proxy_data_| is deep copied.
+ std::unique_ptr<content::NavigationData> Clone() const override;
+
+ // Takes ownership of |data_reduction_proxy_data|.
+ void SetDataReductionProxyData(
+ std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
+ data_reduction_proxy_data) {
+ data_reduction_proxy_data_ = std::move(data_reduction_proxy_data);
+ }
+
+ data_reduction_proxy::DataReductionProxyData* GetDataReductionProxyData()
+ const {
+ return data_reduction_proxy_data_.get();
+ }
+
+ static ChromeNavigationData* GetDataAndCreateIfNecessary(
+ net::URLRequest* request);
+
+ private:
+ // Manages the lifetime of optional DataReductionProxy information.
+ std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
+ data_reduction_proxy_data_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeNavigationData);
+};
+
+#endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698