OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RAW_VAR_DATA_H_ | 5 #ifndef PPAPI_PROXY_RAW_VAR_DATA_H_ |
6 #define PPAPI_PROXY_RAW_VAR_DATA_H_ | 6 #define PPAPI_PROXY_RAW_VAR_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/scoped_vector.h" | |
16 #include "ppapi/c/pp_instance.h" | 16 #include "ppapi/c/pp_instance.h" |
17 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
18 #include "ppapi/proxy/ppapi_param_traits.h" | 18 #include "ppapi/proxy/ppapi_param_traits.h" |
19 #include "ppapi/proxy/ppapi_proxy_export.h" | 19 #include "ppapi/proxy/ppapi_proxy_export.h" |
20 #include "ppapi/proxy/serialized_handle.h" | 20 #include "ppapi/proxy/serialized_handle.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class Pickle; | 23 class Pickle; |
24 class PickleIterator; | 24 class PickleIterator; |
25 } | 25 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Returns a vector of SerializedHandles associated with this RawVarDataGraph. | 79 // Returns a vector of SerializedHandles associated with this RawVarDataGraph. |
80 // Ownership of the pointers remains with the elements of the RawVarDataGraph. | 80 // Ownership of the pointers remains with the elements of the RawVarDataGraph. |
81 std::vector<SerializedHandle*> GetHandles(); | 81 std::vector<SerializedHandle*> GetHandles(); |
82 | 82 |
83 // Sets the threshold size at which point we switch from transmitting | 83 // Sets the threshold size at which point we switch from transmitting |
84 // array buffers in IPC messages to using shared memory. This is only used | 84 // array buffers in IPC messages to using shared memory. This is only used |
85 // for testing purposes where we need to transmit small buffers using shmem | 85 // for testing purposes where we need to transmit small buffers using shmem |
86 // (in order to have fast tests). | 86 // (in order to have fast tests). |
87 static void SetMinimumArrayBufferSizeForShmemForTest(uint32_t threshold); | 87 static void SetMinimumArrayBufferSizeForShmemForTest(uint32_t threshold); |
88 | 88 |
| 89 private: |
89 // A list of the nodes in the graph. | 90 // A list of the nodes in the graph. |
90 ScopedVector<RawVarData> data_; | 91 std::vector<scoped_ptr<RawVarData>> data_; |
| 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(RawVarDataGraph); |
91 }; | 94 }; |
92 | 95 |
93 // Abstract base class for the data contained in a PP_Var. | 96 // Abstract base class for the data contained in a PP_Var. |
94 class RawVarData { | 97 class RawVarData { |
95 public: | 98 public: |
96 // Create a new, empty RawVarData for the given type. | 99 // Create a new, empty RawVarData for the given type. |
97 static RawVarData* Create(PP_VarType type); | 100 static RawVarData* Create(PP_VarType type); |
98 RawVarData(); | 101 RawVarData(); |
99 virtual ~RawVarData(); | 102 virtual ~RawVarData(); |
100 | 103 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // resource. The message type will vary based on the resource type, and will | 296 // resource. The message type will vary based on the resource type, and will |
294 // usually contain a pending resource host ID, and other required information. | 297 // usually contain a pending resource host ID, and other required information. |
295 // If the resource was created directly, this is NULL. | 298 // If the resource was created directly, this is NULL. |
296 scoped_ptr<IPC::Message> creation_message_; | 299 scoped_ptr<IPC::Message> creation_message_; |
297 }; | 300 }; |
298 | 301 |
299 } // namespace proxy | 302 } // namespace proxy |
300 } // namespace ppapi | 303 } // namespace ppapi |
301 | 304 |
302 #endif // PPAPI_PROXY_RAW_VAR_DATA_H_ | 305 #endif // PPAPI_PROXY_RAW_VAR_DATA_H_ |
OLD | NEW |