Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: src/trusted/plugin/utility.h

Issue 7799028: Remove src/trusted/plugin (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: fix gyp file for necessary -I Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/plugin/string_encoding_test.cc ('k') | src/trusted/plugin/utility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 // A collection of debugging related interfaces.
8
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_UTILITY_H_
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_UTILITY_H_
11
12 #include "native_client/src/include/nacl_macros.h"
13 #include "native_client/src/include/portability.h"
14 #include "native_client/src/shared/platform/nacl_threads.h"
15
16 #define SRPC_PLUGIN_DEBUG 1
17
18 namespace plugin {
19
20 // Tests that a string is a valid JavaScript identifier. According to the
21 // ECMAScript spec, this should be done in terms of unicode character
22 // categories. For now, we are simply limiting identifiers to the ASCII
23 // subset of that spec. If successful, it returns the length of the
24 // identifier in the location pointed to by length (if it is not NULL).
25 // TODO(sehr): add Unicode identifier support.
26 bool IsValidIdentifierString(const char* strval, uint32_t* length);
27
28 // Debugging print utility
29 extern int gNaClPluginDebugPrintEnabled;
30 extern FILE* gNaClPluginLogFile;
31 extern int NaClPluginPrintLog(const char *format, ...);
32 extern int NaClPluginDebugPrintCheckEnv();
33 extern FILE* NaClPluginLogFileEnv();
34 #if SRPC_PLUGIN_DEBUG
35 # define PLUGIN_PRINTF(args) do { \
36 if (-1 == ::plugin::gNaClPluginDebugPrintEnabled) { \
37 ::plugin::gNaClPluginDebugPrintEnabled = \
38 ::plugin::NaClPluginDebugPrintCheckEnv(); \
39 ::plugin::gNaClPluginLogFile = ::plugin::NaClPluginLogFileEnv();\
40 } \
41 if (0 != ::plugin::gNaClPluginDebugPrintEnabled) { \
42 ::plugin::NaClPluginPrintLog("%08"NACL_PRIx32": ", \
43 NaClThreadId()); \
44 ::plugin::NaClPluginPrintLog args; \
45 } \
46 } while (0)
47 #else
48 # define PLUGIN_PRINTF(args) do { if (0) { printf args; } } while (0)
49 /* allows DCE but compiler can still do format string checks */
50 #endif
51
52 } // namespace plugin
53
54 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_UTILITY_H_
OLDNEW
« no previous file with comments | « src/trusted/plugin/string_encoding_test.cc ('k') | src/trusted/plugin/utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698