| 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 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 if (printer_query.get()) { | 2012 if (printer_query.get()) { |
| 2011 BrowserThread::PostTask( | 2013 BrowserThread::PostTask( |
| 2012 BrowserThread::IO, FROM_HERE, | 2014 BrowserThread::IO, FROM_HERE, |
| 2013 NewRunnableMethod(printer_query.get(), | 2015 NewRunnableMethod(printer_query.get(), |
| 2014 &printing::PrinterQuery::StopWorker)); | 2016 &printing::PrinterQuery::StopWorker)); |
| 2015 } | 2017 } |
| 2016 | 2018 |
| 2017 // Send the printingDone msg for now. | 2019 // Send the printingDone msg for now. |
| 2018 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); | 2020 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); |
| 2019 } | 2021 } |
| OLD | NEW |