| 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 // 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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 dib->second->Detach(); | 995 dib->second->Detach(); |
| 996 #else | 996 #else |
| 997 STLDeleteContainerPairSecondPointers( | 997 STLDeleteContainerPairSecondPointers( |
| 998 cached_dibs_.begin(), cached_dibs_.end()); | 998 cached_dibs_.begin(), cached_dibs_.end()); |
| 999 #endif | 999 #endif |
| 1000 cached_dibs_.clear(); | 1000 cached_dibs_.clear(); |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 bool RenderProcessHostImpl::Send(IPC::Message* msg) { | 1003 bool RenderProcessHostImpl::Send(IPC::Message* msg) { |
| 1004 if (!channel_.get()) { | 1004 if (!channel_.get()) { |
| 1005 if (!is_initialized_) { | 1005 if (!is_initialized_ && !msg->is_sync()) { |
| 1006 queued_messages_.push(msg); | 1006 queued_messages_.push(msg); |
| 1007 return true; | 1007 return true; |
| 1008 } else { | 1008 } else { |
| 1009 delete msg; | 1009 delete msg; |
| 1010 return false; | 1010 return false; |
| 1011 } | 1011 } |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) { | 1014 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) { |
| 1015 if (msg->is_sync()) { |
| 1016 delete msg; |
| 1017 return false; |
| 1018 } |
| 1015 queued_messages_.push(msg); | 1019 queued_messages_.push(msg); |
| 1016 return true; | 1020 return true; |
| 1017 } | 1021 } |
| 1018 | 1022 |
| 1019 return channel_->Send(msg); | 1023 return channel_->Send(msg); |
| 1020 } | 1024 } |
| 1021 | 1025 |
| 1022 bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { | 1026 bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { |
| 1023 // If we're about to be deleted, or have initiated the fast shutdown sequence, | 1027 // If we're about to be deleted, or have initiated the fast shutdown sequence, |
| 1024 // we ignore incoming messages. | 1028 // we ignore incoming messages. |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 TRACE_EVENT0("renderer_host", | 1617 TRACE_EVENT0("renderer_host", |
| 1614 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1618 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1615 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1619 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 1616 ack_params.sync_point = 0; | 1620 ack_params.sync_point = 0; |
| 1617 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1621 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1618 gpu_process_host_id, | 1622 gpu_process_host_id, |
| 1619 ack_params); | 1623 ack_params); |
| 1620 } | 1624 } |
| 1621 | 1625 |
| 1622 } // namespace content | 1626 } // namespace content |
| OLD | NEW |