OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_HOST_RESOURCE_H_ | 5 #ifndef PPAPI_SHARED_IMPL_HOST_RESOURCE_H_ |
6 #define PPAPI_PROXY_HOST_RESOURCE_H_ | 6 #define PPAPI_SHARED_IMPL_HOST_RESOURCE_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 | 10 |
11 namespace pp { | 11 namespace ppapi { |
12 namespace proxy { | |
13 | 12 |
14 // Represents a PP_Resource sent over the wire. This just wraps a PP_Resource. | 13 // Represents a PP_Resource sent over the wire. This just wraps a PP_Resource. |
15 // The point is to prevent mistakes where the wrong resource value is sent. | 14 // The point is to prevent mistakes where the wrong resource value is sent. |
16 // Resource values are remapped in the plugin so that it can talk to multiple | 15 // Resource values are remapped in the plugin so that it can talk to multiple |
17 // hosts. If all values were PP_Resource, it would be easy to forget to do | 16 // hosts. If all values were PP_Resource, it would be easy to forget to do |
18 // this tranformation. | 17 // this tranformation. |
19 // | 18 // |
20 // All HostResources respresent IDs valid in the host. | 19 // All HostResources respresent IDs valid in the host. |
21 class HostResource { | 20 class HostResource { |
22 public: | 21 public: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (instance_ != other.instance_) | 56 if (instance_ != other.instance_) |
58 return instance_ < other.instance_; | 57 return instance_ < other.instance_; |
59 return host_resource_ < other.host_resource_; | 58 return host_resource_ < other.host_resource_; |
60 } | 59 } |
61 | 60 |
62 private: | 61 private: |
63 PP_Instance instance_; | 62 PP_Instance instance_; |
64 PP_Resource host_resource_; | 63 PP_Resource host_resource_; |
65 }; | 64 }; |
66 | 65 |
67 } // namespace proxy | 66 } // namespace ppapi |
68 } // namespace pp | |
69 | 67 |
70 #endif // PPAPI_PROXY_HOST_RESOURCE_H_ | 68 #endif // PPAPI_SHARED_IMPL_HOST_RESOURCE_H_ |
OLD | NEW |