Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / renderer / gpu / stream_texture_host_android.h
blob863047beef335c19516be5528c20642e80bdaa72
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_
6 #define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/common/android/surface_texture_peer.h"
10 #include "ipc/ipc_channel.h"
11 #include "ipc/ipc_message.h"
13 namespace gfx {
14 class Size;
17 class GpuChannelHost;
18 struct GpuStreamTextureMsg_MatrixChanged_Params;
20 namespace content {
22 // Class for handling all the IPC messages between the GPU process and
23 // StreamTextureProxy.
24 class StreamTextureHost : public IPC::Listener {
25 public:
26 explicit StreamTextureHost(GpuChannelHost* channel);
27 virtual ~StreamTextureHost();
29 bool Initialize(int stream_id, const gfx::Size& initial_size);
31 // Listener class that is listening to the stream texture updates. It is
32 // implemented by StreamTextureProxyImpl.
33 class Listener {
34 public:
35 virtual void OnFrameAvailable() = 0;
36 virtual void OnMatrixChanged(const float mtx[16]) = 0;
37 virtual ~Listener() {}
40 void SetListener(Listener* listener) { listener_ = listener; }
42 // Request the GPU process to create the surface texture and forward it
43 // to the renderer process.
44 void EstablishPeer(SurfaceTexturePeer::SurfaceTextureTarget type,
45 int32 primary_id, int32 secondary_id);
47 // IPC::Channel::Listener implementation:
48 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
49 virtual void OnChannelError() OVERRIDE;
51 private:
52 // Message handlers:
53 void OnFrameAvailable();
54 void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param);
56 int route_id_;
57 int stream_id_;
58 Listener* listener_;
59 scoped_refptr<GpuChannelHost> channel_;
60 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_;
62 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost);
65 } // namespace content
67 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_