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/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/browser/frame_host/frame_navigation_entry.h" | 12 #include "content/browser/frame_host/frame_navigation_entry.h" |
13 #include "content/browser/frame_host/frame_tree_node.h" | 13 #include "content/browser/frame_host/frame_tree_node.h" |
14 #include "content/browser/site_instance_impl.h" | 14 #include "content/browser/site_instance_impl.h" |
15 #include "content/common/frame_message_enums.h" | 15 #include "content/common/frame_message_enums.h" |
| 16 #include "content/common/page_state_serialization.h" |
16 #include "content/public/browser/favicon_status.h" | 17 #include "content/public/browser/favicon_status.h" |
17 #include "content/public/browser/global_request_id.h" | 18 #include "content/public/browser/global_request_id.h" |
18 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
19 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
20 #include "content/public/common/ssl_status.h" | 21 #include "content/public/common/ssl_status.h" |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 struct CommonNavigationParams; | 24 struct CommonNavigationParams; |
24 struct RequestNavigationParams; | 25 struct RequestNavigationParams; |
25 struct StartNavigationParams; | 26 struct StartNavigationParams; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // NavigationEntries) is updated with the given parameters. | 180 // NavigationEntries) is updated with the given parameters. |
180 // Does nothing if there is no entry already and |url| is about:blank, since | 181 // Does nothing if there is no entry already and |url| is about:blank, since |
181 // that does not count as a real commit. | 182 // that does not count as a real commit. |
182 void AddOrUpdateFrameEntry(FrameTreeNode* frame_tree_node, | 183 void AddOrUpdateFrameEntry(FrameTreeNode* frame_tree_node, |
183 const std::string& frame_unique_name, | 184 const std::string& frame_unique_name, |
184 int64 item_sequence_number, | 185 int64 item_sequence_number, |
185 int64 document_sequence_number, | 186 int64 document_sequence_number, |
186 SiteInstanceImpl* site_instance, | 187 SiteInstanceImpl* site_instance, |
187 const GURL& url, | 188 const GURL& url, |
188 const Referrer& referrer, | 189 const Referrer& referrer, |
189 const PageState& page_state); | 190 const ExplodedFrameState& frame_state); |
190 | 191 |
191 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if | 192 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if |
192 // there is one in this NavigationEntry. | 193 // there is one in this NavigationEntry. |
193 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; | 194 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; |
194 | 195 |
195 // Returns the FrameNavigationEntry corresponding to the frame with the given | 196 // Returns the FrameNavigationEntry corresponding to the frame with the given |
196 // |unique_name|, if any. This is useful when the FrameTreeNode cannot be used | 197 // |unique_name|, if any. This is useful when the FrameTreeNode cannot be used |
197 // to find the entry, such as for a newly created subframe in a history | 198 // to find the entry, such as for a newly created subframe in a history |
198 // navigation. Callers should update the FrameTreeNode ID of the entry so that | 199 // navigation. Callers should update the FrameTreeNode ID of the entry so that |
199 // it can be found with |GetFrameEntry| above. | 200 // it can be found with |GetFrameEntry| above. |
200 // TODO(creis): Generate or verify the unique_name in the browser process. | 201 // TODO(creis): Generate or verify the unique_name in the browser process. |
201 FrameNavigationEntry* GetFrameEntryByUniqueName( | 202 FrameNavigationEntry* GetFrameEntryByUniqueName( |
202 const std::string& unique_name) const; | 203 const std::string& unique_name) const; |
203 | 204 |
| 205 // In OOPIF modes, this updates the cached copy of the full PageState whenever |
| 206 // a frame's individual state changes. Keeping a cached copy is necessary to |
| 207 // be able to return a const ref from GetPageState. |
| 208 void UpdatePageState(); |
| 209 |
204 void set_unique_id(int unique_id) { | 210 void set_unique_id(int unique_id) { |
205 unique_id_ = unique_id; | 211 unique_id_ = unique_id; |
206 } | 212 } |
207 | 213 |
208 // The SiteInstance represents which pages must share processes. This is a | 214 // The SiteInstance represents which pages must share processes. This is a |
209 // reference counted pointer to a shared SiteInstance. | 215 // reference counted pointer to a shared SiteInstance. |
210 // | 216 // |
211 // Note that the SiteInstance should usually not be changed after it is set, | 217 // Note that the SiteInstance should usually not be changed after it is set, |
212 // but this may happen if the NavigationEntry was cloned and needs to use a | 218 // but this may happen if the NavigationEntry was cloned and needs to use a |
213 // different SiteInstance. | 219 // different SiteInstance. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 ui::PageTransition transition_type_; | 393 ui::PageTransition transition_type_; |
388 GURL user_typed_url_; | 394 GURL user_typed_url_; |
389 bool has_post_data_; | 395 bool has_post_data_; |
390 int64 post_id_; | 396 int64 post_id_; |
391 RestoreType restore_type_; | 397 RestoreType restore_type_; |
392 GURL original_request_url_; | 398 GURL original_request_url_; |
393 bool is_overriding_user_agent_; | 399 bool is_overriding_user_agent_; |
394 base::Time timestamp_; | 400 base::Time timestamp_; |
395 int http_status_code_; | 401 int http_status_code_; |
396 | 402 |
| 403 // In default Chrome, this is the PageState reported from the renderer. In |
| 404 // OOPIF modes, this is a cached copy of the PageState generated from the |
| 405 // various FrameNavigationEntry::frame_states. In either case, it is persisted |
| 406 // to support session/tab restore. |
| 407 PageState page_state_; |
| 408 |
397 // This member is not persisted with session restore because it is transient. | 409 // This member is not persisted with session restore because it is transient. |
398 // If the post request succeeds, this field is cleared since the same | 410 // If the post request succeeds, this field is cleared since the same |
399 // information is stored in |content_state_| above. It is also only shallow | 411 // information is stored in |content_state_| above. It is also only shallow |
400 // copied with compiler provided copy constructor. | 412 // copied with compiler provided copy constructor. |
401 // Cleared in |ResetForCommit|. | 413 // Cleared in |ResetForCommit|. |
402 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; | 414 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; |
403 | 415 |
404 // This is also a transient member (i.e. is not persisted with session | 416 // This is also a transient member (i.e. is not persisted with session |
405 // restore). The screenshot of a page is taken when navigating away from the | 417 // restore). The screenshot of a page is taken when navigating away from the |
406 // page. This screenshot is displayed during an overscroll-navigation | 418 // page. This screenshot is displayed during an overscroll-navigation |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // persisted, unless specific data is taken out/put back in at save/restore | 500 // persisted, unless specific data is taken out/put back in at save/restore |
489 // time (see TabNavigation for an example of this). | 501 // time (see TabNavigation for an example of this). |
490 std::map<std::string, base::string16> extra_data_; | 502 std::map<std::string, base::string16> extra_data_; |
491 | 503 |
492 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 504 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
493 }; | 505 }; |
494 | 506 |
495 } // namespace content | 507 } // namespace content |
496 | 508 |
497 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 509 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |