| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3014 | 3014 |
| 3015 // static | 3015 // static |
| 3016 void RenderProcessHostImpl::OnMojoError( | 3016 void RenderProcessHostImpl::OnMojoError( |
| 3017 base::WeakPtr<RenderProcessHostImpl> process, | 3017 base::WeakPtr<RenderProcessHostImpl> process, |
| 3018 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 3018 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 3019 const std::string& error) { | 3019 const std::string& error) { |
| 3020 if (!task_runner->BelongsToCurrentThread()) { | 3020 if (!task_runner->BelongsToCurrentThread()) { |
| 3021 task_runner->PostTask(FROM_HERE, | 3021 task_runner->PostTask(FROM_HERE, |
| 3022 base::Bind(&RenderProcessHostImpl::OnMojoError, | 3022 base::Bind(&RenderProcessHostImpl::OnMojoError, |
| 3023 process, task_runner, error)); | 3023 process, task_runner, error)); |
| 3024 return; |
| 3024 } | 3025 } |
| 3025 if (!process) | 3026 if (!process) |
| 3026 return; | 3027 return; |
| 3027 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3028 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3028 | 3029 |
| 3029 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3030 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 3030 // enough information here so that we can determine what the bad message was. | 3031 // enough information here so that we can determine what the bad message was. |
| 3031 base::debug::Alias(&error); | 3032 base::debug::Alias(&error); |
| 3032 bad_message::ReceivedBadMessage(process.get(), | 3033 bad_message::ReceivedBadMessage(process.get(), |
| 3033 bad_message::RPH_MOJO_PROCESS_ERROR); | 3034 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3034 } | 3035 } |
| 3035 | 3036 |
| 3036 } // namespace content | 3037 } // namespace content |
| OLD | NEW |