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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2196623003: Add check for mismatching item and document sequence numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "content/browser/web_contents/web_contents_view_guest.h" 74 #include "content/browser/web_contents/web_contents_view_guest.h"
75 #include "content/browser/webui/generic_handler.h" 75 #include "content/browser/webui/generic_handler.h"
76 #include "content/browser/webui/web_ui_controller_factory_registry.h" 76 #include "content/browser/webui/web_ui_controller_factory_registry.h"
77 #include "content/browser/webui/web_ui_impl.h" 77 #include "content/browser/webui/web_ui_impl.h"
78 #include "content/common/browser_plugin/browser_plugin_constants.h" 78 #include "content/common/browser_plugin/browser_plugin_constants.h"
79 #include "content/common/browser_plugin/browser_plugin_messages.h" 79 #include "content/common/browser_plugin/browser_plugin_messages.h"
80 #include "content/common/frame_messages.h" 80 #include "content/common/frame_messages.h"
81 #include "content/common/input/web_input_event_traits.h" 81 #include "content/common/input/web_input_event_traits.h"
82 #include "content/common/input_messages.h" 82 #include "content/common/input_messages.h"
83 #include "content/common/page_messages.h" 83 #include "content/common/page_messages.h"
84 #include "content/common/page_state_serialization.h"
84 #include "content/common/site_isolation_policy.h" 85 #include "content/common/site_isolation_policy.h"
85 #include "content/common/ssl_status_serialization.h" 86 #include "content/common/ssl_status_serialization.h"
86 #include "content/common/view_messages.h" 87 #include "content/common/view_messages.h"
87 #include "content/public/browser/ax_event_notification_details.h" 88 #include "content/public/browser/ax_event_notification_details.h"
88 #include "content/public/browser/browser_context.h" 89 #include "content/public/browser/browser_context.h"
89 #include "content/public/browser/browser_plugin_guest_manager.h" 90 #include "content/public/browser/browser_plugin_guest_manager.h"
90 #include "content/public/browser/content_browser_client.h" 91 #include "content/public/browser/content_browser_client.h"
91 #include "content/public/browser/devtools_agent_host.h" 92 #include "content/public/browser/devtools_agent_host.h"
92 #include "content/public/browser/download_manager.h" 93 #include "content/public/browser/download_manager.h"
93 #include "content/public/browser/download_url_parameters.h" 94 #include "content/public/browser/download_url_parameters.h"
(...skipping 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4527 return; 4528 return;
4528 4529
4529 if (page_state == frame_entry->page_state()) 4530 if (page_state == frame_entry->page_state())
4530 return; // Nothing to update. 4531 return; // Nothing to update.
4531 4532
4532 if (!page_state.IsValid()) { 4533 if (!page_state.IsValid()) {
4533 // Temporarily generate a minidump to diagnose https://crbug.com/568703. 4534 // Temporarily generate a minidump to diagnose https://crbug.com/568703.
4534 base::debug::DumpWithoutCrashing(); 4535 base::debug::DumpWithoutCrashing();
4535 NOTREACHED() << "Shouldn't set an empty PageState."; 4536 NOTREACHED() << "Shouldn't set an empty PageState.";
4536 } 4537 }
4538
4539 // The document_sequence_number and item_sequence_number recorded in the
4540 // FrameNavigationEntry should not differ from the one coming with the update,
4541 // since it must come from the same document. Do not update it if a difference
4542 // is detected, as this indicates that |frame_entry| is not the correct one.
4543 ExplodedPageState exploded_state;
4544 if (!DecodePageState(page_state.ToEncodedData(), &exploded_state))
4545 return;
4546
4547 if (exploded_state.top.document_sequence_number !=
4548 frame_entry->document_sequence_number() ||
4549 exploded_state.top.item_sequence_number !=
4550 frame_entry->item_sequence_number()) {
4551 return;
4552 }
4553
4537 frame_entry->set_page_state(page_state); 4554 frame_entry->set_page_state(page_state);
4538 controller_.NotifyEntryChanged(entry); 4555 controller_.NotifyEntryChanged(entry);
4539 } 4556 }
4540 4557
4541 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, 4558 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host,
4542 int32_t page_id, 4559 int32_t page_id,
4543 const base::string16& title, 4560 const base::string16& title,
4544 base::i18n::TextDirection title_direction) { 4561 base::i18n::TextDirection title_direction) {
4545 // If we have a title, that's a pretty good indication that we've started 4562 // If we have a title, that's a pretty good indication that we've started
4546 // getting useful data. 4563 // getting useful data.
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
5214 for (RenderViewHost* render_view_host : render_view_host_set) 5231 for (RenderViewHost* render_view_host : render_view_host_set)
5215 render_view_host->OnWebkitPreferencesChanged(); 5232 render_view_host->OnWebkitPreferencesChanged();
5216 } 5233 }
5217 5234
5218 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5235 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5219 JavaScriptDialogManager* dialog_manager) { 5236 JavaScriptDialogManager* dialog_manager) {
5220 dialog_manager_ = dialog_manager; 5237 dialog_manager_ = dialog_manager;
5221 } 5238 }
5222 5239
5223 } // namespace content 5240 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698