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

Side by Side Diff: content/renderer/android/synchronous_compositor_proxy.cc

Issue 1846653003: android webview: Keep zoom methods synchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ipc comments Created 4 years, 8 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
« no previous file with comments | « content/renderer/android/synchronous_compositor_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/android/synchronous_compositor_proxy.h" 5 #include "content/renderer/android/synchronous_compositor_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "content/common/android/sync_compositor_messages.h" 10 #include "content/common/android/sync_compositor_messages.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 IPC_MESSAGE_HANDLER(SyncCompositorMsg_HandleInputEvent, HandleInputEvent) 164 IPC_MESSAGE_HANDLER(SyncCompositorMsg_HandleInputEvent, HandleInputEvent)
165 IPC_MESSAGE_HANDLER(SyncCompositorMsg_BeginFrame, BeginFrame) 165 IPC_MESSAGE_HANDLER(SyncCompositorMsg_BeginFrame, BeginFrame)
166 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ComputeScroll, OnComputeScroll) 166 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ComputeScroll, OnComputeScroll)
167 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawHw, 167 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawHw,
168 DemandDrawHw) 168 DemandDrawHw)
169 IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetSharedMemory, SetSharedMemory) 169 IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetSharedMemory, SetSharedMemory)
170 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ZeroSharedMemory, ZeroSharedMemory) 170 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ZeroSharedMemory, ZeroSharedMemory)
171 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawSw, 171 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawSw,
172 DemandDrawSw) 172 DemandDrawSw)
173 IPC_MESSAGE_HANDLER(SyncCompositorMsg_UpdateState, ProcessCommonParams) 173 IPC_MESSAGE_HANDLER(SyncCompositorMsg_UpdateState, ProcessCommonParams)
174 IPC_MESSAGE_HANDLER(SyncCompositorMsg_SynchronousUpdateState,
175 SynchronousUpdateState)
174 IPC_END_MESSAGE_MAP() 176 IPC_END_MESSAGE_MAP()
175 } 177 }
176 178
177 bool SynchronousCompositorProxy::Send(IPC::Message* message) { 179 bool SynchronousCompositorProxy::Send(IPC::Message* message) {
178 return sender_->Send(message); 180 return sender_->Send(message);
179 } 181 }
180 182
181 void SynchronousCompositorProxy::HandleInputEvent( 183 void SynchronousCompositorProxy::HandleInputEvent(
182 const SyncCompositorCommonBrowserParams& common_params, 184 const SyncCompositorCommonBrowserParams& common_params,
183 const blink::WebInputEvent* event, 185 const blink::WebInputEvent* event,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 void SynchronousCompositorProxy::OnComputeScroll( 391 void SynchronousCompositorProxy::OnComputeScroll(
390 const SyncCompositorCommonBrowserParams& common_params, 392 const SyncCompositorCommonBrowserParams& common_params,
391 base::TimeTicks animation_time) { 393 base::TimeTicks animation_time) {
392 ProcessCommonParams(common_params); 394 ProcessCommonParams(common_params);
393 if (need_animate_scroll_) { 395 if (need_animate_scroll_) {
394 need_animate_scroll_ = false; 396 need_animate_scroll_ = false;
395 input_handler_proxy_->SynchronouslyAnimate(animation_time); 397 input_handler_proxy_->SynchronouslyAnimate(animation_time);
396 } 398 }
397 } 399 }
398 400
401 void SynchronousCompositorProxy::SynchronousUpdateState(
402 const SyncCompositorCommonBrowserParams& common_params,
403 SyncCompositorCommonRendererParams* common_renderer_params) {
404 DCHECK(!inside_receive_);
405 base::AutoReset<bool> scoped_inside_receive(&inside_receive_, true);
406 ProcessCommonParams(common_params);
407 PopulateCommonParams(common_renderer_params);
408 }
409
399 void SynchronousCompositorProxy::DidOverscroll( 410 void SynchronousCompositorProxy::DidOverscroll(
400 const DidOverscrollParams& did_overscroll_params) { 411 const DidOverscrollParams& did_overscroll_params) {
401 SyncCompositorCommonRendererParams params; 412 SyncCompositorCommonRendererParams params;
402 PopulateCommonParams(&params); 413 PopulateCommonParams(&params);
403 Send(new SyncCompositorHostMsg_OverScroll(routing_id_, params, 414 Send(new SyncCompositorHostMsg_OverScroll(routing_id_, params,
404 did_overscroll_params)); 415 did_overscroll_params));
405 } 416 }
406 417
407 void SynchronousCompositorProxy::ProcessCommonParams( 418 void SynchronousCompositorProxy::ProcessCommonParams(
408 const SyncCompositorCommonBrowserParams& common_params) { 419 const SyncCompositorCommonBrowserParams& common_params) {
(...skipping 11 matching lines...) Expand all
420 begin_frame_source_->SetBeginFrameSourcePaused( 431 begin_frame_source_->SetBeginFrameSourcePaused(
421 common_params.begin_frame_source_paused); 432 common_params.begin_frame_source_paused);
422 if (output_surface_ && !common_params.ack.resources.empty()) { 433 if (output_surface_ && !common_params.ack.resources.empty()) {
423 output_surface_->ReturnResources( 434 output_surface_->ReturnResources(
424 common_params.output_surface_id_for_returned_resources, 435 common_params.output_surface_id_for_returned_resources,
425 common_params.ack); 436 common_params.ack);
426 } 437 }
427 } 438 }
428 439
429 } // namespace content 440 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/synchronous_compositor_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698