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 #include "content/browser/frame_host/navigation_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 page_id_(-1), | 45 page_id_(-1), |
46 transition_type_(PAGE_TRANSITION_LINK), | 46 transition_type_(PAGE_TRANSITION_LINK), |
47 has_post_data_(false), | 47 has_post_data_(false), |
48 post_id_(-1), | 48 post_id_(-1), |
49 restore_type_(RESTORE_NONE), | 49 restore_type_(RESTORE_NONE), |
50 is_overriding_user_agent_(false), | 50 is_overriding_user_agent_(false), |
51 http_status_code_(0), | 51 http_status_code_(0), |
52 is_renderer_initiated_(false), | 52 is_renderer_initiated_(false), |
53 should_replace_entry_(false), | 53 should_replace_entry_(false), |
54 should_clear_history_list_(false), | 54 should_clear_history_list_(false), |
55 can_load_local_resources_(false) { | 55 can_load_local_resources_(false), |
| 56 frame_tree_node_id_(-1) { |
56 } | 57 } |
57 | 58 |
58 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, | 59 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, |
59 int page_id, | 60 int page_id, |
60 const GURL& url, | 61 const GURL& url, |
61 const Referrer& referrer, | 62 const Referrer& referrer, |
62 const string16& title, | 63 const string16& title, |
63 PageTransition transition_type, | 64 PageTransition transition_type, |
64 bool is_renderer_initiated) | 65 bool is_renderer_initiated) |
65 : unique_id_(GetUniqueIDInConstructor()), | 66 : unique_id_(GetUniqueIDInConstructor()), |
66 site_instance_(instance), | 67 site_instance_(instance), |
67 bindings_(kInvalidBindings), | 68 bindings_(kInvalidBindings), |
68 page_type_(PAGE_TYPE_NORMAL), | 69 page_type_(PAGE_TYPE_NORMAL), |
69 url_(url), | 70 url_(url), |
70 referrer_(referrer), | 71 referrer_(referrer), |
71 update_virtual_url_with_url_(false), | 72 update_virtual_url_with_url_(false), |
72 title_(title), | 73 title_(title), |
73 page_id_(page_id), | 74 page_id_(page_id), |
74 transition_type_(transition_type), | 75 transition_type_(transition_type), |
75 has_post_data_(false), | 76 has_post_data_(false), |
76 post_id_(-1), | 77 post_id_(-1), |
77 restore_type_(RESTORE_NONE), | 78 restore_type_(RESTORE_NONE), |
78 is_overriding_user_agent_(false), | 79 is_overriding_user_agent_(false), |
79 http_status_code_(0), | 80 http_status_code_(0), |
80 is_renderer_initiated_(is_renderer_initiated), | 81 is_renderer_initiated_(is_renderer_initiated), |
81 should_replace_entry_(false), | 82 should_replace_entry_(false), |
82 should_clear_history_list_(false), | 83 should_clear_history_list_(false), |
83 can_load_local_resources_(false) { | 84 can_load_local_resources_(false), |
| 85 frame_tree_node_id_(-1) { |
84 } | 86 } |
85 | 87 |
86 NavigationEntryImpl::~NavigationEntryImpl() { | 88 NavigationEntryImpl::~NavigationEntryImpl() { |
87 } | 89 } |
88 | 90 |
89 int NavigationEntryImpl::GetUniqueID() const { | 91 int NavigationEntryImpl::GetUniqueID() const { |
90 return unique_id_; | 92 return unique_id_; |
91 } | 93 } |
92 | 94 |
93 PageType NavigationEntryImpl::GetPageType() const { | 95 PageType NavigationEntryImpl::GetPageType() const { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 325 |
324 void NavigationEntryImpl::ResetForCommit() { | 326 void NavigationEntryImpl::ResetForCommit() { |
325 // Any state that only matters when a navigation entry is pending should be | 327 // Any state that only matters when a navigation entry is pending should be |
326 // cleared here. | 328 // cleared here. |
327 SetBrowserInitiatedPostData(NULL); | 329 SetBrowserInitiatedPostData(NULL); |
328 set_is_renderer_initiated(false); | 330 set_is_renderer_initiated(false); |
329 set_transferred_global_request_id(GlobalRequestID()); | 331 set_transferred_global_request_id(GlobalRequestID()); |
330 set_should_replace_entry(false); | 332 set_should_replace_entry(false); |
331 redirect_chain_.clear(); | 333 redirect_chain_.clear(); |
332 set_should_clear_history_list(false); | 334 set_should_clear_history_list(false); |
| 335 set_frame_tree_node_id(-1); |
333 } | 336 } |
334 | 337 |
335 void NavigationEntryImpl::SetScreenshotPNGData( | 338 void NavigationEntryImpl::SetScreenshotPNGData( |
336 scoped_refptr<base::RefCountedBytes> png_data) { | 339 scoped_refptr<base::RefCountedBytes> png_data) { |
337 screenshot_ = png_data; | 340 screenshot_ = png_data; |
338 if (screenshot_.get()) | 341 if (screenshot_.get()) |
339 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 342 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
340 } | 343 } |
341 | 344 |
342 } // namespace content | 345 } // namespace content |
OLD | NEW |