OLD | NEW |
---|---|
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 CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 const base::string16& data) override; | 83 const base::string16& data) override; |
84 bool GetExtraData(const std::string& key, | 84 bool GetExtraData(const std::string& key, |
85 base::string16* data) const override; | 85 base::string16* data) const override; |
86 void ClearExtraData(const std::string& key) override; | 86 void ClearExtraData(const std::string& key) override; |
87 void SetHttpStatusCode(int http_status_code) override; | 87 void SetHttpStatusCode(int http_status_code) override; |
88 int GetHttpStatusCode() const override; | 88 int GetHttpStatusCode() const override; |
89 void SetRedirectChain(const std::vector<GURL>& redirects) override; | 89 void SetRedirectChain(const std::vector<GURL>& redirects) override; |
90 const std::vector<GURL>& GetRedirectChain() const override; | 90 const std::vector<GURL>& GetRedirectChain() const override; |
91 bool IsRestored() const override; | 91 bool IsRestored() const override; |
92 | 92 |
93 // Creates a copy of this NavigationEntryImpl that can be modified | |
94 // independently from the original. Does not copy any value that would be | |
95 // cleared in ResetForCommit. | |
96 // TODO(creis): Once we start sharing FrameNavigationEntries between | |
97 // NavigationEntryImpls, we will need to support two versions of Clone: one | |
98 // that shares the existing FrameNavigationEntries (for use within the same | |
99 // tab) and one that draws them from a different pool (for use in a new tab). | |
Avi (use Gerrit)
2015/03/12 16:59:19
Does this version of Clone have one of those behav
Charlie Reis
2015/03/12 17:07:43
Yeah, I hadn't thought closely about whether to ha
| |
100 NavigationEntryImpl* Clone() const; | |
101 | |
93 // Once a navigation entry is committed, we should no longer track several | 102 // Once a navigation entry is committed, we should no longer track several |
94 // pieces of non-persisted state, as documented on the members below. | 103 // pieces of non-persisted state, as documented on the members below. |
95 void ResetForCommit(); | 104 void ResetForCommit(); |
96 | 105 |
97 void set_unique_id(int unique_id) { | 106 void set_unique_id(int unique_id) { |
98 unique_id_ = unique_id; | 107 unique_id_ = unique_id; |
99 } | 108 } |
100 | 109 |
101 // The SiteInstance represents which pages must share processes. This is a | 110 // The SiteInstance represents which pages must share processes. This is a |
102 // reference counted pointer to a shared SiteInstance. | 111 // reference counted pointer to a shared SiteInstance. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 intent_received_timestamp_ = intent_received_timestamp; | 247 intent_received_timestamp_ = intent_received_timestamp; |
239 } | 248 } |
240 #endif | 249 #endif |
241 | 250 |
242 private: | 251 private: |
243 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 252 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
244 // Session/Tab restore save portions of this class so that it can be recreated | 253 // Session/Tab restore save portions of this class so that it can be recreated |
245 // later. If you add a new field that needs to be persisted you'll have to | 254 // later. If you add a new field that needs to be persisted you'll have to |
246 // update SessionService/TabRestoreService and Android WebView | 255 // update SessionService/TabRestoreService and Android WebView |
247 // state_serializer.cc appropriately. | 256 // state_serializer.cc appropriately. |
257 // For all new fields, update |Clone| and possibly |ResetForCommit|. | |
248 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 258 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
249 | 259 |
250 // The FrameNavigationEntry for the main frame. | 260 // The FrameNavigationEntry for the main frame. |
251 // TODO(creis): Make this a tree with nodes for each frame in the page. | 261 // TODO(creis): Make this a tree with nodes for each frame in the page. |
252 FrameNavigationEntry frame_entry_; | 262 FrameNavigationEntry frame_entry_; |
253 | 263 |
254 // See the accessors above for descriptions. | 264 // See the accessors above for descriptions. |
255 int unique_id_; | 265 int unique_id_; |
256 // TODO(creis): Persist bindings_. http://crbug.com/173672. | 266 // TODO(creis): Persist bindings_. http://crbug.com/173672. |
257 int bindings_; | 267 int bindings_; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 // The time at which Chrome received the Android Intent that triggered this | 372 // The time at which Chrome received the Android Intent that triggered this |
363 // URL load operation. Reset at commit and not persisted. | 373 // URL load operation. Reset at commit and not persisted. |
364 base::TimeTicks intent_received_timestamp_; | 374 base::TimeTicks intent_received_timestamp_; |
365 #endif | 375 #endif |
366 | 376 |
367 // Used to store extra data to support browser features. This member is not | 377 // Used to store extra data to support browser features. This member is not |
368 // persisted, unless specific data is taken out/put back in at save/restore | 378 // persisted, unless specific data is taken out/put back in at save/restore |
369 // time (see TabNavigation for an example of this). | 379 // time (see TabNavigation for an example of this). |
370 std::map<std::string, base::string16> extra_data_; | 380 std::map<std::string, base::string16> extra_data_; |
371 | 381 |
372 // Copy and assignment is explicitly allowed for this class. | 382 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
373 }; | 383 }; |
374 | 384 |
375 } // namespace content | 385 } // namespace content |
376 | 386 |
377 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 387 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |