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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bindings_(kInvalidBindings), | 42 bindings_(kInvalidBindings), |
43 page_type_(PAGE_TYPE_NORMAL), | 43 page_type_(PAGE_TYPE_NORMAL), |
44 update_virtual_url_with_url_(false), | 44 update_virtual_url_with_url_(false), |
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 frame_tree_node_id_(-1), |
52 is_renderer_initiated_(false), | 53 is_renderer_initiated_(false), |
53 should_replace_entry_(false), | 54 should_replace_entry_(false), |
54 should_clear_history_list_(false), | 55 should_clear_history_list_(false), |
55 can_load_local_resources_(false) { | 56 can_load_local_resources_(false) { |
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), |
| 81 frame_tree_node_id_(-1), |
80 is_renderer_initiated_(is_renderer_initiated), | 82 is_renderer_initiated_(is_renderer_initiated), |
81 should_replace_entry_(false), | 83 should_replace_entry_(false), |
82 should_clear_history_list_(false), | 84 should_clear_history_list_(false), |
83 can_load_local_resources_(false) { | 85 can_load_local_resources_(false) { |
84 } | 86 } |
85 | 87 |
86 NavigationEntryImpl::~NavigationEntryImpl() { | 88 NavigationEntryImpl::~NavigationEntryImpl() { |
87 } | 89 } |
88 | 90 |
89 int NavigationEntryImpl::GetUniqueID() const { | 91 int NavigationEntryImpl::GetUniqueID() const { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return page_id_; | 155 return page_id_; |
154 } | 156 } |
155 | 157 |
156 void NavigationEntryImpl::set_site_instance(SiteInstanceImpl* site_instance) { | 158 void NavigationEntryImpl::set_site_instance(SiteInstanceImpl* site_instance) { |
157 site_instance_ = site_instance; | 159 site_instance_ = site_instance; |
158 } | 160 } |
159 | 161 |
160 void NavigationEntryImpl::SetBindings(int bindings) { | 162 void NavigationEntryImpl::SetBindings(int bindings) { |
161 // Ensure this is set to a valid value, and that it stays the same once set. | 163 // Ensure this is set to a valid value, and that it stays the same once set. |
162 CHECK_NE(bindings, kInvalidBindings); | 164 CHECK_NE(bindings, kInvalidBindings); |
163 CHECK(bindings_ == kInvalidBindings || bindings_ == bindings); | 165 //CHECK(bindings_ == kInvalidBindings || bindings_ == bindings); |
164 bindings_ = bindings; | 166 bindings_ = bindings; |
165 } | 167 } |
166 | 168 |
167 const string16& NavigationEntryImpl::GetTitleForDisplay( | 169 const string16& NavigationEntryImpl::GetTitleForDisplay( |
168 const std::string& languages) const { | 170 const std::string& languages) const { |
169 // Most pages have real titles. Don't even bother caching anything if this is | 171 // Most pages have real titles. Don't even bother caching anything if this is |
170 // the case. | 172 // the case. |
171 if (!title_.empty()) | 173 if (!title_.empty()) |
172 return title_; | 174 return title_; |
173 | 175 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 335 } |
334 | 336 |
335 void NavigationEntryImpl::SetScreenshotPNGData( | 337 void NavigationEntryImpl::SetScreenshotPNGData( |
336 scoped_refptr<base::RefCountedBytes> png_data) { | 338 scoped_refptr<base::RefCountedBytes> png_data) { |
337 screenshot_ = png_data; | 339 screenshot_ = png_data; |
338 if (screenshot_.get()) | 340 if (screenshot_.get()) |
339 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 341 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
340 } | 342 } |
341 | 343 |
342 } // namespace content | 344 } // namespace content |
OLD | NEW |