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 "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 static NavigationEntryImpl* FromNavigationEntry(NavigationEntry* entry); | 22 static NavigationEntryImpl* FromNavigationEntry(NavigationEntry* entry); |
23 | 23 |
24 // The value of bindings() before it is set during commit. | 24 // The value of bindings() before it is set during commit. |
25 static int kInvalidBindings; | 25 static int kInvalidBindings; |
26 | 26 |
27 NavigationEntryImpl(); | 27 NavigationEntryImpl(); |
28 NavigationEntryImpl(SiteInstanceImpl* instance, | 28 NavigationEntryImpl(SiteInstanceImpl* instance, |
29 int page_id, | 29 int page_id, |
30 const GURL& url, | 30 const GURL& url, |
31 const Referrer& referrer, | 31 const Referrer& referrer, |
32 const string16& title, | 32 const base::string16& title, |
33 PageTransition transition_type, | 33 PageTransition transition_type, |
34 bool is_renderer_initiated); | 34 bool is_renderer_initiated); |
35 virtual ~NavigationEntryImpl(); | 35 virtual ~NavigationEntryImpl(); |
36 | 36 |
37 // NavigationEntry implementation: | 37 // NavigationEntry implementation: |
38 virtual int GetUniqueID() const OVERRIDE; | 38 virtual int GetUniqueID() const OVERRIDE; |
39 virtual PageType GetPageType() const OVERRIDE; | 39 virtual PageType GetPageType() const OVERRIDE; |
40 virtual void SetURL(const GURL& url) OVERRIDE; | 40 virtual void SetURL(const GURL& url) OVERRIDE; |
41 virtual const GURL& GetURL() const OVERRIDE; | 41 virtual const GURL& GetURL() const OVERRIDE; |
42 virtual void SetBaseURLForDataURL(const GURL& url) OVERRIDE; | 42 virtual void SetBaseURLForDataURL(const GURL& url) OVERRIDE; |
43 virtual const GURL& GetBaseURLForDataURL() const OVERRIDE; | 43 virtual const GURL& GetBaseURLForDataURL() const OVERRIDE; |
44 virtual void SetReferrer(const Referrer& referrer) OVERRIDE; | 44 virtual void SetReferrer(const Referrer& referrer) OVERRIDE; |
45 virtual const Referrer& GetReferrer() const OVERRIDE; | 45 virtual const Referrer& GetReferrer() const OVERRIDE; |
46 virtual void SetVirtualURL(const GURL& url) OVERRIDE; | 46 virtual void SetVirtualURL(const GURL& url) OVERRIDE; |
47 virtual const GURL& GetVirtualURL() const OVERRIDE; | 47 virtual const GURL& GetVirtualURL() const OVERRIDE; |
48 virtual void SetTitle(const string16& title) OVERRIDE; | 48 virtual void SetTitle(const base::string16& title) OVERRIDE; |
49 virtual const string16& GetTitle() const OVERRIDE; | 49 virtual const base::string16& GetTitle() const OVERRIDE; |
50 virtual void SetPageState(const PageState& state) OVERRIDE; | 50 virtual void SetPageState(const PageState& state) OVERRIDE; |
51 virtual const PageState& GetPageState() const OVERRIDE; | 51 virtual const PageState& GetPageState() const OVERRIDE; |
52 virtual void SetPageID(int page_id) OVERRIDE; | 52 virtual void SetPageID(int page_id) OVERRIDE; |
53 virtual int32 GetPageID() const OVERRIDE; | 53 virtual int32 GetPageID() const OVERRIDE; |
54 virtual const string16& GetTitleForDisplay( | 54 virtual const base::string16& GetTitleForDisplay( |
55 const std::string& languages) const OVERRIDE; | 55 const std::string& languages) const OVERRIDE; |
56 virtual bool IsViewSourceMode() const OVERRIDE; | 56 virtual bool IsViewSourceMode() const OVERRIDE; |
57 virtual void SetTransitionType(PageTransition transition_type) OVERRIDE; | 57 virtual void SetTransitionType(PageTransition transition_type) OVERRIDE; |
58 virtual PageTransition GetTransitionType() const OVERRIDE; | 58 virtual PageTransition GetTransitionType() const OVERRIDE; |
59 virtual const GURL& GetUserTypedURL() const OVERRIDE; | 59 virtual const GURL& GetUserTypedURL() const OVERRIDE; |
60 virtual void SetHasPostData(bool has_post_data) OVERRIDE; | 60 virtual void SetHasPostData(bool has_post_data) OVERRIDE; |
61 virtual bool GetHasPostData() const OVERRIDE; | 61 virtual bool GetHasPostData() const OVERRIDE; |
62 virtual void SetPostID(int64 post_id) OVERRIDE; | 62 virtual void SetPostID(int64 post_id) OVERRIDE; |
63 virtual int64 GetPostID() const OVERRIDE; | 63 virtual int64 GetPostID() const OVERRIDE; |
64 virtual void SetBrowserInitiatedPostData( | 64 virtual void SetBrowserInitiatedPostData( |
65 const base::RefCountedMemory* data) OVERRIDE; | 65 const base::RefCountedMemory* data) OVERRIDE; |
66 virtual const base::RefCountedMemory* | 66 virtual const base::RefCountedMemory* |
67 GetBrowserInitiatedPostData() const OVERRIDE; | 67 GetBrowserInitiatedPostData() const OVERRIDE; |
68 virtual const FaviconStatus& GetFavicon() const OVERRIDE; | 68 virtual const FaviconStatus& GetFavicon() const OVERRIDE; |
69 virtual FaviconStatus& GetFavicon() OVERRIDE; | 69 virtual FaviconStatus& GetFavicon() OVERRIDE; |
70 virtual const SSLStatus& GetSSL() const OVERRIDE; | 70 virtual const SSLStatus& GetSSL() const OVERRIDE; |
71 virtual SSLStatus& GetSSL() OVERRIDE; | 71 virtual SSLStatus& GetSSL() OVERRIDE; |
72 virtual void SetOriginalRequestURL(const GURL& original_url) OVERRIDE; | 72 virtual void SetOriginalRequestURL(const GURL& original_url) OVERRIDE; |
73 virtual const GURL& GetOriginalRequestURL() const OVERRIDE; | 73 virtual const GURL& GetOriginalRequestURL() const OVERRIDE; |
74 virtual void SetIsOverridingUserAgent(bool override) OVERRIDE; | 74 virtual void SetIsOverridingUserAgent(bool override) OVERRIDE; |
75 virtual bool GetIsOverridingUserAgent() const OVERRIDE; | 75 virtual bool GetIsOverridingUserAgent() const OVERRIDE; |
76 virtual void SetTimestamp(base::Time timestamp) OVERRIDE; | 76 virtual void SetTimestamp(base::Time timestamp) OVERRIDE; |
77 virtual base::Time GetTimestamp() const OVERRIDE; | 77 virtual base::Time GetTimestamp() const OVERRIDE; |
78 virtual void SetCanLoadLocalResources(bool allow) OVERRIDE; | 78 virtual void SetCanLoadLocalResources(bool allow) OVERRIDE; |
79 virtual bool GetCanLoadLocalResources() const OVERRIDE; | 79 virtual bool GetCanLoadLocalResources() const OVERRIDE; |
80 virtual void SetFrameToNavigate(const std::string& frame_name) OVERRIDE; | 80 virtual void SetFrameToNavigate(const std::string& frame_name) OVERRIDE; |
81 virtual const std::string& GetFrameToNavigate() const OVERRIDE; | 81 virtual const std::string& GetFrameToNavigate() const OVERRIDE; |
82 virtual void SetExtraData(const std::string& key, | 82 virtual void SetExtraData(const std::string& key, |
83 const string16& data) OVERRIDE; | 83 const base::string16& data) OVERRIDE; |
84 virtual bool GetExtraData(const std::string& key, | 84 virtual bool GetExtraData(const std::string& key, |
85 string16* data) const OVERRIDE; | 85 base::string16* data) const OVERRIDE; |
86 virtual void ClearExtraData(const std::string& key) OVERRIDE; | 86 virtual void ClearExtraData(const std::string& key) OVERRIDE; |
87 virtual void SetHttpStatusCode(int http_status_code) OVERRIDE; | 87 virtual void SetHttpStatusCode(int http_status_code) OVERRIDE; |
88 virtual int GetHttpStatusCode() const OVERRIDE; | 88 virtual int GetHttpStatusCode() const OVERRIDE; |
89 | 89 |
90 // Once a navigation entry is committed, we should no longer track several | 90 // Once a navigation entry is committed, we should no longer track several |
91 // pieces of non-persisted state, as documented on the members below. | 91 // pieces of non-persisted state, as documented on the members below. |
92 void ResetForCommit(); | 92 void ResetForCommit(); |
93 | 93 |
94 void set_unique_id(int unique_id) { | 94 void set_unique_id(int unique_id) { |
95 unique_id_ = unique_id; | 95 unique_id_ = unique_id; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // See the accessors above for descriptions. | 236 // See the accessors above for descriptions. |
237 int unique_id_; | 237 int unique_id_; |
238 scoped_refptr<SiteInstanceImpl> site_instance_; | 238 scoped_refptr<SiteInstanceImpl> site_instance_; |
239 // TODO(creis): Persist bindings_. http://crbug.com/173672. | 239 // TODO(creis): Persist bindings_. http://crbug.com/173672. |
240 int bindings_; | 240 int bindings_; |
241 PageType page_type_; | 241 PageType page_type_; |
242 GURL url_; | 242 GURL url_; |
243 Referrer referrer_; | 243 Referrer referrer_; |
244 GURL virtual_url_; | 244 GURL virtual_url_; |
245 bool update_virtual_url_with_url_; | 245 bool update_virtual_url_with_url_; |
246 string16 title_; | 246 base::string16 title_; |
247 FaviconStatus favicon_; | 247 FaviconStatus favicon_; |
248 PageState page_state_; | 248 PageState page_state_; |
249 int32 page_id_; | 249 int32 page_id_; |
250 SSLStatus ssl_; | 250 SSLStatus ssl_; |
251 PageTransition transition_type_; | 251 PageTransition transition_type_; |
252 GURL user_typed_url_; | 252 GURL user_typed_url_; |
253 bool has_post_data_; | 253 bool has_post_data_; |
254 int64 post_id_; | 254 int64 post_id_; |
255 RestoreType restore_type_; | 255 RestoreType restore_type_; |
256 GURL original_request_url_; | 256 GURL original_request_url_; |
(...skipping 26 matching lines...) Expand all Loading... |
283 | 283 |
284 // Whether the entry, while loading, was created for a renderer-initiated | 284 // Whether the entry, while loading, was created for a renderer-initiated |
285 // navigation. This dictates whether the URL should be displayed before the | 285 // navigation. This dictates whether the URL should be displayed before the |
286 // navigation commits. It is cleared in |ResetForCommit| and not persisted. | 286 // navigation commits. It is cleared in |ResetForCommit| and not persisted. |
287 bool is_renderer_initiated_; | 287 bool is_renderer_initiated_; |
288 | 288 |
289 // This is a cached version of the result of GetTitleForDisplay. It prevents | 289 // This is a cached version of the result of GetTitleForDisplay. It prevents |
290 // us from having to do URL formatting on the URL every time the title is | 290 // us from having to do URL formatting on the URL every time the title is |
291 // displayed. When the URL, virtual URL, or title is set, this should be | 291 // displayed. When the URL, virtual URL, or title is set, this should be |
292 // cleared to force a refresh. | 292 // cleared to force a refresh. |
293 mutable string16 cached_display_title_; | 293 mutable base::string16 cached_display_title_; |
294 | 294 |
295 // In case a navigation is transferred to a new RVH but the request has | 295 // In case a navigation is transferred to a new RVH but the request has |
296 // been generated in the renderer already, this identifies the old request so | 296 // been generated in the renderer already, this identifies the old request so |
297 // that it can be resumed. The old request is stored until the | 297 // that it can be resumed. The old request is stored until the |
298 // ResourceDispatcher receives the navigation from the renderer which | 298 // ResourceDispatcher receives the navigation from the renderer which |
299 // carries this |transferred_global_request_id_| annotation. Once the request | 299 // carries this |transferred_global_request_id_| annotation. Once the request |
300 // is transferred to the new process, this is cleared and the request | 300 // is transferred to the new process, this is cleared and the request |
301 // continues as normal. | 301 // continues as normal. |
302 // Cleared in |ResetForCommit|. | 302 // Cleared in |ResetForCommit|. |
303 GlobalRequestID transferred_global_request_id_; | 303 GlobalRequestID transferred_global_request_id_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 // If not -1, this indicates which FrameTreeNode to navigate. This field is | 335 // If not -1, this indicates which FrameTreeNode to navigate. This field is |
336 // not persisted because it is experimental and only used when the | 336 // not persisted because it is experimental and only used when the |
337 // --site-per-process flag is passed. It is cleared in |ResetForCommit| | 337 // --site-per-process flag is passed. It is cleared in |ResetForCommit| |
338 // because we only use it while the navigation is pending. | 338 // because we only use it while the navigation is pending. |
339 // TODO(creis): Move this to FrameNavigationEntry. | 339 // TODO(creis): Move this to FrameNavigationEntry. |
340 int64 frame_tree_node_id_; | 340 int64 frame_tree_node_id_; |
341 | 341 |
342 // Used to store extra data to support browser features. This member is not | 342 // Used to store extra data to support browser features. This member is not |
343 // persisted, unless specific data is taken out/put back in at save/restore | 343 // persisted, unless specific data is taken out/put back in at save/restore |
344 // time (see TabNavigation for an example of this). | 344 // time (see TabNavigation for an example of this). |
345 std::map<std::string, string16> extra_data_; | 345 std::map<std::string, base::string16> extra_data_; |
346 | 346 |
347 // Copy and assignment is explicitly allowed for this class. | 347 // Copy and assignment is explicitly allowed for this class. |
348 }; | 348 }; |
349 | 349 |
350 } // namespace content | 350 } // namespace content |
351 | 351 |
352 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 352 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |