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

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

Issue 2916253002: Add UMA to determine how often we offline a page with previews. (Closed)
Patch Set: Created 3 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_ 5 #ifndef CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_
6 #define CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_ 6 #define CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/supports_user_data.h" 11 #include "base/supports_user_data.h"
12 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
RyanSturm 2017/06/02 20:50:33 Any reason for switching forward declare to header
Pete Williamson 2017/06/02 21:40:32 It was a different compile error: error: invalid
12 #include "content/public/browser/navigation_data.h" 13 #include "content/public/browser/navigation_data.h"
13 14 #include "content/public/common/previews_state.h"
14 namespace data_reduction_proxy {
15 class DataReductionProxyData;
16 }
17 15
18 namespace net { 16 namespace net {
19 class URLRequest; 17 class URLRequest;
20 } 18 }
21 19
22 class ChromeNavigationData : public content::NavigationData, 20 class ChromeNavigationData : public content::NavigationData,
23 public base::SupportsUserData::Data { 21 public base::SupportsUserData::Data {
24 public: 22 public:
25 ChromeNavigationData(); 23 ChromeNavigationData();
26 ~ChromeNavigationData() override; 24 ~ChromeNavigationData() override;
27 25
28 // Creates a new ChromeNavigationData that is a deep copy of the original. Any 26 // 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 27 // changes to the original after the clone is created will not be reflected in
30 // the clone. 28 // the clone.
31 // |data_reduction_proxy_data_| is deep copied. 29 // |data_reduction_proxy_data_| is deep copied.
32 std::unique_ptr<content::NavigationData> Clone() const override; 30 std::unique_ptr<content::NavigationData> Clone() const override;
33 31
34 // Takes ownership of |data_reduction_proxy_data|. 32 // Takes ownership of |data_reduction_proxy_data|.
35 void SetDataReductionProxyData( 33 void SetDataReductionProxyData(
36 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> 34 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
37 data_reduction_proxy_data) { 35 data_reduction_proxy_data) {
38 data_reduction_proxy_data_ = std::move(data_reduction_proxy_data); 36 data_reduction_proxy_data_ = std::move(data_reduction_proxy_data);
39 } 37 }
40 38
41 data_reduction_proxy::DataReductionProxyData* GetDataReductionProxyData() 39 data_reduction_proxy::DataReductionProxyData* GetDataReductionProxyData()
42 const { 40 const {
43 return data_reduction_proxy_data_.get(); 41 return data_reduction_proxy_data_.get();
44 } 42 }
45 43
44 content::PreviewsState previews_state() { return previews_state_; }
45 void set_previews_state(content::PreviewsState previews_state) {
46 previews_state_ = previews_state;
47 }
48
46 static ChromeNavigationData* GetDataAndCreateIfNecessary( 49 static ChromeNavigationData* GetDataAndCreateIfNecessary(
47 net::URLRequest* request); 50 net::URLRequest* request);
48 51
49 private: 52 private:
50 // Manages the lifetime of optional DataReductionProxy information. 53 // Manages the lifetime of optional DataReductionProxy information.
51 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> 54 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
52 data_reduction_proxy_data_; 55 data_reduction_proxy_data_;
56 content::PreviewsState previews_state_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationData); 58 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationData);
55 }; 59 };
56 60
57 #endif // CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_ 61 #endif // CHROME_BROWSER_LOADER_CHROME_NAVIGATION_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/loader/chrome_navigation_data.cc » ('j') | chrome/browser/loader/chrome_navigation_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698