OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" | 5 #include "chrome/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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 navigations_suspended_(false), | 114 navigations_suspended_(false), |
115 suspended_nav_message_(NULL), | 115 suspended_nav_message_(NULL), |
116 run_modal_reply_msg_(NULL), | 116 run_modal_reply_msg_(NULL), |
117 is_waiting_for_beforeunload_ack_(false), | 117 is_waiting_for_beforeunload_ack_(false), |
118 is_waiting_for_unload_ack_(false), | 118 is_waiting_for_unload_ack_(false), |
119 unload_ack_is_for_cross_site_transition_(false), | 119 unload_ack_is_for_cross_site_transition_(false), |
120 are_javascript_messages_suppressed_(false), | 120 are_javascript_messages_suppressed_(false), |
121 sudden_termination_allowed_(false), | 121 sudden_termination_allowed_(false), |
122 session_storage_namespace_(session_storage), | 122 session_storage_namespace_(session_storage), |
123 is_extension_process_(false), | 123 is_extension_process_(false), |
| 124 installed_app_(NULL), |
124 save_accessibility_tree_for_testing_(false), | 125 save_accessibility_tree_for_testing_(false), |
125 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 126 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
126 if (!session_storage_namespace_) { | 127 if (!session_storage_namespace_) { |
127 session_storage_namespace_ = | 128 session_storage_namespace_ = |
128 new SessionStorageNamespace(process()->profile()); | 129 new SessionStorageNamespace(process()->profile()); |
129 } | 130 } |
130 | 131 |
131 DCHECK(instance_); | 132 DCHECK(instance_); |
132 DCHECK(delegate_); | 133 DCHECK(delegate_); |
133 } | 134 } |
134 | 135 |
135 RenderViewHost::~RenderViewHost() { | 136 RenderViewHost::~RenderViewHost() { |
136 delegate()->RenderViewDeleted(this); | 137 delegate()->RenderViewDeleted(this); |
137 | 138 |
138 // Be sure to clean up any leftover state from cross-site requests. | 139 // Be sure to clean up any leftover state from cross-site requests. |
139 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( | 140 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest( |
140 process()->id(), routing_id(), false); | 141 process()->id(), routing_id(), false); |
141 } | 142 } |
142 | 143 |
143 bool RenderViewHost::CreateRenderView(const string16& frame_name) { | 144 bool RenderViewHost::CreateRenderView(const string16& frame_name) { |
144 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 145 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
145 | 146 |
146 // The process may (if we're sharing a process with another host that already | 147 // The process may (if we're sharing a process with another host that already |
147 // initialized it) or may not (we have our own process or the old process | 148 // initialized it) or may not (we have our own process or the old process |
148 // crashed) have been initialized. Calling Init multiple times will be | 149 // crashed) have been initialized. Calling Init multiple times will be |
149 // ignored, so this is safe. | 150 // ignored, so this is safe. |
150 if (!process()->Init(renderer_accessible(), is_extension_process_)) | 151 if (!process()->Init(renderer_accessible(), is_extension_process_, |
| 152 installed_app_)) |
151 return false; | 153 return false; |
152 DCHECK(process()->HasConnection()); | 154 DCHECK(process()->HasConnection()); |
153 DCHECK(process()->profile()); | 155 DCHECK(process()->profile()); |
154 | 156 |
155 if (BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)) { | 157 if (BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)) { |
156 ChildProcessSecurityPolicy::GetInstance()->GrantDOMUIBindings( | 158 ChildProcessSecurityPolicy::GetInstance()->GrantDOMUIBindings( |
157 process()->id()); | 159 process()->id()); |
158 } | 160 } |
159 | 161 |
160 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { | 162 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 if (printer_query.get()) { | 2022 if (printer_query.get()) { |
2021 BrowserThread::PostTask( | 2023 BrowserThread::PostTask( |
2022 BrowserThread::IO, FROM_HERE, | 2024 BrowserThread::IO, FROM_HERE, |
2023 NewRunnableMethod(printer_query.get(), | 2025 NewRunnableMethod(printer_query.get(), |
2024 &printing::PrinterQuery::StopWorker)); | 2026 &printing::PrinterQuery::StopWorker)); |
2025 } | 2027 } |
2026 | 2028 |
2027 // Send the printingDone msg for now. | 2029 // Send the printingDone msg for now. |
2028 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); | 2030 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); |
2029 } | 2031 } |
OLD | NEW |