OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 // A collection of debugging related interfaces. | 7 // A collection of debugging related interfaces. |
8 | 8 |
9 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ | 9 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ |
10 #define COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ | 10 #define COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include "components/nacl/renderer/ppb_nacl_private.h" | 14 #include "components/nacl/renderer/ppb_nacl_private.h" |
15 #include "native_client/src/shared/platform/nacl_threads.h" | 15 #include "native_client/src/shared/platform/nacl_threads.h" |
16 #include "native_client/src/shared/platform/nacl_time.h" | 16 #include "native_client/src/shared/platform/nacl_time.h" |
17 #include "ppapi/c/private/pp_file_handle.h" | |
18 | 17 |
19 #define SRPC_PLUGIN_DEBUG 1 | 18 #define SRPC_PLUGIN_DEBUG 1 |
20 | 19 |
21 namespace plugin { | 20 namespace plugin { |
22 | 21 |
23 const PPB_NaCl_Private* GetNaClInterface(); | 22 const PPB_NaCl_Private* GetNaClInterface(); |
24 void SetNaClInterface(const PPB_NaCl_Private* nacl_interface); | 23 void SetNaClInterface(const PPB_NaCl_Private* nacl_interface); |
25 | 24 |
26 void CloseFileHandle(PP_FileHandle file_handle); | |
27 | |
28 // Debugging print utility | 25 // Debugging print utility |
29 extern int gNaClPluginDebugPrintEnabled; | 26 extern int gNaClPluginDebugPrintEnabled; |
30 extern int NaClPluginPrintLog(const char *format, ...); | 27 extern int NaClPluginPrintLog(const char *format, ...); |
31 extern int NaClPluginDebugPrintCheckEnv(); | 28 extern int NaClPluginDebugPrintCheckEnv(); |
32 #if SRPC_PLUGIN_DEBUG | 29 #if SRPC_PLUGIN_DEBUG |
33 #define INIT_PLUGIN_LOGGING() do { \ | 30 #define INIT_PLUGIN_LOGGING() do { \ |
34 if (-1 == ::plugin::gNaClPluginDebugPrintEnabled) { \ | 31 if (-1 == ::plugin::gNaClPluginDebugPrintEnabled) { \ |
35 ::plugin::gNaClPluginDebugPrintEnabled = \ | 32 ::plugin::gNaClPluginDebugPrintEnabled = \ |
36 ::plugin::NaClPluginDebugPrintCheckEnv(); \ | 33 ::plugin::NaClPluginDebugPrintCheckEnv(); \ |
37 } \ | 34 } \ |
(...skipping 19 matching lines...) Expand all Loading... |
57 } while (0) | 54 } while (0) |
58 #else | 55 #else |
59 # define PLUGIN_PRINTF(args) do { if (0) { printf args; } } while (0) | 56 # define PLUGIN_PRINTF(args) do { if (0) { printf args; } } while (0) |
60 # define MODULE_PRINTF(args) do { if (0) { printf args; } } while (0) | 57 # define MODULE_PRINTF(args) do { if (0) { printf args; } } while (0) |
61 /* allows DCE but compiler can still do format string checks */ | 58 /* allows DCE but compiler can still do format string checks */ |
62 #endif | 59 #endif |
63 | 60 |
64 } // namespace plugin | 61 } // namespace plugin |
65 | 62 |
66 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ | 63 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_UTILITY_H_ |
OLD | NEW |