Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 370513002: Mac ÜC: Make resize smooth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_uc_for_reals
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 IPC::Listener* listener = listeners_.Lookup(msg.routing_id()); 1397 IPC::Listener* listener = listeners_.Lookup(msg.routing_id());
1398 if (!listener) { 1398 if (!listener) {
1399 if (msg.is_sync()) { 1399 if (msg.is_sync()) {
1400 // The listener has gone away, so we must respond or else the caller will 1400 // The listener has gone away, so we must respond or else the caller will
1401 // hang waiting for a reply. 1401 // hang waiting for a reply.
1402 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); 1402 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg);
1403 reply->set_reply_error(); 1403 reply->set_reply_error();
1404 Send(reply); 1404 Send(reply);
1405 } 1405 }
1406 1406
1407 #if defined(OS_MACOSX)
1407 // If this is a SwapBuffers, we need to ack it if we're not going to handle 1408 // If this is a SwapBuffers, we need to ack it if we're not going to handle
1408 // it so that the GPU process doesn't get stuck in unscheduled state. 1409 // it so that the GPU process doesn't get stuck in unscheduled state.
1409 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) 1410 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg)
1410 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, 1411 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
1411 OnCompositorSurfaceBuffersSwappedNoHost) 1412 OnCompositorSurfaceBuffersSwappedNoHost)
1412 IPC_END_MESSAGE_MAP() 1413 IPC_END_MESSAGE_MAP()
1414 #endif
1413 return true; 1415 return true;
1414 } 1416 }
1415 return listener->OnMessageReceived(msg); 1417 return listener->OnMessageReceived(msg);
1416 } 1418 }
1417 1419
1418 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { 1420 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) {
1419 #if defined(IPC_MESSAGE_LOG_ENABLED) 1421 #if defined(IPC_MESSAGE_LOG_ENABLED)
1420 Send(new ChildProcessMsg_SetIPCLoggingEnabled( 1422 Send(new ChildProcessMsg_SetIPCLoggingEnabled(
1421 IPC::Logging::GetInstance()->Enabled())); 1423 IPC::Logging::GetInstance()->Enabled()));
1422 #endif 1424 #endif
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 (GetUserData(kSessionStorageHolderKey)); 2135 (GetUserData(kSessionStorageHolderKey));
2134 if (!holder) 2136 if (!holder)
2135 return; 2137 return;
2136 holder->Release(old_route_id); 2138 holder->Release(old_route_id);
2137 } 2139 }
2138 2140
2139 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { 2141 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) {
2140 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); 2142 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size);
2141 } 2143 }
2142 2144
2145 #if defined(OS_MACOSX)
2143 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost( 2146 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost(
2144 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { 2147 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) {
2145 TRACE_EVENT0("renderer_host", 2148 TRACE_EVENT0("renderer_host",
2146 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); 2149 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
2147 if (!ui::LatencyInfo::Verify(params.latency_info, 2150 if (!ui::LatencyInfo::Verify(params.latency_info,
2148 "ViewHostMsg_CompositorSurfaceBuffersSwapped")) 2151 "ViewHostMsg_CompositorSurfaceBuffersSwapped"))
2149 return; 2152 return;
2153
2154 if (params.use_native_widget) {
2155 RenderWidgetHelper::OnNativeSurfaceBuffersSwappedOnUIThread(params);
2156 return;
2157 }
2158
2150 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 2159 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
2151 ack_params.sync_point = 0; 2160 ack_params.sync_point = 0;
2152 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, 2161 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id,
2153 params.gpu_process_host_id, 2162 params.gpu_process_host_id,
2154 ack_params); 2163 ack_params);
2155 } 2164 }
2165 #endif
2156 2166
2157 void RenderProcessHostImpl::OnGpuSwitching() { 2167 void RenderProcessHostImpl::OnGpuSwitching() {
2158 // We are updating all widgets including swapped out ones. 2168 // We are updating all widgets including swapped out ones.
2159 scoped_ptr<RenderWidgetHostIterator> widgets( 2169 scoped_ptr<RenderWidgetHostIterator> widgets(
2160 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); 2170 RenderWidgetHostImpl::GetAllRenderWidgetHosts());
2161 while (RenderWidgetHost* widget = widgets->GetNextHost()) { 2171 while (RenderWidgetHost* widget = widgets->GetNextHost()) {
2162 if (!widget->IsRenderView()) 2172 if (!widget->IsRenderView())
2163 continue; 2173 continue;
2164 2174
2165 // Skip widgets in other processes. 2175 // Skip widgets in other processes.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 void RenderProcessHostImpl::GpuMemoryBufferAllocated( 2370 void RenderProcessHostImpl::GpuMemoryBufferAllocated(
2361 IPC::Message* reply, 2371 IPC::Message* reply,
2362 const gfx::GpuMemoryBufferHandle& handle) { 2372 const gfx::GpuMemoryBufferHandle& handle) {
2363 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2373 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2364 ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer::WriteReplyParams(reply, 2374 ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer::WriteReplyParams(reply,
2365 handle); 2375 handle);
2366 Send(reply); 2376 Send(reply);
2367 } 2377 }
2368 2378
2369 } // namespace content 2379 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698