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_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 430 } |
431 | 431 |
432 Destroy(also_delete); | 432 Destroy(also_delete); |
433 } | 433 } |
434 | 434 |
435 bool RenderWidgetHostImpl::IsLoading() const { | 435 bool RenderWidgetHostImpl::IsLoading() const { |
436 return is_loading_; | 436 return is_loading_; |
437 } | 437 } |
438 | 438 |
439 bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { | 439 bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { |
| 440 // Only process messages if the RenderWidget is alive. |
| 441 if (!renderer_initialized()) |
| 442 return false; |
| 443 |
440 if (owner_delegate_ && owner_delegate_->OnMessageReceived(msg)) | 444 if (owner_delegate_ && owner_delegate_->OnMessageReceived(msg)) |
441 return true; | 445 return true; |
442 | 446 |
443 bool handled = true; | 447 bool handled = true; |
444 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) | 448 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) |
445 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) | 449 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) |
446 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, | 450 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, |
447 OnQueueSyntheticGesture) | 451 OnQueueSyntheticGesture) |
448 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, | 452 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, |
449 OnImeCancelComposition) | 453 OnImeCancelComposition) |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 } | 2245 } |
2242 | 2246 |
2243 #if defined(OS_WIN) | 2247 #if defined(OS_WIN) |
2244 gfx::NativeViewAccessible | 2248 gfx::NativeViewAccessible |
2245 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2249 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
2246 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2250 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
2247 } | 2251 } |
2248 #endif | 2252 #endif |
2249 | 2253 |
2250 } // namespace content | 2254 } // namespace content |
OLD | NEW |