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

Side by Side Diff: src/trusted/plugin/srpc/desc_based_handle.h

Issue 2981011: Move plugin/srpc contents to the more appropriately named plugin/common.... (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 5 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2008 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file.
5 */
6
7 // Portable representation of scriptable NaClDesc.
8
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_DESC_BASED_HANDLE_H_
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_DESC_BASED_HANDLE_H_
11
12 #include <stdio.h>
13 #include <map>
14
15 #include "native_client/src/include/nacl_macros.h"
16 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
17 #include "native_client/src/trusted/plugin/srpc/portable_handle.h"
18 #include "native_client/src/trusted/plugin/srpc/utility.h"
19
20 struct NaClDesc;
21
22 namespace nacl {
23 class DescWrapper;
24 } // namespace nacl
25
26 namespace plugin {
27
28 class Plugin;
29
30 // DescBasedHandles are used to make NaClDesc objects scriptable by JavaScript.
31 class DescBasedHandle : public PortableHandle {
32 public:
33 static DescBasedHandle* New(Plugin* plugin, nacl::DescWrapper* wrapper);
34
35 void Invalidate() { }
36
37 virtual BrowserInterface* browser_interface() const;
38 virtual Plugin* plugin() const { return plugin_; }
39 // Get the contained descriptor.
40 virtual nacl::DescWrapper* wrapper() const { return wrapper_; }
41 virtual NaClDesc* desc() const {
42 if (NULL == wrapper_) {
43 return NULL;
44 }
45 return wrapper_->desc();
46 }
47
48 protected:
49 DescBasedHandle();
50 virtual ~DescBasedHandle();
51 bool Init(Plugin* plugin, nacl::DescWrapper* wrapper);
52
53 private:
54 NACL_DISALLOW_COPY_AND_ASSIGN(DescBasedHandle);
55 void LoadMethods();
56 Plugin* plugin_;
57 nacl::DescWrapper* wrapper_;
58 };
59
60 } // namespace plugin
61
62 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_DESC_BASED_HANDLE_H_
OLDNEW
« no previous file with comments | « src/trusted/plugin/srpc/connected_socket.cc ('k') | src/trusted/plugin/srpc/desc_based_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698