| 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "content/browser/child_process_security_policy_impl.h" | 21 #include "content/browser/child_process_security_policy_impl.h" |
| 22 #include "content/browser/cross_site_request_manager.h" | 22 #include "content/browser/cross_site_request_manager.h" |
| 23 #include "content/browser/dom_storage/dom_storage_context_impl.h" | |
| 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 23 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 25 #include "content/browser/gpu/gpu_surface_tracker.h" | 24 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 26 #include "content/browser/host_zoom_map_impl.h" | 25 #include "content/browser/host_zoom_map_impl.h" |
| 27 #include "content/browser/power_save_blocker.h" | 26 #include "content/browser/power_save_blocker.h" |
| 28 #include "content/browser/renderer_host/dip_util.h" | 27 #include "content/browser/renderer_host/dip_util.h" |
| 29 #include "content/browser/renderer_host/render_process_host_impl.h" | 28 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 30 #include "content/browser/renderer_host/render_view_host_delegate.h" | 29 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 31 #include "content/common/accessibility_messages.h" | 30 #include "content/common/accessibility_messages.h" |
| 32 #include "content/common/desktop_notification_messages.h" | 31 #include "content/common/desktop_notification_messages.h" |
| 33 #include "content/common/drag_messages.h" | 32 #include "content/common/drag_messages.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 is_waiting_for_beforeunload_ack_(false), | 164 is_waiting_for_beforeunload_ack_(false), |
| 166 is_waiting_for_unload_ack_(false), | 165 is_waiting_for_unload_ack_(false), |
| 167 unload_ack_is_for_cross_site_transition_(false), | 166 unload_ack_is_for_cross_site_transition_(false), |
| 168 are_javascript_messages_suppressed_(false), | 167 are_javascript_messages_suppressed_(false), |
| 169 sudden_termination_allowed_(false), | 168 sudden_termination_allowed_(false), |
| 170 session_storage_namespace_( | 169 session_storage_namespace_( |
| 171 static_cast<SessionStorageNamespaceImpl*>(session_storage)), | 170 static_cast<SessionStorageNamespaceImpl*>(session_storage)), |
| 172 save_accessibility_tree_for_testing_(false), | 171 save_accessibility_tree_for_testing_(false), |
| 173 send_accessibility_updated_notifications_(false), | 172 send_accessibility_updated_notifications_(false), |
| 174 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 173 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
| 175 if (!session_storage_namespace_) { | 174 DCHECK(session_storage_namespace_); |
| 176 DOMStorageContext* dom_storage_context = | |
| 177 BrowserContext::GetDOMStorageContext(GetProcess()->GetBrowserContext(), | |
| 178 instance->GetProcess()->GetID()); | |
| 179 session_storage_namespace_ = new SessionStorageNamespaceImpl( | |
| 180 static_cast<DOMStorageContextImpl*>(dom_storage_context)); | |
| 181 } | |
| 182 | |
| 183 DCHECK(instance_); | 175 DCHECK(instance_); |
| 184 CHECK(delegate_); // http://crbug.com/82827 | 176 CHECK(delegate_); // http://crbug.com/82827 |
| 185 | 177 |
| 186 GetProcess()->EnableSendQueue(); | 178 GetProcess()->EnableSendQueue(); |
| 187 | 179 |
| 188 content::GetContentClient()->browser()->RenderViewHostCreated(this); | 180 content::GetContentClient()->browser()->RenderViewHostCreated(this); |
| 189 | 181 |
| 190 content::NotificationService::current()->Notify( | 182 content::NotificationService::current()->Notify( |
| 191 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED, | 183 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED, |
| 192 content::Source<RenderViewHost>(this), | 184 content::Source<RenderViewHost>(this), |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 } | 1709 } |
| 1718 | 1710 |
| 1719 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { | 1711 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { |
| 1720 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); | 1712 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); |
| 1721 } | 1713 } |
| 1722 | 1714 |
| 1723 void RenderViewHostImpl::StopFinding(content::StopFindAction action) { | 1715 void RenderViewHostImpl::StopFinding(content::StopFindAction action) { |
| 1724 Send(new ViewMsg_StopFinding(GetRoutingID(), action)); | 1716 Send(new ViewMsg_StopFinding(GetRoutingID(), action)); |
| 1725 } | 1717 } |
| 1726 | 1718 |
| 1727 content::SessionStorageNamespace* | |
| 1728 RenderViewHostImpl::GetSessionStorageNamespace() { | |
| 1729 return session_storage_namespace_.get(); | |
| 1730 } | |
| 1731 | |
| 1732 void RenderViewHostImpl::OnAccessibilityNotifications( | 1719 void RenderViewHostImpl::OnAccessibilityNotifications( |
| 1733 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 1720 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
| 1734 if (view_ && !is_swapped_out_) | 1721 if (view_ && !is_swapped_out_) |
| 1735 view_->OnAccessibilityNotifications(params); | 1722 view_->OnAccessibilityNotifications(params); |
| 1736 | 1723 |
| 1737 if (!params.empty()) { | 1724 if (!params.empty()) { |
| 1738 for (unsigned i = 0; i < params.size(); i++) { | 1725 for (unsigned i = 0; i < params.size(); i++) { |
| 1739 const AccessibilityHostMsg_NotificationParams& param = params[i]; | 1726 const AccessibilityHostMsg_NotificationParams& param = params[i]; |
| 1740 | 1727 |
| 1741 if ((param.notification_type == AccessibilityNotificationLayoutComplete || | 1728 if ((param.notification_type == AccessibilityNotificationLayoutComplete || |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1885 // can cause navigations to be ignored in OnMsgNavigate. | 1872 // can cause navigations to be ignored in OnMsgNavigate. |
| 1886 is_waiting_for_beforeunload_ack_ = false; | 1873 is_waiting_for_beforeunload_ack_ = false; |
| 1887 is_waiting_for_unload_ack_ = false; | 1874 is_waiting_for_unload_ack_ = false; |
| 1888 } | 1875 } |
| 1889 | 1876 |
| 1890 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1877 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1891 STLDeleteValues(&power_save_blockers_); | 1878 STLDeleteValues(&power_save_blockers_); |
| 1892 } | 1879 } |
| 1893 | 1880 |
| 1894 } // namespace content | 1881 } // namespace content |
| OLD | NEW |