Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "content/public/browser/navigation_data.h" | |
| 12 | |
| 13 namespace data_reduction_proxy { | |
| 14 class DataReductionProxyData; | |
| 15 } | |
| 16 | |
| 17 class ChromeNavigationData : public content::NavigationData { | |
| 18 public: | |
| 19 ChromeNavigationData(); | |
| 20 ~ChromeNavigationData() override; | |
| 21 | |
| 22 // Creates a new ChromeNavigationData that is a deep copy of the original, | |
| 23 // which could be used cross-thread. | |
| 24 // |data_reduction_proxy_data_| is deep copied. | |
| 25 std::unique_ptr<content::NavigationData> Clone() const override; | |
| 26 | |
| 27 // Takes ownership of |data_reduction_proxy_data|. | |
| 28 void SetDataReductionProxyData( | |
| 29 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> | |
| 30 data_reduction_proxy_data) { | |
| 31 data_reduction_proxy_data_ = std::move(data_reduction_proxy_data); | |
| 32 } | |
| 33 | |
| 34 data_reduction_proxy::DataReductionProxyData* GetDataReductionProxyData() { | |
| 35 return data_reduction_proxy_data_.get(); | |
| 36 } | |
| 37 | |
| 38 private: | |
| 39 // Manages the lifetime of optionally passed in DataReductionProxy | |
|
bengr
2016/04/29 21:14:20
nit: optionally passed in -> optional
RyanSturm
2016/05/02 19:52:19
Done.
| |
| 40 // information. | |
| 41 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> | |
| 42 data_reduction_proxy_data_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationData); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_DATA_H_ | |
| OLD | NEW |