| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_MAC_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_MAC_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 | |
| 10 namespace IPC { | |
| 11 class Message; | |
| 12 } | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // Provides functions for content to synchronize with window resize tasks being | |
| 17 // managed by ui::WindowResizeHelperMac. WindowResizeHelperMac must be | |
| 18 // initialized before calling these functions. | |
| 19 // | |
| 20 // The IPCs that are required to create new frames for smooth resize are sent | |
| 21 // to the ui::WindowResizeHelperMac singleton using the PostRendererProcessMsg() | |
| 22 // and PostGpuProcessMsg() methods. Usually those IPCs arrive on the IO thread | |
| 23 // and are posted as tasks to the UI thread either by the RenderMessageFilter | |
| 24 // (for renderer processes) or the GpuProcessHostUIShim (for the GPU process). | |
| 25 // By posting them via RenderWidgetResizeHelper instead, it allows a smooth | |
| 26 // window resize to be controlled by WindowResizeHelperMac. | |
| 27 class RenderWidgetResizeHelper { | |
| 28 public: | |
| 29 // IO THREAD ONLY ----------------------------------------------------------- | |
| 30 | |
| 31 // This will cause |msg| to be handled by the RenderProcessHost corresponding | |
| 32 // to |render_process_id|, on the UI thread. This will either happen when the | |
| 33 // ordinary message loop would run it, or potentially earlier in a call to | |
| 34 // WindowResizeHelperMac::WaitForSingleTaskToRun(). | |
| 35 static void PostRendererProcessMsg(int render_process_id, | |
| 36 const IPC::Message& msg); | |
| 37 | |
| 38 // This is similar to PostRendererProcessMsg, but will handle the message in | |
| 39 // the GpuProcessHostUIShim corresponding to |gpu_host_id|. | |
| 40 static void PostGpuProcessMsg(int gpu_host_id, const IPC::Message& msg); | |
| 41 | |
| 42 private: | |
| 43 DISALLOW_IMPLICIT_CONSTRUCTORS(RenderWidgetResizeHelper); | |
| 44 }; | |
| 45 | |
| 46 } // namespace content | |
| 47 | |
| 48 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_MAC_H_ | |
| OLD | NEW |