| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 navigations_suspended_(false), | 99 navigations_suspended_(false), |
| 100 suspended_nav_message_(NULL), | 100 suspended_nav_message_(NULL), |
| 101 run_modal_reply_msg_(NULL), | 101 run_modal_reply_msg_(NULL), |
| 102 is_waiting_for_beforeunload_ack_(false), | 102 is_waiting_for_beforeunload_ack_(false), |
| 103 is_waiting_for_unload_ack_(false), | 103 is_waiting_for_unload_ack_(false), |
| 104 unload_ack_is_for_cross_site_transition_(false), | 104 unload_ack_is_for_cross_site_transition_(false), |
| 105 are_javascript_messages_suppressed_(false), | 105 are_javascript_messages_suppressed_(false), |
| 106 sudden_termination_allowed_(false), | 106 sudden_termination_allowed_(false), |
| 107 session_storage_namespace_(session_storage), | 107 session_storage_namespace_(session_storage), |
| 108 is_extension_process_(false), | 108 is_extension_process_(false), |
| 109 installed_app_(NULL), |
| 109 save_accessibility_tree_for_testing_(false), | 110 save_accessibility_tree_for_testing_(false), |
| 110 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 111 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
| 111 if (!session_storage_namespace_) { | 112 if (!session_storage_namespace_) { |
| 112 session_storage_namespace_ = | 113 session_storage_namespace_ = |
| 113 new SessionStorageNamespace(process()->profile()); | 114 new SessionStorageNamespace(process()->profile()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 DCHECK(instance_); | 117 DCHECK(instance_); |
| 117 DCHECK(delegate_); | 118 DCHECK(delegate_); |
| 118 } | 119 } |
| 119 | 120 |
| 120 RenderViewHost::~RenderViewHost() { | 121 RenderViewHost::~RenderViewHost() { |
| 121 delegate()->RenderViewDeleted(this); | 122 delegate()->RenderViewDeleted(this); |
| 122 | 123 |
| 123 // Be sure to clean up any leftover state from cross-site requests. | 124 // Be sure to clean up any leftover state from cross-site requests. |
| 124 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 125 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
| 125 process()->id(), routing_id(), false); | 126 process()->id(), routing_id(), false); |
| 126 } | 127 } |
| 127 | 128 |
| 128 bool RenderViewHost::CreateRenderView(const string16& frame_name) { | 129 bool RenderViewHost::CreateRenderView(const string16& frame_name) { |
| 129 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 130 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
| 130 | 131 |
| 131 // The process may (if we're sharing a process with another host that already | 132 // The process may (if we're sharing a process with another host that already |
| 132 // initialized it) or may not (we have our own process or the old process | 133 // initialized it) or may not (we have our own process or the old process |
| 133 // crashed) have been initialized. Calling Init multiple times will be | 134 // crashed) have been initialized. Calling Init multiple times will be |
| 134 // ignored, so this is safe. | 135 // ignored, so this is safe. |
| 135 if (!process()->Init(renderer_accessible(), is_extension_process_)) | 136 if (!process()->Init(renderer_accessible(), is_extension_process_, |
| 137 installed_app_)) |
| 136 return false; | 138 return false; |
| 137 DCHECK(process()->HasConnection()); | 139 DCHECK(process()->HasConnection()); |
| 138 DCHECK(process()->profile()); | 140 DCHECK(process()->profile()); |
| 139 | 141 |
| 140 if (BindingsPolicy::is_web_ui_enabled(enabled_bindings_)) { | 142 if (BindingsPolicy::is_web_ui_enabled(enabled_bindings_)) { |
| 141 ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings( | 143 ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings( |
| 142 process()->id()); | 144 process()->id()); |
| 143 } | 145 } |
| 144 | 146 |
| 145 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { | 147 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 LOG(DFATAL) << "Invalid checked state " << checked_state; | 1705 LOG(DFATAL) << "Invalid checked state " << checked_state; |
| 1704 return; | 1706 return; |
| 1705 } | 1707 } |
| 1706 | 1708 |
| 1707 CommandState state; | 1709 CommandState state; |
| 1708 state.is_enabled = is_enabled; | 1710 state.is_enabled = is_enabled; |
| 1709 state.checked_state = | 1711 state.checked_state = |
| 1710 static_cast<RenderViewCommandCheckedState>(checked_state); | 1712 static_cast<RenderViewCommandCheckedState>(checked_state); |
| 1711 command_states_[static_cast<RenderViewCommand>(command)] = state; | 1713 command_states_[static_cast<RenderViewCommand>(command)] = state; |
| 1712 } | 1714 } |
| OLD | NEW |