OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "remoting/client/plugin/pepper_entrypoints.h" | 5 #include "remoting/client/plugin/pepper_entrypoints.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // Implementation of Global PPP functions --------------------------------- | 35 // Implementation of Global PPP functions --------------------------------- |
36 int32_t PPP_InitializeModule(PP_Module module_id, | 36 int32_t PPP_InitializeModule(PP_Module module_id, |
37 PPB_GetInterface get_browser_interface) { | 37 PPB_GetInterface get_browser_interface) { |
38 ChromotingModule* module = new ChromotingModule(); | 38 ChromotingModule* module = new ChromotingModule(); |
39 if (!module->InternalInit(module_id, get_browser_interface)) { | 39 if (!module->InternalInit(module_id, get_browser_interface)) { |
40 delete module; | 40 delete module; |
41 return PP_ERROR_FAILED; | 41 return PP_ERROR_FAILED; |
42 } | 42 } |
43 | 43 |
44 // Register a global log handler. | 44 #if !defined(NDEBUG) |
| 45 // Register a global log handler, but only in Debug builds. |
45 ChromotingInstance::RegisterLogMessageHandler(); | 46 ChromotingInstance::RegisterLogMessageHandler(); |
| 47 #endif |
46 | 48 |
47 g_module_singleton = module; | 49 g_module_singleton = module; |
48 return PP_OK; | 50 return PP_OK; |
49 } | 51 } |
50 | 52 |
51 void PPP_ShutdownModule() { | 53 void PPP_ShutdownModule() { |
52 delete pp::Module::Get(); | 54 delete pp::Module::Get(); |
53 g_module_singleton = NULL; | 55 g_module_singleton = NULL; |
54 } | 56 } |
55 | 57 |
56 const void* PPP_GetInterface(const char* interface_name) { | 58 const void* PPP_GetInterface(const char* interface_name) { |
57 if (!pp::Module::Get()) | 59 if (!pp::Module::Get()) |
58 return NULL; | 60 return NULL; |
59 return pp::Module::Get()->GetPluginInterface(interface_name); | 61 return pp::Module::Get()->GetPluginInterface(interface_name); |
60 } | 62 } |
61 | 63 |
62 const void* PPP_GetBrowserInterface(const char* interface_name) { | 64 const void* PPP_GetBrowserInterface(const char* interface_name) { |
63 if (!pp::Module::Get()) | 65 if (!pp::Module::Get()) |
64 return NULL; | 66 return NULL; |
65 return pp::Module::Get()->GetBrowserInterface(interface_name); | 67 return pp::Module::Get()->GetBrowserInterface(interface_name); |
66 } | 68 } |
67 | 69 |
68 } // namespace remoting | 70 } // namespace remoting |
OLD | NEW |