ppb_network_proxy_thunk.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // From ppb_network_proxy.idl modified Tue Jun 25 15:45:53 2013.
  5. #include <stdint.h>
  6. #include "base/logging.h"
  7. #include "ppapi/c/pp_completion_callback.h"
  8. #include "ppapi/c/pp_errors.h"
  9. #include "ppapi/c/ppb_network_proxy.h"
  10. #include "ppapi/shared_impl/tracked_callback.h"
  11. #include "ppapi/thunk/enter.h"
  12. #include "ppapi/thunk/ppapi_thunk_export.h"
  13. #include "ppapi/thunk/ppb_network_proxy_api.h"
  14. namespace ppapi {
  15. namespace thunk {
  16. namespace {
  17. int32_t GetProxyForURL(PP_Instance instance,
  18. struct PP_Var url,
  19. struct PP_Var* proxy_string,
  20. struct PP_CompletionCallback callback) {
  21. VLOG(4) << "PPB_NetworkProxy::GetProxyForURL()";
  22. EnterInstanceAPI<PPB_NetworkProxy_API> enter(instance, callback);
  23. if (enter.failed())
  24. return enter.retval();
  25. return enter.SetResult(enter.functions()->GetProxyForURL(
  26. instance, url, proxy_string, enter.callback()));
  27. }
  28. const PPB_NetworkProxy_1_0 g_ppb_networkproxy_thunk_1_0 = {&GetProxyForURL};
  29. } // namespace
  30. PPAPI_THUNK_EXPORT const PPB_NetworkProxy_1_0* GetPPB_NetworkProxy_1_0_Thunk() {
  31. return &g_ppb_networkproxy_thunk_1_0;
  32. }
  33. } // namespace thunk
  34. } // namespace ppapi