OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 g_core_interface->ReleaseResource(graphics); | 97 g_core_interface->ReleaseResource(graphics); |
98 g_core_interface->ReleaseResource(image); | 98 g_core_interface->ReleaseResource(image); |
99 } | 99 } |
100 | 100 |
101 /** Returns the info for the given instance, or NULL if it's not found. */ | 101 /** Returns the info for the given instance, or NULL if it's not found. */ |
102 struct InstanceInfo* FindInstance(PP_Instance instance) { | 102 struct InstanceInfo* FindInstance(PP_Instance instance) { |
103 struct InstanceInfo* cur = all_instances; | 103 struct InstanceInfo* cur = all_instances; |
104 while (cur) { | 104 while (cur) { |
105 if (cur->pp_instance == instance) | 105 if (cur->pp_instance == instance) |
106 return cur; | 106 return cur; |
| 107 cur = cur->next; |
107 } | 108 } |
108 return NULL; | 109 return NULL; |
109 } | 110 } |
110 | 111 |
111 PP_Bool Instance_DidCreate(PP_Instance instance, | 112 PP_Bool Instance_DidCreate(PP_Instance instance, |
112 uint32_t argc, | 113 uint32_t argc, |
113 const char* argn[], | 114 const char* argn[], |
114 const char* argv[]) { | 115 const char* argv[]) { |
115 struct InstanceInfo* info = | 116 struct InstanceInfo* info = |
116 (struct InstanceInfo*)malloc(sizeof(struct InstanceInfo)); | 117 (struct InstanceInfo*)malloc(sizeof(struct InstanceInfo)); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 201 } |
201 | 202 |
202 PP_EXPORT void PPP_ShutdownModule() { | 203 PP_EXPORT void PPP_ShutdownModule() { |
203 } | 204 } |
204 | 205 |
205 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { | 206 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { |
206 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) | 207 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) |
207 return &instance_interface; | 208 return &instance_interface; |
208 return NULL; | 209 return NULL; |
209 } | 210 } |
OLD | NEW |