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

Side by Side Diff: components/sessions/core/serialized_navigation_entry.h

Issue 2310363002: Persist offline page info in a navigation entry if needed (Closed)
Patch Set: Fix Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ 5 #ifndef COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_
6 #define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ 6 #define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 std::set<std::string> content_pack_categories() const { 117 std::set<std::string> content_pack_categories() const {
118 return content_pack_categories_; 118 return content_pack_categories_;
119 } 119 }
120 void set_content_pack_categories( 120 void set_content_pack_categories(
121 const std::set<std::string>& content_pack_categories) { 121 const std::set<std::string>& content_pack_categories) {
122 content_pack_categories_ = content_pack_categories; 122 content_pack_categories_ = content_pack_categories;
123 } 123 }
124 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; } 124 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; }
125 125
126 // Defines the custom behavior to load the offline page if it exists. This is
127 // extracted from the extra request header "X-Chrome-offline" whose value is
128 // a comma/space separated name-value pair.
129 const std::string& offline_page_info() const { return offline_page_info_; }
sky 2016/09/13 01:53:31 Why do we want to persist this as a string rather
jianli 2016/09/13 20:29:18 We have more than one properties needed to persist
sky 2016/09/13 23:30:42 The down side of a string is that it's easy to mis
jianli 2016/09/13 23:44:16 How do we want to persist the struct? Do we still
130
126 private: 131 private:
127 friend class ContentSerializedNavigationBuilder; 132 friend class ContentSerializedNavigationBuilder;
128 friend class ContentSerializedNavigationDriver; 133 friend class ContentSerializedNavigationDriver;
129 friend class SerializedNavigationEntryTestHelper; 134 friend class SerializedNavigationEntryTestHelper;
130 friend class IOSSerializedNavigationBuilder; 135 friend class IOSSerializedNavigationBuilder;
131 friend class IOSSerializedNavigationDriver; 136 friend class IOSSerializedNavigationDriver;
132 137
133 // Index in the NavigationController. 138 // Index in the NavigationController.
134 int index_; 139 int index_;
135 140
136 // Member variables corresponding to NavigationEntry fields. 141 // Member variables corresponding to NavigationEntry fields.
137 int unique_id_; 142 int unique_id_;
138 GURL referrer_url_; 143 GURL referrer_url_;
139 int referrer_policy_; 144 int referrer_policy_;
140 GURL virtual_url_; 145 GURL virtual_url_;
141 base::string16 title_; 146 base::string16 title_;
142 std::string encoded_page_state_; 147 std::string encoded_page_state_;
143 ui::PageTransition transition_type_; 148 ui::PageTransition transition_type_;
144 bool has_post_data_; 149 bool has_post_data_;
145 int64_t post_id_; 150 int64_t post_id_;
146 GURL original_request_url_; 151 GURL original_request_url_;
147 bool is_overriding_user_agent_; 152 bool is_overriding_user_agent_;
148 base::Time timestamp_; 153 base::Time timestamp_;
149 base::string16 search_terms_; 154 base::string16 search_terms_;
150 GURL favicon_url_; 155 GURL favicon_url_;
151 int http_status_code_; 156 int http_status_code_;
152 bool is_restored_; // Not persisted. 157 bool is_restored_; // Not persisted.
153 std::vector<GURL> redirect_chain_; // Not persisted. 158 std::vector<GURL> redirect_chain_; // Not persisted.
159 std::string offline_page_info_; // Not synced.
154 160
155 // Additional information. 161 // Additional information.
156 BlockedState blocked_state_; 162 BlockedState blocked_state_;
157 PasswordState password_state_; 163 PasswordState password_state_;
158 std::set<std::string> content_pack_categories_; 164 std::set<std::string> content_pack_categories_;
159 }; 165 };
160 166
161 } // namespace sessions 167 } // namespace sessions
162 168
163 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ 169 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698