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

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

Issue 2482873002: Add is_srcdoc to FrameNavigationEntry and restore about::srcdoc URL. (Closed)
Patch Set: Addressed comments (@nasko) Created 4 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_FRAME_NAVIGATION_ENTRY_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 21 matching lines...) Expand all
32 public: 32 public:
33 FrameNavigationEntry(); 33 FrameNavigationEntry();
34 FrameNavigationEntry(const std::string& frame_unique_name, 34 FrameNavigationEntry(const std::string& frame_unique_name,
35 int64_t item_sequence_number, 35 int64_t item_sequence_number,
36 int64_t document_sequence_number, 36 int64_t document_sequence_number,
37 scoped_refptr<SiteInstanceImpl> site_instance, 37 scoped_refptr<SiteInstanceImpl> site_instance,
38 scoped_refptr<SiteInstanceImpl> source_site_instance, 38 scoped_refptr<SiteInstanceImpl> source_site_instance,
39 const GURL& url, 39 const GURL& url,
40 const Referrer& referrer, 40 const Referrer& referrer,
41 const std::string& method, 41 const std::string& method,
42 int64_t post_id); 42 int64_t post_id,
43 bool is_srcdoc);
43 44
44 // Creates a copy of this FrameNavigationEntry that can be modified 45 // Creates a copy of this FrameNavigationEntry that can be modified
45 // independently from the original. 46 // independently from the original.
46 FrameNavigationEntry* Clone() const; 47 FrameNavigationEntry* Clone() const;
47 48
48 // Updates all the members of this entry. 49 // Updates all the members of this entry.
49 void UpdateEntry(const std::string& frame_unique_name, 50 void UpdateEntry(const std::string& frame_unique_name,
50 int64_t item_sequence_number, 51 int64_t item_sequence_number,
51 int64_t document_sequence_number, 52 int64_t document_sequence_number,
52 SiteInstanceImpl* site_instance, 53 SiteInstanceImpl* site_instance,
53 scoped_refptr<SiteInstanceImpl> source_site_instance, 54 scoped_refptr<SiteInstanceImpl> source_site_instance,
54 const GURL& url, 55 const GURL& url,
55 const Referrer& referrer, 56 const Referrer& referrer,
56 const std::vector<GURL>& redirect_chain, 57 const std::vector<GURL>& redirect_chain,
57 const PageState& page_state, 58 const PageState& page_state,
58 const std::string& method, 59 const std::string& method,
59 int64_t post_id); 60 int64_t post_id,
61 bool is_srcdoc);
60 62
61 // The unique name of the frame this entry is for. This is a stable name for 63 // The unique name of the frame this entry is for. This is a stable name for
62 // the frame based on its position in the tree and relation to other named 64 // the frame based on its position in the tree and relation to other named
63 // frames, which does not change after cross-process navigations or restores. 65 // frames, which does not change after cross-process navigations or restores.
64 // Only the main frame can have an empty name. 66 // Only the main frame can have an empty name.
65 // 67 //
66 // This is unique relative to other frames in the same page, but not among 68 // This is unique relative to other frames in the same page, but not among
67 // other pages (i.e., not globally unique). 69 // other pages (i.e., not globally unique).
68 const std::string& frame_unique_name() const { return frame_unique_name_; } 70 const std::string& frame_unique_name() const { return frame_unique_name_; }
69 void set_frame_unique_name(const std::string& frame_unique_name) { 71 void set_frame_unique_name(const std::string& frame_unique_name) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 129
128 // The id of the post corresponding to this navigation or -1 if the 130 // The id of the post corresponding to this navigation or -1 if the
129 // navigation was not a POST. 131 // navigation was not a POST.
130 int64_t post_id() const { return post_id_; } 132 int64_t post_id() const { return post_id_; }
131 void set_post_id(int64_t post_id) { post_id_ = post_id; } 133 void set_post_id(int64_t post_id) { post_id_ = post_id; }
132 134
133 // The data sent during a POST navigation. Returns nullptr if the navigation 135 // The data sent during a POST navigation. Returns nullptr if the navigation
134 // is not a POST. 136 // is not a POST.
135 scoped_refptr<ResourceRequestBodyImpl> GetPostData() const; 137 scoped_refptr<ResourceRequestBodyImpl> GetPostData() const;
136 138
139 // Whether the navigation is for an iframe with srcdoc attribute.
140 bool is_srcdoc() const { return is_srcdoc_; }
141
137 private: 142 private:
138 friend class base::RefCounted<FrameNavigationEntry>; 143 friend class base::RefCounted<FrameNavigationEntry>;
139 virtual ~FrameNavigationEntry(); 144 virtual ~FrameNavigationEntry();
140 145
141 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 146 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
142 // Add all new fields to |UpdateEntry|. 147 // Add all new fields to |UpdateEntry|.
143 // TODO(creis): These fields have implications for session restore. This is 148 // TODO(creis): These fields have implications for session restore. This is
144 // currently managed by NavigationEntry, but the logic will move here. 149 // currently managed by NavigationEntry, but the logic will move here.
145 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 150 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
146 151
147 // See the accessors above for descriptions. 152 // See the accessors above for descriptions.
148 std::string frame_unique_name_; 153 std::string frame_unique_name_;
149 int64_t item_sequence_number_; 154 int64_t item_sequence_number_;
150 int64_t document_sequence_number_; 155 int64_t document_sequence_number_;
151 scoped_refptr<SiteInstanceImpl> site_instance_; 156 scoped_refptr<SiteInstanceImpl> site_instance_;
152 // This member is cleared at commit time and is not persisted. 157 // This member is cleared at commit time and is not persisted.
153 scoped_refptr<SiteInstanceImpl> source_site_instance_; 158 scoped_refptr<SiteInstanceImpl> source_site_instance_;
154 GURL url_; 159 GURL url_;
155 Referrer referrer_; 160 Referrer referrer_;
156 // This is used when transferring a pending entry from one process to another. 161 // This is used when transferring a pending entry from one process to another.
157 // We also send the main frame's redirect chain through session sync for 162 // We also send the main frame's redirect chain through session sync for
158 // offline analysis. 163 // offline analysis.
159 // It is preserved after commit but should not be persisted. 164 // It is preserved after commit but should not be persisted.
160 std::vector<GURL> redirect_chain_; 165 std::vector<GURL> redirect_chain_;
161 // TODO(creis): Change this to FrameState. 166 // TODO(creis): Change this to FrameState.
162 PageState page_state_; 167 PageState page_state_;
163 std::string method_; 168 std::string method_;
164 int64_t post_id_; 169 int64_t post_id_;
170 bool is_srcdoc_;
165 171
166 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); 172 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry);
167 }; 173 };
168 174
169 } // namespace content 175 } // namespace content
170 176
171 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ 177 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698