Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4468 // The SiteInstance might not match if we do a cross-process navigation with | 4469 // The SiteInstance might not match if we do a cross-process navigation with |
| 4469 // replacement (e.g., auto-subframe), in which case the swap out of the old | 4470 // replacement (e.g., auto-subframe), in which case the swap out of the old |
| 4470 // RenderFrameHost runs in the background after the old FrameNavigationEntry | 4471 // RenderFrameHost runs in the background after the old FrameNavigationEntry |
| 4471 // has already been replaced and destroyed. | 4472 // has already been replaced and destroyed. |
| 4472 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) | 4473 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) |
| 4473 return; | 4474 return; |
| 4474 | 4475 |
| 4475 if (page_state == frame_entry->page_state()) | 4476 if (page_state == frame_entry->page_state()) |
| 4476 return; // Nothing to update. | 4477 return; // Nothing to update. |
| 4477 | 4478 |
| 4479 // The document_sequence_number and item_sequence_number recorded in the | |
| 4480 // FrameNavigationEntry should not differ from the one coming with the update, | |
| 4481 // since it must come from the same document. Do not update it if difference | |
|
Charlie Reis
2016/07/27 22:48:28
nit: a difference
nasko
2016/07/29 15:52:22
Done.
| |
| 4482 // is detected, as this indicates that |frame_entry| is not the correct one. | |
| 4483 ExplodedPageState exploded_state; | |
| 4484 if (!DecodePageState(page_state.ToEncodedData(), &exploded_state)) | |
| 4485 return; | |
| 4486 | |
| 4487 if (exploded_state.top.document_sequence_number != | |
| 4488 frame_entry->document_sequence_number() || | |
| 4489 exploded_state.top.item_sequence_number != | |
| 4490 frame_entry->item_sequence_number()) { | |
| 4491 NOTREACHED(); | |
| 4492 return; | |
| 4493 } | |
| 4494 | |
| 4478 frame_entry->set_page_state(page_state); | 4495 frame_entry->set_page_state(page_state); |
| 4479 controller_.NotifyEntryChanged(entry); | 4496 controller_.NotifyEntryChanged(entry); |
| 4480 } | 4497 } |
| 4481 | 4498 |
| 4482 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, | 4499 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, |
| 4483 int32_t page_id, | 4500 int32_t page_id, |
| 4484 const base::string16& title, | 4501 const base::string16& title, |
| 4485 base::i18n::TextDirection title_direction) { | 4502 base::i18n::TextDirection title_direction) { |
| 4486 // If we have a title, that's a pretty good indication that we've started | 4503 // If we have a title, that's a pretty good indication that we've started |
| 4487 // getting useful data. | 4504 // getting useful data. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5153 for (RenderViewHost* render_view_host : render_view_host_set) | 5170 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5154 render_view_host->OnWebkitPreferencesChanged(); | 5171 render_view_host->OnWebkitPreferencesChanged(); |
| 5155 } | 5172 } |
| 5156 | 5173 |
| 5157 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5174 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5158 JavaScriptDialogManager* dialog_manager) { | 5175 JavaScriptDialogManager* dialog_manager) { |
| 5159 dialog_manager_ = dialog_manager; | 5176 dialog_manager_ = dialog_manager; |
| 5160 } | 5177 } |
| 5161 | 5178 |
| 5162 } // namespace content | 5179 } // namespace content |
| OLD | NEW |