Chromium Code Reviews| 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/time/time.h" | 11 #include "base/time/time.h" |
| 11 #include "content/browser/frame_host/frame_navigation_entry.h" | 12 #include "content/browser/frame_host/frame_navigation_entry.h" |
| 12 #include "content/browser/site_instance_impl.h" | 13 #include "content/browser/site_instance_impl.h" |
| 13 #include "content/common/frame_message_enums.h" | 14 #include "content/common/frame_message_enums.h" |
| 14 #include "content/public/browser/favicon_status.h" | 15 #include "content/public/browser/favicon_status.h" |
| 15 #include "content/public/browser/global_request_id.h" | 16 #include "content/public/browser/global_request_id.h" |
| 16 #include "content/public/browser/navigation_entry.h" | 17 #include "content/public/browser/navigation_entry.h" |
| 17 #include "content/public/common/page_state.h" | 18 #include "content/public/common/page_state.h" |
| 18 #include "content/public/common/ssl_status.h" | 19 #include "content/public/common/ssl_status.h" |
| 19 | 20 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 37 // Returns a deep copy of the tree with copies of each node's | 38 // Returns a deep copy of the tree with copies of each node's |
| 38 // FrameNavigationEntries. We do not yet share FrameNavigationEntries | 39 // FrameNavigationEntries. We do not yet share FrameNavigationEntries |
| 39 // across trees. | 40 // across trees. |
| 40 // TODO(creis): For --site-per-process, share FrameNavigationEntries between | 41 // TODO(creis): For --site-per-process, share FrameNavigationEntries between |
| 41 // NavigationEntries of the same tab. | 42 // NavigationEntries of the same tab. |
| 42 TreeNode* Clone() const; | 43 TreeNode* Clone() const; |
| 43 | 44 |
| 44 // Ref counted pointer that keeps the FrameNavigationEntry alive as long as | 45 // Ref counted pointer that keeps the FrameNavigationEntry alive as long as |
| 45 // it is needed by this node's NavigationEntry. | 46 // it is needed by this node's NavigationEntry. |
| 46 scoped_refptr<FrameNavigationEntry> frame_entry; | 47 scoped_refptr<FrameNavigationEntry> frame_entry; |
| 48 | |
| 49 // List of child TreeNodes, which will be deleted when this node is. | |
| 50 ScopedVector<TreeNode> children; | |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 static NavigationEntryImpl* FromNavigationEntry(NavigationEntry* entry); | 53 static NavigationEntryImpl* FromNavigationEntry(NavigationEntry* entry); |
| 50 | 54 |
| 51 // The value of bindings() before it is set during commit. | 55 // The value of bindings() before it is set during commit. |
| 52 static int kInvalidBindings; | 56 static int kInvalidBindings; |
| 53 | 57 |
| 54 NavigationEntryImpl(); | 58 NavigationEntryImpl(); |
| 55 NavigationEntryImpl(SiteInstanceImpl* instance, | 59 NavigationEntryImpl(SiteInstanceImpl* instance, |
| 56 int page_id, | 60 int page_id, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 // TODO(creis): Once we start sharing FrameNavigationEntries between | 125 // TODO(creis): Once we start sharing FrameNavigationEntries between |
| 122 // NavigationEntryImpls, we will need to support two versions of Clone: one | 126 // NavigationEntryImpls, we will need to support two versions of Clone: one |
| 123 // that shares the existing FrameNavigationEntries (for use within the same | 127 // that shares the existing FrameNavigationEntries (for use within the same |
| 124 // tab) and one that draws them from a different pool (for use in a new tab). | 128 // tab) and one that draws them from a different pool (for use in a new tab). |
| 125 NavigationEntryImpl* Clone() const; | 129 NavigationEntryImpl* Clone() const; |
| 126 | 130 |
| 127 // Once a navigation entry is committed, we should no longer track several | 131 // Once a navigation entry is committed, we should no longer track several |
| 128 // pieces of non-persisted state, as documented on the members below. | 132 // pieces of non-persisted state, as documented on the members below. |
| 129 void ResetForCommit(); | 133 void ResetForCommit(); |
| 130 | 134 |
| 135 // Exposes the tree of FrameNavigationEntries that make up this joint session | |
| 136 // history item. | |
| 137 // In default Chrome, this tree only has a root node with an unshared | |
| 138 // FrameNavigationEntry. Subframes are only added to the tree if the | |
| 139 // --site-per-process flag is passed. | |
| 140 TreeNode* root_node() const { | |
| 141 return frame_tree_.get(); | |
| 142 } | |
| 143 | |
| 144 // Finds the TreeNode associated with |frame_tree_node_id| to add or update | |
| 145 // its FrameNavigationEntry. A new FrameNavigationEntry is added if none | |
| 146 // exists, or else the existing one (which might be shared with other | |
| 147 // NavigationEntries) is updated with the given parameters. | |
| 148 void AddOrUpdateFrameEntry(int64 frame_tree_node_id, | |
| 149 SiteInstanceImpl* site_instance, | |
|
Charlie Reis
2015/03/24 18:05:12
I'm not thrilled with having to take all of the Fr
| |
| 150 const GURL& url, | |
| 151 const Referrer& referrer); | |
| 152 | |
| 131 void set_unique_id(int unique_id) { | 153 void set_unique_id(int unique_id) { |
| 132 unique_id_ = unique_id; | 154 unique_id_ = unique_id; |
| 133 } | 155 } |
| 134 | 156 |
| 135 // The SiteInstance represents which pages must share processes. This is a | 157 // The SiteInstance represents which pages must share processes. This is a |
| 136 // reference counted pointer to a shared SiteInstance. | 158 // reference counted pointer to a shared SiteInstance. |
| 137 // | 159 // |
| 138 // Note that the SiteInstance should usually not be changed after it is set, | 160 // Note that the SiteInstance should usually not be changed after it is set, |
| 139 // but this may happen if the NavigationEntry was cloned and needs to use a | 161 // but this may happen if the NavigationEntry was cloned and needs to use a |
| 140 // different SiteInstance. | 162 // different SiteInstance. |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 // persisted, unless specific data is taken out/put back in at save/restore | 435 // persisted, unless specific data is taken out/put back in at save/restore |
| 414 // time (see TabNavigation for an example of this). | 436 // time (see TabNavigation for an example of this). |
| 415 std::map<std::string, base::string16> extra_data_; | 437 std::map<std::string, base::string16> extra_data_; |
| 416 | 438 |
| 417 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 439 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
| 418 }; | 440 }; |
| 419 | 441 |
| 420 } // namespace content | 442 } // namespace content |
| 421 | 443 |
| 422 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 444 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |