From 937dba3ea1039abdd27295f1312c658b9e348cd3 Mon Sep 17 00:00:00 2001
From: Muxi Yan <mxyan@google.com>
Date: Tue, 9 May 2017 14:45:44 -0700
Subject: [PATCH] Put workaround list somewhere accessable by wrapping
 languages

---
 CMakeLists.txt                                |  1 +
 Makefile                                      |  1 +
 build.yaml                                    |  1 +
 gRPC-Core.podspec                             |  1 +
 grpc.gemspec                                  |  1 +
 include/grpc/support/workaround_list.h        | 37 +++++++++++++++++++
 package.xml                                   |  1 +
 .../filters/workarounds/workaround_utils.h    |  8 ++--
 .../core/surface/public_headers_must_be_c89.c |  1 +
 third_party/protobuf                          |  2 +-
 tools/doxygen/Doxyfile.core                   |  3 +-
 tools/doxygen/Doxyfile.core.internal          |  1 +
 .../generated/sources_and_headers.json        |  2 +
 vsprojects/vcxproj/gpr/gpr.vcxproj            |  1 +
 vsprojects/vcxproj/gpr/gpr.vcxproj.filters    |  3 ++
 15 files changed, 57 insertions(+), 7 deletions(-)
 create mode 100644 include/grpc/support/workaround_list.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e300bb67b4d..a9954ed6b01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -849,6 +849,7 @@ foreach(_hdr
   include/grpc/support/tls_msvc.h
   include/grpc/support/tls_pthread.h
   include/grpc/support/useful.h
+  include/grpc/support/workaround_list.h
   include/grpc/impl/codegen/atm.h
   include/grpc/impl/codegen/atm_gcc_atomic.h
   include/grpc/impl/codegen/atm_gcc_sync.h
diff --git a/Makefile b/Makefile
index f140df41cf2..5038f331be7 100644
--- a/Makefile
+++ b/Makefile
@@ -2829,6 +2829,7 @@ PUBLIC_HEADERS_C += \
     include/grpc/support/tls_msvc.h \
     include/grpc/support/tls_pthread.h \
     include/grpc/support/useful.h \
+    include/grpc/support/workaround_list.h \
     include/grpc/impl/codegen/atm.h \
     include/grpc/impl/codegen/atm_gcc_atomic.h \
     include/grpc/impl/codegen/atm_gcc_sync.h \
diff --git a/build.yaml b/build.yaml
index 2e80dd7cd8d..bf980e65cdf 100644
--- a/build.yaml
+++ b/build.yaml
@@ -83,6 +83,7 @@ filegroups:
   - include/grpc/support/tls_msvc.h
   - include/grpc/support/tls_pthread.h
   - include/grpc/support/useful.h
+  - include/grpc/support/workaround_list.h
   headers:
   - src/core/lib/profiling/timers.h
   - src/core/lib/support/arena.h
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 6b92646d93c..0c382477147 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -145,6 +145,7 @@ Pod::Spec.new do |s|
                       'include/grpc/support/tls_msvc.h',
                       'include/grpc/support/tls_pthread.h',
                       'include/grpc/support/useful.h',
+                      'include/grpc/support/workaround_list.h',
                       'include/grpc/impl/codegen/atm.h',
                       'include/grpc/impl/codegen/atm_gcc_atomic.h',
                       'include/grpc/impl/codegen/atm_gcc_sync.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index d098b8ae24f..a0244e01629 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -69,6 +69,7 @@ Gem::Specification.new do |s|
   s.files += %w( include/grpc/support/tls_msvc.h )
   s.files += %w( include/grpc/support/tls_pthread.h )
   s.files += %w( include/grpc/support/useful.h )
+  s.files += %w( include/grpc/support/workaround_list.h )
   s.files += %w( include/grpc/impl/codegen/atm.h )
   s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
   s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
diff --git a/include/grpc/support/workaround_list.h b/include/grpc/support/workaround_list.h
new file mode 100644
index 00000000000..3e3b4847e29
--- /dev/null
+++ b/include/grpc/support/workaround_list.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+typedef enum {
+  GRPC_WORKAROUND_ID_CRONET_COMPRESSION = 0,
+  GRPC_MAX_WORKAROUND_ID
+} grpc_workaround_list;
diff --git a/package.xml b/package.xml
index c7896fdc913..d6e25d49063 100644
--- a/package.xml
+++ b/package.xml
@@ -78,6 +78,7 @@
     <file baseinstalldir="/" name="include/grpc/support/tls_msvc.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/tls_pthread.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/support/useful.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/workaround_list.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/impl/codegen/atm.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
     <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
diff --git a/src/core/ext/filters/workarounds/workaround_utils.h b/src/core/ext/filters/workarounds/workaround_utils.h
index e563f07632d..19528ab1654 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.h
+++ b/src/core/ext/filters/workarounds/workaround_utils.h
@@ -32,14 +32,12 @@
 #ifndef GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H
 #define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H
 
+#include <grpc/support/workaround_list.h>
+
 #include "src/core/lib/transport/metadata.h"
 
 #define GRPC_WORKAROUND_PRIORITY_HIGH 10001
-
-typedef enum {
-  GRPC_WORKAROUND_ID_CRONET_COMPRESSION = 0,
-  GRPC_MAX_WORKAROUND_ID,
-} grpc_workaround_list;
+#define GRPC_WORKAROUND_PROIRITY_LOW 9999
 
 typedef struct grpc_workaround_user_agent_md {
   bool workaround_active[GRPC_MAX_WORKAROUND_ID];
diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c
index 330da468490..aa4769c490c 100644
--- a/test/core/surface/public_headers_must_be_c89.c
+++ b/test/core/surface/public_headers_must_be_c89.c
@@ -73,5 +73,6 @@
 #include <grpc/support/time.h>
 #include <grpc/support/tls.h>
 #include <grpc/support/useful.h>
+#include <grpc/support/workaround_list.h>
 
 int main(int argc, char **argv) { return 0; }
diff --git a/third_party/protobuf b/third_party/protobuf
index 593e917c176..a6189acd18b 160000
--- a/third_party/protobuf
+++ b/third_party/protobuf
@@ -1 +1 @@
-Subproject commit 593e917c176b5bc5aafa57bf9f6030d749d91cd5
+Subproject commit a6189acd18b00611c1dc7042299ad75486f08a1a
diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core
index c3bfc6c4a8e..d0fd82d1a3b 100644
--- a/tools/doxygen/Doxyfile.core
+++ b/tools/doxygen/Doxyfile.core
@@ -860,7 +860,8 @@ include/grpc/support/tls.h \
 include/grpc/support/tls_gcc.h \
 include/grpc/support/tls_msvc.h \
 include/grpc/support/tls_pthread.h \
-include/grpc/support/useful.h
+include/grpc/support/useful.h \
+include/grpc/support/workaround_list.h
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index be341c3e62f..946953c00c3 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -861,6 +861,7 @@ include/grpc/support/tls_gcc.h \
 include/grpc/support/tls_msvc.h \
 include/grpc/support/tls_pthread.h \
 include/grpc/support/useful.h \
+include/grpc/support/workaround_list.h \
 src/core/README.md \
 src/core/ext/README.md \
 src/core/ext/census/README.md \
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index bfdd32522ed..15268777d60 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -7603,6 +7603,7 @@
       "include/grpc/support/tls_msvc.h", 
       "include/grpc/support/tls_pthread.h", 
       "include/grpc/support/useful.h", 
+      "include/grpc/support/workaround_list.h", 
       "src/core/lib/profiling/timers.h", 
       "src/core/lib/support/arena.h", 
       "src/core/lib/support/atomic.h", 
@@ -7652,6 +7653,7 @@
       "include/grpc/support/tls_msvc.h", 
       "include/grpc/support/tls_pthread.h", 
       "include/grpc/support/useful.h", 
+      "include/grpc/support/workaround_list.h", 
       "src/core/lib/profiling/basic_timers.c", 
       "src/core/lib/profiling/stap_timers.c", 
       "src/core/lib/profiling/timers.h", 
diff --git a/vsprojects/vcxproj/gpr/gpr.vcxproj b/vsprojects/vcxproj/gpr/gpr.vcxproj
index 7fb81a7fbca..1bc4a2363ba 100644
--- a/vsprojects/vcxproj/gpr/gpr.vcxproj
+++ b/vsprojects/vcxproj/gpr/gpr.vcxproj
@@ -173,6 +173,7 @@
     <ClInclude Include="$(SolutionDir)\..\include\grpc\support\tls_msvc.h" />
     <ClInclude Include="$(SolutionDir)\..\include\grpc\support\tls_pthread.h" />
     <ClInclude Include="$(SolutionDir)\..\include\grpc\support\useful.h" />
+    <ClInclude Include="$(SolutionDir)\..\include\grpc\support\workaround_list.h" />
     <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h" />
     <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_atomic.h" />
     <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_sync.h" />
diff --git a/vsprojects/vcxproj/gpr/gpr.vcxproj.filters b/vsprojects/vcxproj/gpr/gpr.vcxproj.filters
index 27d9d2f38f4..4eae1350668 100644
--- a/vsprojects/vcxproj/gpr/gpr.vcxproj.filters
+++ b/vsprojects/vcxproj/gpr/gpr.vcxproj.filters
@@ -219,6 +219,9 @@
     <ClInclude Include="$(SolutionDir)\..\include\grpc\support\useful.h">
       <Filter>include\grpc\support</Filter>
     </ClInclude>
+    <ClInclude Include="$(SolutionDir)\..\include\grpc\support\workaround_list.h">
+      <Filter>include\grpc\support</Filter>
+    </ClInclude>
     <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h">
       <Filter>include\grpc\impl\codegen</Filter>
     </ClInclude>