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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 } | 1713 } |
1722 | 1714 |
1723 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { | 1715 void RenderViewHostImpl::NotifyMoveOrResizeStarted() { |
1724 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); | 1716 Send(new ViewMsg_MoveOrResizeStarted(GetRoutingID())); |
1725 } | 1717 } |
1726 | 1718 |
1727 void RenderViewHostImpl::StopFinding(content::StopFindAction action) { | 1719 void RenderViewHostImpl::StopFinding(content::StopFindAction action) { |
1728 Send(new ViewMsg_StopFinding(GetRoutingID(), action)); | 1720 Send(new ViewMsg_StopFinding(GetRoutingID(), action)); |
1729 } | 1721 } |
1730 | 1722 |
1731 content::SessionStorageNamespace* | |
1732 RenderViewHostImpl::GetSessionStorageNamespace() { | |
1733 return session_storage_namespace_.get(); | |
1734 } | |
1735 | |
1736 void RenderViewHostImpl::OnAccessibilityNotifications( | 1723 void RenderViewHostImpl::OnAccessibilityNotifications( |
1737 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 1724 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
1738 if (view_ && !is_swapped_out_) | 1725 if (view_ && !is_swapped_out_) |
1739 view_->OnAccessibilityNotifications(params); | 1726 view_->OnAccessibilityNotifications(params); |
1740 | 1727 |
1741 if (!params.empty()) { | 1728 if (!params.empty()) { |
1742 for (unsigned i = 0; i < params.size(); i++) { | 1729 for (unsigned i = 0; i < params.size(); i++) { |
1743 const AccessibilityHostMsg_NotificationParams& param = params[i]; | 1730 const AccessibilityHostMsg_NotificationParams& param = params[i]; |
1744 | 1731 |
1745 if ((param.notification_type == AccessibilityNotificationLayoutComplete || | 1732 if ((param.notification_type == AccessibilityNotificationLayoutComplete || |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 // can cause navigations to be ignored in OnMsgNavigate. | 1876 // can cause navigations to be ignored in OnMsgNavigate. |
1890 is_waiting_for_beforeunload_ack_ = false; | 1877 is_waiting_for_beforeunload_ack_ = false; |
1891 is_waiting_for_unload_ack_ = false; | 1878 is_waiting_for_unload_ack_ = false; |
1892 } | 1879 } |
1893 | 1880 |
1894 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1881 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1895 STLDeleteValues(&power_save_blockers_); | 1882 STLDeleteValues(&power_save_blockers_); |
1896 } | 1883 } |
1897 | 1884 |
1898 } // namespace content | 1885 } // namespace content |
OLD | NEW |