diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /media/webrtc/trunk/testing/multiprocess_func_list.cc | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/webrtc/trunk/testing/multiprocess_func_list.cc')
-rw-r--r-- | media/webrtc/trunk/testing/multiprocess_func_list.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/media/webrtc/trunk/testing/multiprocess_func_list.cc b/media/webrtc/trunk/testing/multiprocess_func_list.cc new file mode 100644 index 000000000..1e1970483 --- /dev/null +++ b/media/webrtc/trunk/testing/multiprocess_func_list.cc @@ -0,0 +1,43 @@ +// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "multiprocess_func_list.h" + +#include <map> + +// Helper functions to maintain mapping of "test name"->test func. +// The information is accessed via a global map. +namespace multi_process_function_list { + +namespace { + +typedef std::map<std::string, ChildFunctionPtr> MultiProcessTestMap; + +// Retrieve a reference to the global 'func name' -> func ptr map. +MultiProcessTestMap &GetMultiprocessFuncMap() { + static MultiProcessTestMap test_name_to_func_ptr_map; + return test_name_to_func_ptr_map; +} + +} // namespace + +AppendMultiProcessTest::AppendMultiProcessTest(std::string test_name, + ChildFunctionPtr func_ptr) { + GetMultiprocessFuncMap()[test_name] = func_ptr; +} + +int InvokeChildProcessTest(std::string test_name) { + MultiProcessTestMap &func_lookup_table = GetMultiprocessFuncMap(); + MultiProcessTestMap::iterator it = func_lookup_table.find(test_name); + if (it != func_lookup_table.end()) { + ChildFunctionPtr func = it->second; + if (func) { + return (*func)(); + } + } + + return -1; +} + +} // namespace multi_process_function_list |