Index: third_party/grpc/src/core/security/credentials_win32.c |
diff --git a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h b/third_party/grpc/src/core/security/credentials_win32.c |
similarity index 65% |
copy from third_party/tcmalloc/vendor/src/base/synchronization_profiling.h |
copy to third_party/grpc/src/core/security/credentials_win32.c |
index cf02c218a111806189f71f7b528a83b5ceb164a4..8ee9f706a1f2d90d02cd111f5cdd9bd17824e69a 100644 |
--- a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h |
+++ b/third_party/grpc/src/core/security/credentials_win32.c |
@@ -1,4 +1,6 @@ |
-/* Copyright (c) 2010, Google Inc. |
+/* |
+ * |
+ * Copyright 2015, Google Inc. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
@@ -27,24 +29,33 @@ |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* |
- * --- |
- * Author: Chris Ruemmler |
*/ |
-#ifndef BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_ |
-#define BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_ |
+#include <grpc/support/port_platform.h> |
+ |
+#ifdef GPR_WIN32 |
-#include "base/basictypes.h" |
+#include "src/core/security/credentials.h" |
-namespace base { |
+#include <grpc/support/alloc.h> |
+#include <grpc/support/log.h> |
+#include <grpc/support/string_util.h> |
-// We can do contention-profiling of SpinLocks, but the code is in |
-// mutex.cc, which is not always linked in with spinlock. Hence we |
-// provide a weak definition, which are used if mutex.cc isn't linked in. |
+#include "src/core/support/env.h" |
+#include "src/core/support/string.h" |
-// Submit the number of cycles the spinlock spent contending. |
-ATTRIBUTE_WEAK extern void SubmitSpinLockProfileData(const void *, int64); |
-extern void SubmitSpinLockProfileData(const void *contendedlock, |
- int64 wait_cycles) {} |
+char *grpc_get_well_known_google_credentials_file_path_impl(void) { |
+ char *result = NULL; |
+ char *appdata_path = gpr_getenv("APPDATA"); |
+ if (appdata_path == NULL) { |
+ gpr_log(GPR_ERROR, "Could not get APPDATA environment variable."); |
+ return NULL; |
+ } |
+ gpr_asprintf(&result, "%s/%s/%s", appdata_path, |
+ GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY, |
+ GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE); |
+ gpr_free(appdata_path); |
+ return result; |
} |
-#endif // BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_ |
+ |
+#endif /* GPR_WIN32 */ |