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

Unified Diff: runtime/include/dart_api.h

Issue 2483363002: clang-formats remaining files and adds a presubmit check. (Closed)
Patch Set: Format include file Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/include/dart_mirrors_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
old mode 100755
new mode 100644
index 7aaca7d066c90e3c55912bc5c36b0fd48aba189f..721f5ad8f715fc9976c7cb191895092eff2b8aba
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -54,8 +54,8 @@ typedef unsigned __int64 uint64_t;
#include <stdbool.h>
#if __GNUC__ >= 4
#if defined(DART_SHARED_LIB)
-#define DART_EXPORT DART_EXTERN_C __attribute__ ((visibility("default"))) \
- __attribute((used))
+#define DART_EXPORT \
+ DART_EXTERN_C __attribute__((visibility("default"))) __attribute((used))
#else
#define DART_EXPORT DART_EXTERN_C
#endif
@@ -418,10 +418,10 @@ DART_EXPORT void _Dart_ReportErrorHandle(const char* file,
{ \
Dart_Handle __handle = handle; \
if (Dart_IsError((__handle))) { \
- _Dart_ReportErrorHandle(__FILE__, __LINE__, \
- #handle, Dart_GetError(__handle)); \
+ _Dart_ReportErrorHandle(__FILE__, __LINE__, #handle, \
+ Dart_GetError(__handle)); \
} \
- } \
+ }
/**
* Converts an object to a string.
@@ -467,8 +467,8 @@ DART_EXPORT Dart_Handle Dart_HandleFromPersistent(Dart_PersistentHandle object);
/**
* Allocates a handle in the current scope from a weak persistent handle.
*/
-DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent(
- Dart_WeakPersistentHandle object);
+DART_EXPORT Dart_Handle
+Dart_HandleFromWeakPersistent(Dart_WeakPersistentHandle object);
/**
* Allocates a persistent handle for an object.
@@ -532,11 +532,11 @@ DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object);
* \return The weak persistent handle or NULL. NULL is returned in case of bad
* parameters.
*/
-DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(
- Dart_Handle object,
- void* peer,
- intptr_t external_allocation_size,
- Dart_WeakPersistentHandleFinalizer callback);
+DART_EXPORT Dart_WeakPersistentHandle
+Dart_NewWeakPersistentHandle(Dart_Handle object,
+ void* peer,
+ intptr_t external_allocation_size,
+ Dart_WeakPersistentHandleFinalizer callback);
DART_EXPORT void Dart_DeleteWeakPersistentHandle(
Dart_Isolate isolate,
@@ -582,9 +582,9 @@ typedef void (*Dart_GcEpilogueCallback)();
* \return Success if the callbacks were added. Otherwise, returns an
* error handle.
*/
-DART_EXPORT Dart_Handle Dart_SetGcCallbacks(
- Dart_GcPrologueCallback prologue_callback,
- Dart_GcEpilogueCallback epilogue_callback);
+DART_EXPORT Dart_Handle
+Dart_SetGcCallbacks(Dart_GcPrologueCallback prologue_callback,
+ Dart_GcEpilogueCallback epilogue_callback);
/*
@@ -793,19 +793,19 @@ typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)();
* See Dart_GetVMServiceAssetsArchive.
*/
typedef struct {
- int32_t version;
- const uint8_t* vm_isolate_snapshot;
- const uint8_t* instructions_snapshot;
- const uint8_t* data_snapshot;
- Dart_IsolateCreateCallback create;
- Dart_IsolateShutdownCallback shutdown;
- Dart_ThreadExitCallback thread_exit;
- Dart_FileOpenCallback file_open;
- Dart_FileReadCallback file_read;
- Dart_FileWriteCallback file_write;
- Dart_FileCloseCallback file_close;
- Dart_EntropySource entropy_source;
- Dart_GetVMServiceAssetsArchive get_service_assets;
+ int32_t version;
+ const uint8_t* vm_isolate_snapshot;
+ const uint8_t* instructions_snapshot;
+ const uint8_t* data_snapshot;
+ Dart_IsolateCreateCallback create;
+ Dart_IsolateShutdownCallback shutdown;
+ Dart_ThreadExitCallback thread_exit;
+ Dart_FileOpenCallback file_open;
+ Dart_FileReadCallback file_read;
+ Dart_FileWriteCallback file_write;
+ Dart_FileCloseCallback file_close;
+ Dart_EntropySource entropy_source;
+ Dart_GetVMServiceAssetsArchive get_service_assets;
} Dart_InitializeParams;
/**
@@ -979,11 +979,11 @@ DART_EXPORT void Dart_ExitIsolate();
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_CreateSnapshot(
- uint8_t** vm_isolate_snapshot_buffer,
- intptr_t* vm_isolate_snapshot_size,
- uint8_t** isolate_snapshot_buffer,
- intptr_t* isolate_snapshot_size);
+DART_EXPORT Dart_Handle
+Dart_CreateSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+ intptr_t* vm_isolate_snapshot_size,
+ uint8_t** isolate_snapshot_buffer,
+ intptr_t* isolate_snapshot_size);
/**
* Creates a snapshot of the application script loaded in the isolate.
@@ -1064,7 +1064,7 @@ typedef int64_t Dart_Port;
* ILLEGAL_PORT is a port number guaranteed never to be associated with a valid
* port.
*/
-#define ILLEGAL_PORT ((Dart_Port) 0)
+#define ILLEGAL_PORT ((Dart_Port)0)
/**
* A message notification callback.
@@ -1434,7 +1434,7 @@ DART_EXPORT bool Dart_IsInteger(Dart_Handle object);
DART_EXPORT bool Dart_IsDouble(Dart_Handle object);
DART_EXPORT bool Dart_IsBoolean(Dart_Handle object);
DART_EXPORT bool Dart_IsString(Dart_Handle object);
-DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object); /* (ISO-8859-1) */
+DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object); /* (ISO-8859-1) */
DART_EXPORT bool Dart_IsExternalString(Dart_Handle object);
DART_EXPORT bool Dart_IsList(Dart_Handle object);
DART_EXPORT bool Dart_IsMap(Dart_Handle object);
@@ -1718,11 +1718,11 @@ DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t* utf32_array,
* \return The String object if no error occurs. Otherwise returns
* an error handle.
*/
-DART_EXPORT Dart_Handle Dart_NewExternalLatin1String(
- const uint8_t* latin1_array,
- intptr_t length,
- void* peer,
- Dart_PeerFinalizer cback);
+DART_EXPORT Dart_Handle
+Dart_NewExternalLatin1String(const uint8_t* latin1_array,
+ intptr_t length,
+ void* peer,
+ Dart_PeerFinalizer cback);
/**
* Returns a String which references an external array of UTF-16 encoded
@@ -1840,12 +1840,12 @@ DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t* size);
* result = Dart_MakeExternalString(str, data, size, NULL, NULL);
*
*/
-DART_EXPORT Dart_Handle Dart_MakeExternalString(
- Dart_Handle str,
- void* array,
- intptr_t external_allocation_size,
- void* peer,
- Dart_PeerFinalizer cback);
+DART_EXPORT Dart_Handle
+Dart_MakeExternalString(Dart_Handle str,
+ void* array,
+ intptr_t external_allocation_size,
+ void* peer,
+ Dart_PeerFinalizer cback);
/**
* Retrieves some properties associated with a String.
@@ -1907,8 +1907,7 @@ DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* length);
* \return The Object in the List at the specified index if no error
* occurs. Otherwise returns an error handle.
*/
-DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list,
- intptr_t index);
+DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index);
/**
* Gets a range of Objects from a List.
@@ -2044,8 +2043,8 @@ DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfTypedData(Dart_Handle object);
* \return kInvalid if the object is not an external TypedData object or
* the appropriate Dart_TypedData_Type.
*/
-DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfExternalTypedData(
- Dart_Handle object);
+DART_EXPORT Dart_TypedData_Type
+Dart_GetTypeOfExternalTypedData(Dart_Handle object);
/**
* Returns a TypedData object of the desired length and type.
@@ -2183,10 +2182,10 @@ DART_EXPORT Dart_Handle Dart_Allocate(Dart_Handle type);
* \return The new object. If an error occurs during execution, then an
* error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_AllocateWithNativeFields(
- Dart_Handle type,
- intptr_t num_native_fields,
- const intptr_t* native_fields);
+DART_EXPORT Dart_Handle
+Dart_AllocateWithNativeFields(Dart_Handle type,
+ intptr_t num_native_fields,
+ const intptr_t* native_fields);
/**
* Invokes a method or function.
@@ -2275,8 +2274,7 @@ DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object,
* \return If no error occurs, then the value of the field is
* returned. Otherwise an error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container,
- Dart_Handle name);
+DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name);
/**
* Sets the value of a field.
@@ -2448,7 +2446,7 @@ enum {
#define BITMASK(size) ((1 << size) - 1)
#define DART_NATIVE_ARG_DESCRIPTOR(type, position) \
(((type & BITMASK(kNativeArgTypeSize)) << kNativeArgTypePos) | \
- (position & BITMASK(kNativeArgNumberSize)))
+ (position & BITMASK(kNativeArgNumberSize))) // NOLINT
/**
* Gets the native arguments based on the types passed in and populates
@@ -2471,11 +2469,11 @@ enum {
* returns an error handle if there were any errors while extracting the
* arguments (mismatched number of arguments, incorrect types, etc.).
*/
-DART_EXPORT Dart_Handle Dart_GetNativeArguments(
- Dart_NativeArguments args,
- int num_arguments,
- const Dart_NativeArgument_Descriptor* arg_descriptors,
- Dart_NativeArgument_Value* arg_values);
+DART_EXPORT Dart_Handle
+Dart_GetNativeArguments(Dart_NativeArguments args,
+ int num_arguments,
+ const Dart_NativeArgument_Descriptor* arg_descriptors,
+ Dart_NativeArgument_Value* arg_values);
/**
@@ -2502,11 +2500,11 @@ DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args);
* null object then 0 is copied as the native field values into the
* 'field_values' array.
*/
-DART_EXPORT Dart_Handle Dart_GetNativeFieldsOfArgument(
- Dart_NativeArguments args,
- int arg_index,
- int num_fields,
- intptr_t* field_values);
+DART_EXPORT Dart_Handle
+Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args,
+ int arg_index,
+ int num_fields,
+ intptr_t* field_values);
/**
* Gets the native field of the receiver.
@@ -2659,8 +2657,8 @@ typedef Dart_Handle (*Dart_EnvironmentCallback)(Dart_Handle name);
* the const constructors bool.fromEnvironment, int.fromEnvironment
* and String.fromEnvironment.
*/
-DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(
- Dart_EnvironmentCallback callback);
+DART_EXPORT Dart_Handle
+Dart_SetEnvironmentCallback(Dart_EnvironmentCallback callback);
/**
* Sets the callback used to resolve native functions for a library.
@@ -2670,10 +2668,10 @@ DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(
*
* \return A valid handle if the native resolver was set successfully.
*/
-DART_EXPORT Dart_Handle Dart_SetNativeResolver(
- Dart_Handle library,
- Dart_NativeEntryResolver resolver,
- Dart_NativeEntrySymbol symbol);
+DART_EXPORT Dart_Handle
+Dart_SetNativeResolver(Dart_Handle library,
+ Dart_NativeEntryResolver resolver,
+ Dart_NativeEntrySymbol symbol);
/* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */
@@ -2744,8 +2742,8 @@ typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag,
*
* TODO(turnidge): Document.
*/
-DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(
- Dart_LibraryTagHandler handler);
+DART_EXPORT Dart_Handle
+Dart_SetLibraryTagHandler(Dart_LibraryTagHandler handler);
/**
* Canonicalizes a url with respect to some library.
@@ -3119,9 +3117,8 @@ typedef struct {
* \return An error handle if a compilation error or runtime error running const
* constructors was encountered.
*/
-DART_EXPORT Dart_Handle Dart_Precompile(
- Dart_QualifiedFunctionName entry_points[],
- bool reset_fields);
+DART_EXPORT Dart_Handle
+Dart_Precompile(Dart_QualifiedFunctionName entry_points[], bool reset_fields);
/**
@@ -3143,9 +3140,9 @@ DART_EXPORT Dart_Handle Dart_Precompile(
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
- uint8_t** assembly_buffer,
- intptr_t* assembly_size);
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotAssembly(uint8_t** assembly_buffer,
+ intptr_t* assembly_size);
/**
@@ -3154,15 +3151,15 @@ DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotAssembly(
* load with mmap. The instructions piece must be loaded with read and
* execute permissions; the rodata piece may be loaded as read-only.
*/
-DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshotBlob(
- uint8_t** vm_isolate_snapshot_buffer,
- intptr_t* vm_isolate_snapshot_size,
- uint8_t** isolate_snapshot_buffer,
- intptr_t* isolate_snapshot_size,
- uint8_t** instructions_blob_buffer,
- intptr_t* instructions_blob_size,
- uint8_t** rodata_blob_buffer,
- intptr_t* rodata_blob_size);
+DART_EXPORT Dart_Handle
+Dart_CreatePrecompiledSnapshotBlob(uint8_t** vm_isolate_snapshot_buffer,
+ intptr_t* vm_isolate_snapshot_size,
+ uint8_t** isolate_snapshot_buffer,
+ intptr_t* isolate_snapshot_size,
+ uint8_t** instructions_blob_buffer,
+ intptr_t* instructions_blob_size,
+ uint8_t** rodata_blob_buffer,
+ intptr_t* rodata_blob_size);
DART_EXPORT Dart_Handle Dart_PrecompileJIT();
@@ -3191,15 +3188,15 @@ DART_EXPORT Dart_Handle Dart_PrecompileJIT();
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_CreateAppJITSnapshot(
- uint8_t** vm_isolate_snapshot_buffer,
- intptr_t* vm_isolate_snapshot_size,
- uint8_t** isolate_snapshot_buffer,
- intptr_t* isolate_snapshot_size,
- uint8_t** instructions_blob_buffer,
- intptr_t* instructions_blob_size,
- uint8_t** rodata_blob_buffer,
- intptr_t* rodata_blob_size);
+DART_EXPORT Dart_Handle
+Dart_CreateAppJITSnapshot(uint8_t** vm_isolate_snapshot_buffer,
+ intptr_t* vm_isolate_snapshot_size,
+ uint8_t** isolate_snapshot_buffer,
+ intptr_t* isolate_snapshot_size,
+ uint8_t** instructions_blob_buffer,
+ intptr_t* instructions_blob_size,
+ uint8_t** rodata_blob_buffer,
+ intptr_t* rodata_blob_size);
/**
@@ -3209,4 +3206,4 @@ DART_EXPORT Dart_Handle Dart_CreateAppJITSnapshot(
*/
DART_EXPORT bool Dart_IsPrecompiledRuntime();
-#endif /* INCLUDE_DART_API_H_ */ /* NOLINT */
+#endif /* INCLUDE_DART_API_H_ */ /* NOLINT */
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/include/dart_mirrors_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698