Chromium Code Reviews| 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..31b8211f7598eff018bec6610540bbf428e4254a |
| --- /dev/null |
| +++ b/chrome/browser/renderer_host/chrome_navigation_data.h |
| @@ -0,0 +1,47 @@ |
| +// 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 "content/public/browser/navigation_data.h" |
| + |
| +namespace data_reduction_proxy { |
| +class DataReductionProxyData; |
| +} |
| + |
| +class ChromeNavigationData : public content::NavigationData { |
| + public: |
| + ChromeNavigationData(); |
| + ~ChromeNavigationData() override; |
| + |
| + // Creates a new ChromeNavigationData that is completely independent of the |
|
nasko
2016/04/26 20:18:39
nit: s/completely independent/deep copy/
RyanSturm
2016/04/27 23:27:46
Done.
|
| + // original, and could be used cross-thread. |
| + // |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() { |
| + return data_reduction_proxy_data_.get(); |
| + } |
| + |
| + private: |
| + // Manages the lifetime of optionally passed in 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_ |