Index: gpu/command_buffer/service/client_service_map.h |
diff --git a/gpu/command_buffer/service/client_service_map.h b/gpu/command_buffer/service/client_service_map.h |
index b28f1f7b48677b6664152e602ea120b2f6daaf7d..904a0951716e8ccd0bf5c3c96f1864b6a10abfd5 100644 |
--- a/gpu/command_buffer/service/client_service_map.h |
+++ b/gpu/command_buffer/service/client_service_map.h |
@@ -54,6 +54,24 @@ class ClientServiceMap { |
return invalid_service_id(); |
} |
+ bool GetClientID(ServiceType service_id, ClientType* client_id) const { |
+ if (service_id == 0) { |
+ if (client_id) { |
+ *client_id = 0; |
+ } |
+ return true; |
+ } |
+ for (auto mapping : client_to_service_) { |
+ if (mapping.second == service_id) { |
+ if (client_id) { |
+ *client_id = mapping.first; |
+ } |
+ return true; |
+ } |
+ } |
+ return false; |
+ } |
+ |
ServiceType invalid_service_id() const { |
return std::numeric_limits<ServiceType>::max(); |
} |