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

Side by Side Diff: ui/viewer/viewer_ipc_server.h

Issue 10984007: in-chrome viewer for metro (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename messages to have metro prefix Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/viewer/viewer_host_win.cc ('k') | ui/viewer/viewer_ipc_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef UI_VIEWER_VIEWER_IPC_SERVER_H_
6 #define UI_VIEWER_VIEWER_IPC_SERVER_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "ipc/ipc_channel_handle.h"
12 #include "ipc/ipc_listener.h"
13 #include "ipc/ipc_sync_channel.h"
14 #include "ipc/ipc_sync_message_filter.h"
15 #include "ipc/ipc_sender.h"
16
17 // This class handles IPC commands for the Viewer process.
18 class ViewerIPCServer : public IPC::Listener, public IPC::Sender {
19 public:
20 explicit ViewerIPCServer(const IPC::ChannelHandle& handle);
21 virtual ~ViewerIPCServer();
22
23 bool Init();
24
25 // IPC::Sender implementation.
26 virtual bool Send(IPC::Message* msg) OVERRIDE;
27
28 IPC::SyncChannel* channel() { return channel_.get(); }
29
30 // Safe to call on any thread, as long as it's guaranteed that the thread's
31 // lifetime is less than the main thread.
32 IPC::SyncMessageFilter* sync_message_filter() { return sync_message_filter_; }
33
34 private:
35 // IPC::Listener implementation.
36 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
37 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
38 virtual void OnChannelError() OVERRIDE;
39
40 // IPC message handlers.
41 void OnPbufferHandle(const std::string& todo);
42
43 // Helper method to create the sync channel.
44 void CreateChannel();
45
46 bool client_connected_;
47
48 IPC::ChannelHandle channel_handle_;
49 scoped_ptr<IPC::SyncChannel> channel_;
50
51 // Allows threads other than the main thread to send sync messages.
52 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
53
54 DISALLOW_COPY_AND_ASSIGN(ViewerIPCServer);
55 };
56
57 #endif // UI_VIEWER_VIEWER_IPC_SERVER_H_
OLDNEW
« no previous file with comments | « ui/viewer/viewer_host_win.cc ('k') | ui/viewer/viewer_ipc_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698