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

Unified Diff: chrome/browser/gpu_process_host_ui_shim.h

Issue 1546001: Split GpuProcessHost into GpuProcessHostUIShim, which runs on the UI... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gpu_process_host.cc ('k') | chrome/browser/gpu_process_host_ui_shim.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_process_host_ui_shim.h
===================================================================
--- chrome/browser/gpu_process_host_ui_shim.h (revision 0)
+++ chrome/browser/gpu_process_host_ui_shim.h (revision 0)
@@ -0,0 +1,56 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_
+#define CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_
+
+// This class lives on the UI thread and supports classes like the
+// BackingStoreProxy, which must live on the UI thread. The IO thread
+// portion of this class, the GpuProcessHost, is responsible for
+// shuttling messages between the browser and GPU processes.
+
+#include "base/singleton.h"
+#include "chrome/common/gpu_native_window_handle.h"
+#include "chrome/common/message_router.h"
+#include "ipc/ipc_channel.h"
+#include "gfx/native_widget_types.h"
+
+class GpuProcessHostUIShim : public IPC::Channel::Sender,
+ public IPC::Channel::Listener {
+ public:
+ // Getter for the singleton. This will return NULL on failure.
+ static GpuProcessHostUIShim* Get();
+
+ int32 GetNextRoutingId();
+
+ // Creates the new remote view and returns the routing ID for the view, or 0
+ // on failure.
+ int32 NewRenderWidgetHostView(GpuNativeWindowHandle parent);
+
+ // IPC::Channel::Sender implementation.
+ virtual bool Send(IPC::Message* msg);
+
+ // IPC::Channel::Listener implementation.
+ // The GpuProcessHost causes this to be called on the UI thread to
+ // dispatch the incoming messages from the GPU process, which are
+ // actually received on the IO thread.
+ virtual void OnMessageReceived(const IPC::Message& message);
+
+ // See documentation on MessageRouter for AddRoute and RemoveRoute
+ void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
+ void RemoveRoute(int32 routing_id);
+
+ private:
+ friend struct DefaultSingletonTraits<GpuProcessHostUIShim>;
+
+ GpuProcessHostUIShim();
+ virtual ~GpuProcessHostUIShim();
+
+ int last_routing_id_;
+
+ MessageRouter router_;
+};
+
+#endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_
+
Property changes on: chrome\browser\gpu_process_host_ui_shim.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/gpu_process_host.cc ('k') | chrome/browser/gpu_process_host_ui_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698