| 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" |
| 11 #include "content/browser/frame_host/frame_navigation_entry.h" |
| 11 #include "content/browser/site_instance_impl.h" | 12 #include "content/browser/site_instance_impl.h" |
| 12 #include "content/public/browser/favicon_status.h" | 13 #include "content/public/browser/favicon_status.h" |
| 13 #include "content/public/browser/global_request_id.h" | 14 #include "content/public/browser/global_request_id.h" |
| 14 #include "content/public/browser/navigation_entry.h" | 15 #include "content/public/browser/navigation_entry.h" |
| 15 #include "content/public/common/page_state.h" | 16 #include "content/public/common/page_state.h" |
| 16 #include "content/public/common/ssl_status.h" | 17 #include "content/public/common/ssl_status.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 class CONTENT_EXPORT NavigationEntryImpl | 21 class CONTENT_EXPORT NavigationEntryImpl |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool IsRestored() const override; | 91 bool IsRestored() const override; |
| 91 | 92 |
| 92 // Once a navigation entry is committed, we should no longer track several | 93 // Once a navigation entry is committed, we should no longer track several |
| 93 // pieces of non-persisted state, as documented on the members below. | 94 // pieces of non-persisted state, as documented on the members below. |
| 94 void ResetForCommit(); | 95 void ResetForCommit(); |
| 95 | 96 |
| 96 void set_unique_id(int unique_id) { | 97 void set_unique_id(int unique_id) { |
| 97 unique_id_ = unique_id; | 98 unique_id_ = unique_id; |
| 98 } | 99 } |
| 99 | 100 |
| 100 // The SiteInstance tells us how to share sub-processes. This is a reference | 101 // The SiteInstance represents which pages must share processes. This is a |
| 101 // counted pointer to a shared site instance. | 102 // reference counted pointer to a shared SiteInstance. |
| 102 // | 103 // |
| 103 // Note that the SiteInstance should usually not be changed after it is set, | 104 // Note that the SiteInstance should usually not be changed after it is set, |
| 104 // but this may happen if the NavigationEntry was cloned and needs to use a | 105 // but this may happen if the NavigationEntry was cloned and needs to use a |
| 105 // different SiteInstance. | 106 // different SiteInstance. |
| 106 void set_site_instance(SiteInstanceImpl* site_instance); | 107 void set_site_instance(SiteInstanceImpl* site_instance); |
| 107 SiteInstanceImpl* site_instance() const { | 108 SiteInstanceImpl* site_instance() const { |
| 108 return site_instance_.get(); | 109 return frame_entry_.site_instance(); |
| 109 } | 110 } |
| 110 | 111 |
| 111 // The |source_site_instance| is used to identify the SiteInstance of the | 112 // The |source_site_instance| is used to identify the SiteInstance of the |
| 112 // frame that initiated the navigation. | 113 // frame that initiated the navigation. |
| 113 void set_source_site_instance(SiteInstanceImpl* source_site_instance); | 114 void set_source_site_instance(SiteInstanceImpl* source_site_instance); |
| 114 SiteInstanceImpl* source_site_instance() const { | 115 SiteInstanceImpl* source_site_instance() const { |
| 115 return source_site_instance_.get(); | 116 return source_site_instance_.get(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 // Remember the set of bindings granted to this NavigationEntry at the time | 119 // Remember the set of bindings granted to this NavigationEntry at the time |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 #endif | 237 #endif |
| 237 | 238 |
| 238 private: | 239 private: |
| 239 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 240 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 240 // Session/Tab restore save portions of this class so that it can be recreated | 241 // Session/Tab restore save portions of this class so that it can be recreated |
| 241 // later. If you add a new field that needs to be persisted you'll have to | 242 // later. If you add a new field that needs to be persisted you'll have to |
| 242 // update SessionService/TabRestoreService and Android WebView | 243 // update SessionService/TabRestoreService and Android WebView |
| 243 // state_serializer.cc appropriately. | 244 // state_serializer.cc appropriately. |
| 244 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 245 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 245 | 246 |
| 247 // The FrameNavigationEntry for the main frame. |
| 248 // TODO(creis): Make this a tree with nodes for each frame in the page. |
| 249 FrameNavigationEntry frame_entry_; |
| 250 |
| 246 // See the accessors above for descriptions. | 251 // See the accessors above for descriptions. |
| 247 int unique_id_; | 252 int unique_id_; |
| 248 scoped_refptr<SiteInstanceImpl> site_instance_; | |
| 249 // TODO(creis): Persist bindings_. http://crbug.com/173672. | 253 // TODO(creis): Persist bindings_. http://crbug.com/173672. |
| 250 int bindings_; | 254 int bindings_; |
| 251 PageType page_type_; | 255 PageType page_type_; |
| 252 GURL url_; | |
| 253 Referrer referrer_; | |
| 254 GURL virtual_url_; | 256 GURL virtual_url_; |
| 255 bool update_virtual_url_with_url_; | 257 bool update_virtual_url_with_url_; |
| 256 base::string16 title_; | 258 base::string16 title_; |
| 257 FaviconStatus favicon_; | 259 FaviconStatus favicon_; |
| 258 PageState page_state_; | 260 PageState page_state_; |
| 259 int32 page_id_; | 261 int32 page_id_; |
| 260 SSLStatus ssl_; | 262 SSLStatus ssl_; |
| 261 ui::PageTransition transition_type_; | 263 ui::PageTransition transition_type_; |
| 262 GURL user_typed_url_; | 264 GURL user_typed_url_; |
| 263 bool has_post_data_; | 265 bool has_post_data_; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // persisted, unless specific data is taken out/put back in at save/restore | 365 // persisted, unless specific data is taken out/put back in at save/restore |
| 364 // time (see TabNavigation for an example of this). | 366 // time (see TabNavigation for an example of this). |
| 365 std::map<std::string, base::string16> extra_data_; | 367 std::map<std::string, base::string16> extra_data_; |
| 366 | 368 |
| 367 // Copy and assignment is explicitly allowed for this class. | 369 // Copy and assignment is explicitly allowed for this class. |
| 368 }; | 370 }; |
| 369 | 371 |
| 370 } // namespace content | 372 } // namespace content |
| 371 | 373 |
| 372 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 374 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |