| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 suspended_nav_message_(NULL), | 127 suspended_nav_message_(NULL), |
| 128 run_modal_reply_msg_(NULL), | 128 run_modal_reply_msg_(NULL), |
| 129 is_waiting_for_beforeunload_ack_(false), | 129 is_waiting_for_beforeunload_ack_(false), |
| 130 is_waiting_for_unload_ack_(false), | 130 is_waiting_for_unload_ack_(false), |
| 131 unload_ack_is_for_cross_site_transition_(false), | 131 unload_ack_is_for_cross_site_transition_(false), |
| 132 are_javascript_messages_suppressed_(false), | 132 are_javascript_messages_suppressed_(false), |
| 133 sudden_termination_allowed_(false), | 133 sudden_termination_allowed_(false), |
| 134 session_storage_namespace_(session_storage), | 134 session_storage_namespace_(session_storage), |
| 135 is_extension_process_(false), | 135 is_extension_process_(false), |
| 136 autofill_query_id_(0), | 136 autofill_query_id_(0), |
| 137 save_accessibility_tree_for_testing_(false) { | 137 save_accessibility_tree_for_testing_(false), |
| 138 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
| 138 if (!session_storage_namespace_) { | 139 if (!session_storage_namespace_) { |
| 139 session_storage_namespace_ = | 140 session_storage_namespace_ = |
| 140 new SessionStorageNamespace(process()->profile()); | 141 new SessionStorageNamespace(process()->profile()); |
| 141 } | 142 } |
| 142 | 143 |
| 143 DCHECK(instance_); | 144 DCHECK(instance_); |
| 144 DCHECK(delegate_); | 145 DCHECK(delegate_); |
| 145 } | 146 } |
| 146 | 147 |
| 147 RenderViewHost::~RenderViewHost() { | 148 RenderViewHost::~RenderViewHost() { |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 | 986 |
| 986 void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) { | 987 void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) { |
| 987 DCHECK(!run_modal_reply_msg_); | 988 DCHECK(!run_modal_reply_msg_); |
| 988 run_modal_reply_msg_ = reply_msg; | 989 run_modal_reply_msg_ = reply_msg; |
| 989 | 990 |
| 990 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in | 991 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in |
| 991 // an app-modal fashion. | 992 // an app-modal fashion. |
| 992 } | 993 } |
| 993 | 994 |
| 994 void RenderViewHost::OnMsgRenderViewReady() { | 995 void RenderViewHost::OnMsgRenderViewReady() { |
| 996 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING; |
| 995 WasResized(); | 997 WasResized(); |
| 996 delegate_->RenderViewReady(this); | 998 delegate_->RenderViewReady(this); |
| 997 } | 999 } |
| 998 | 1000 |
| 999 void RenderViewHost::OnMsgRenderViewGone() { | 1001 void RenderViewHost::OnMsgRenderViewGone(int status, int exit_code) { |
| 1002 // Keep the termination status so we can get at it later when we |
| 1003 // need to know why it died. |
| 1004 render_view_termination_status_ = |
| 1005 static_cast<base::TerminationStatus>(status); |
| 1006 |
| 1000 // Our base class RenderWidgetHost needs to reset some stuff. | 1007 // Our base class RenderWidgetHost needs to reset some stuff. |
| 1001 RendererExited(); | 1008 RendererExited(render_view_termination_status_, exit_code); |
| 1002 | 1009 |
| 1003 delegate_->RenderViewGone(this); | 1010 delegate_->RenderViewGone(this, |
| 1011 static_cast<base::TerminationStatus>(status), |
| 1012 exit_code); |
| 1004 } | 1013 } |
| 1005 | 1014 |
| 1006 // Called when the renderer navigates. For every frame loaded, we'll get this | 1015 // Called when the renderer navigates. For every frame loaded, we'll get this |
| 1007 // notification containing parameters identifying the navigation. | 1016 // notification containing parameters identifying the navigation. |
| 1008 // | 1017 // |
| 1009 // Subframes are identified by the page transition type. For subframes loaded | 1018 // Subframes are identified by the page transition type. For subframes loaded |
| 1010 // as part of a wider page load, the page_id will be the same as for the top | 1019 // as part of a wider page load, the page_id will be the same as for the top |
| 1011 // level frame. If the user explicitly requests a subframe navigation, we will | 1020 // level frame. If the user explicitly requests a subframe navigation, we will |
| 1012 // get a new page_id because we need to create a new navigation entry for that | 1021 // get a new page_id because we need to create a new navigation entry for that |
| 1013 // action. | 1022 // action. |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 TabContents* print_preview_tab = GetOrCreatePrintPreviewTab(); | 2253 TabContents* print_preview_tab = GetOrCreatePrintPreviewTab(); |
| 2245 DCHECK(print_preview_tab); | 2254 DCHECK(print_preview_tab); |
| 2246 | 2255 |
| 2247 // TODO(kmadhusu): Function definition needs to be changed. | 2256 // TODO(kmadhusu): Function definition needs to be changed. |
| 2248 // fd_in_browser should be the file descriptor of the metafile. | 2257 // fd_in_browser should be the file descriptor of the metafile. |
| 2249 | 2258 |
| 2250 // Send the printingDone msg for now. | 2259 // Send the printingDone msg for now. |
| 2251 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); | 2260 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); |
| 2252 } | 2261 } |
| 2253 #endif | 2262 #endif |
| OLD | NEW |