Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: content/browser/frame_host/navigation_entry_impl.h

Issue 1496483002: OOPIF: Support session restore by combining/splitting frame PageStates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some tests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // Returns the FrameNavigationEntry corresponding to the frame with the given 195 // Returns the FrameNavigationEntry corresponding to the frame with the given
196 // |unique_name|, if any. This is useful when the FrameTreeNode cannot be used 196 // |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 197 // 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 198 // navigation. Callers should update the FrameTreeNode ID of the entry so that
199 // it can be found with |GetFrameEntry| above. 199 // it can be found with |GetFrameEntry| above.
200 // TODO(creis): Generate or verify the unique_name in the browser process. 200 // TODO(creis): Generate or verify the unique_name in the browser process.
201 FrameNavigationEntry* GetFrameEntryByUniqueName( 201 FrameNavigationEntry* GetFrameEntryByUniqueName(
202 const std::string& unique_name) const; 202 const std::string& unique_name) const;
203 203
204 // In OOPIF modes, this updates the cached copy of the full PageState whenever
205 // a frame's individual state changes. Keeping a cached copy is necessary to
206 // be able to return a const ref from GetPageState.
Avi (use Gerrit) 2015/12/02 19:17:43 I would much rather change the API. PageState isn'
Charlie Reis 2015/12/02 19:48:18 I can give it another try in a preliminary CL, tho
Charlie Reis 2015/12/02 20:44:14 Ah, I was mistaken! The last time, I tried to rem
Avi (use Gerrit) 2015/12/02 21:15:45 You're welcome. Returning a const object by value
207 void UpdatePageState();
208
204 void set_unique_id(int unique_id) { 209 void set_unique_id(int unique_id) {
205 unique_id_ = unique_id; 210 unique_id_ = unique_id;
206 } 211 }
207 212
208 // The SiteInstance represents which pages must share processes. This is a 213 // The SiteInstance represents which pages must share processes. This is a
209 // reference counted pointer to a shared SiteInstance. 214 // reference counted pointer to a shared SiteInstance.
210 // 215 //
211 // Note that the SiteInstance should usually not be changed after it is set, 216 // 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 217 // but this may happen if the NavigationEntry was cloned and needs to use a
213 // different SiteInstance. 218 // different SiteInstance.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 ui::PageTransition transition_type_; 392 ui::PageTransition transition_type_;
388 GURL user_typed_url_; 393 GURL user_typed_url_;
389 bool has_post_data_; 394 bool has_post_data_;
390 int64 post_id_; 395 int64 post_id_;
391 RestoreType restore_type_; 396 RestoreType restore_type_;
392 GURL original_request_url_; 397 GURL original_request_url_;
393 bool is_overriding_user_agent_; 398 bool is_overriding_user_agent_;
394 base::Time timestamp_; 399 base::Time timestamp_;
395 int http_status_code_; 400 int http_status_code_;
396 401
402 // In default Chrome, this is the PageState reported from the renderer. In
403 // OOPIF modes, this is a cached copy of the PageState generated from the
404 // various FrameNavigationEntry states. In either case, it is persisted to
405 // support session/tab restore.
406 PageState page_state_;
407
397 // This member is not persisted with session restore because it is transient. 408 // 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 409 // 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 410 // information is stored in |content_state_| above. It is also only shallow
400 // copied with compiler provided copy constructor. 411 // copied with compiler provided copy constructor.
401 // Cleared in |ResetForCommit|. 412 // Cleared in |ResetForCommit|.
402 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; 413 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_;
403 414
404 // This is also a transient member (i.e. is not persisted with session 415 // 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 416 // restore). The screenshot of a page is taken when navigating away from the
406 // page. This screenshot is displayed during an overscroll-navigation 417 // page. This screenshot is displayed during an overscroll-navigation
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // persisted, unless specific data is taken out/put back in at save/restore 499 // persisted, unless specific data is taken out/put back in at save/restore
489 // time (see TabNavigation for an example of this). 500 // time (see TabNavigation for an example of this).
490 std::map<std::string, base::string16> extra_data_; 501 std::map<std::string, base::string16> extra_data_;
491 502
492 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); 503 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl);
493 }; 504 };
494 505
495 } // namespace content 506 } // namespace content
496 507
497 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 508 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698