diff --git a/DEPS b/DEPS index c86ef3057c..a5a4289d07 100644 --- a/DEPS +++ b/DEPS @@ -10,16 +10,16 @@ vars = { 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', 'webrtc_git': 'https://webrtc.googlesource.com', - 'chromium_revision': '9df92afb16414bb209f0e3bf5b013ddae68707f5', + 'chromium_revision': '9d565db4c0551c5953aab7d22061065da8c477da', 'boringssl_git': 'https://boringssl.googlesource.com', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. - 'swarming_revision': '281c390193ec8c02e60279f8dac1b86ac52fa4be', + 'swarming_revision': '9a518d097dca20b7b00ce3bdfc5d418ccc79893a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': '5267ef7b4aa6385c0351ae10ce3092828cca4909', + 'boringssl_revision': '6ff2ba80b758025fdb137d9357dcbba0a9c04dbf', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling lss # and whatever else without interference from each other. @@ -27,7 +27,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'fdacd1639e2adc4631fc1d57f68e4d3715cef5ba', + 'catapult_revision': 'f13bae2df0b82e06b4c7cf9b1ccaf5cee89c0c88', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -43,17 +43,17 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Chromium third_party # and whatever else without interference from each other. - 'chromium_third_party_revision': '01aaf419f6fb93c073235564146ab7f04aaa4e62', + 'chromium_third_party_revision': '5e63803713fbc10c991b6d2779e2c5d481d53bfd', } deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - Var('chromium_git') + '/chromium/src/base' + '@' + '6b48dbc0d2049352237d96e164827733276ff0be', + Var('chromium_git') + '/chromium/src/base' + '@' + '4fcbb21d4936cca5357e251663f46752236fe566', 'src/build': - Var('chromium_git') + '/chromium/src/build' + '@' + '169887d089f363d4ee7349c0753521437c7244e3', + Var('chromium_git') + '/chromium/src/build' + '@' + 'f29a733cc2bdb5ad13dfa302e3bc269df14a70b3', 'src/buildtools': - Var('chromium_git') + '/chromium/buildtools.git' + '@' + '6f4dae280c6a542acacd8db281decc5c0b2a9823', + Var('chromium_git') + '/chromium/buildtools.git' + '@' + '5941c1b3df96c1db756a2834343533335c394c4a', # Gradle 4.3-rc4. Used for testing Android Studio project generation for WebRTC. 'src/examples/androidtests/third_party/gradle': { 'url': Var('chromium_git') + '/external/github.com/gradle/gradle.git' + '@' + @@ -61,11 +61,11 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + 'b0428063aa70683e8ccc17098090e51ab09a5e05', + 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + '84fac4e7279e952b3b65dd636a0da25f6c3ed1ea', 'condition': 'checkout_ios', }, 'src/testing': - Var('chromium_git') + '/chromium/src/testing' + '@' + '5951b2830bb7c356e6c7c2524a16efcd211d7286', + Var('chromium_git') + '/chromium/src/testing' + '@' + '04314205f8b75246f9282a0dbaeab20be58c61d6', # This entry is used for chromium third_party rolling into webrtc third_party only. 'src/third_party_chromium': { 'url': Var('chromium_git') + '/chromium/src/third_party' + '@' + Var('chromium_third_party_revision'), @@ -94,7 +94,7 @@ deps = { 'src/third_party/colorama/src': Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8', 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'e09b6845cf720ac429578b209267cb6dd1c901da', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '79d42dfb11746abb523643428926f2e745834d90', 'src/third_party/errorprone/lib': { 'url': Var('chromium_git') + '/chromium/third_party/errorprone.git' + '@' + '980d49e839aa4984015efed34b0134d4b2c9b6d7', 'condition': 'checkout_android', @@ -113,7 +113,7 @@ deps = { 'src/third_party/gtest-parallel': Var('chromium_git') + '/external/github.com/google/gtest-parallel' + '@' + 'cb3514a0858be0f66281d892e2242d1073fd75fe', 'src/third_party/googletest/src': - Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + '9077ec7efe5b652468ab051e93c67589d5cb8f85', + Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'ce468a17c434e4e79724396ee1b51d86bfc8a88b', 'src/third_party/icu': { 'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'f61e46dbee9d539a32551493e3bcc1dea92f83ec', }, @@ -135,9 +135,9 @@ deps = { 'src/third_party/libsrtp': Var('chromium_git') + '/chromium/deps/libsrtp.git' + '@' + 'fc2345089a6b3c5aca9ecd2e1941871a78a13e9c', 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '37a0283b18a12b60e28050ea05682e5a39f0ec9e', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '8648a64c83b5660eae774d5d41f34fc014ba7b4b', 'src/third_party/libyuv': - Var('chromium_git') + '/libyuv/libyuv.git' + '@' + '196e2e72a3190f539d5ad5f32c7b154154324951', + Var('chromium_git') + '/libyuv/libyuv.git' + '@' + '780cdfed4eb271839d68bac9a91ffeae6083db76', 'src/third_party/lss': { 'url': Var('chromium_git') + '/linux-syscall-support.git' + '@' + Var('lss_revision'), 'condition': 'checkout_android or checkout_linux', @@ -185,7 +185,7 @@ deps = { 'src/third_party/yasm/source/patched-yasm': Var('chromium_git') + '/chromium/deps/yasm/patched-yasm.git' + '@' + 'b98114e18d8b9b84586b10d24353ab8616d4c5fc', 'src/tools': - Var('chromium_git') + '/chromium/src/tools' + '@' + 'e61dbb7de4535e8928f7c65cffdfae5ebe1ef470', + Var('chromium_git') + '/chromium/src/tools' + '@' + '59c08146e77c9b27dbaef0703ff144d43a050cd0', 'src/tools/gyp': Var('chromium_git') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb', 'src/tools/swarming_client': diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index ed72e40a25..1de41c34d0 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium @@ -4,7 +4,7 @@ URL: https://github.com/abseil/abseil-cpp License: Apache 2.0 License File: LICENSE Version: 0 -Revision: 92020a042c0cd46979db9f6f0cb32783dc07765e +Revision: e5be80532b5d998813f9db952d2cc5401b1532df Security Critical: yes Description: diff --git a/third_party/abseil-cpp/absl/algorithm/BUILD.gn b/third_party/abseil-cpp/absl/algorithm/BUILD.gn index 94c745fdcc..108313adcb 100644 --- a/third_party/abseil-cpp/absl/algorithm/BUILD.gn +++ b/third_party/abseil-cpp/absl/algorithm/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/base/BUILD.gn b/third_party/abseil-cpp/absl/base/BUILD.gn index b4b12e01b9..6c471b36a5 100644 --- a/third_party/abseil-cpp/absl/base/BUILD.gn +++ b/third_party/abseil-cpp/absl/base/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/container/BUILD.gn b/third_party/abseil-cpp/absl/container/BUILD.gn index f3b8dad796..ff601852f2 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.gn +++ b/third_party/abseil-cpp/absl/container/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/debugging/BUILD.gn b/third_party/abseil-cpp/absl/debugging/BUILD.gn index 18e2f4fe8f..0a8ab1457a 100644 --- a/third_party/abseil-cpp/absl/debugging/BUILD.gn +++ b/third_party/abseil-cpp/absl/debugging/BUILD.gn @@ -2,9 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") +import("//build/config/sanitizers/sanitizers.gni") if (build_with_chromium) { visibility = [ @@ -184,42 +183,42 @@ source_set("leak_check_disable") { ] } -source_set("leak_check_api_enabled_for_testing") { - testonly = true - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - "//build/config/compiler:no_chromium_code", - "//third_party/abseil-cpp:absl_default_cflags_cc", - ] - cflags_cc = [ "-DLEAK_SANITIZER" ] - public_configs = [ "//third_party/abseil-cpp:absl_include_config" ] - sources = [ - "leak_check.cc", - ] - public = [ - "leak_check.h", - ] - visibility = [] - visibility += [ ":*" ] -} - -source_set("leak_check_api_disabled_for_testing") { - testonly = true - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ - "//build/config/compiler:no_chromium_code", - "//third_party/abseil-cpp:absl_default_cflags_cc", - ] - cflags_cc = [ "-ULEAK_SANITIZER" ] - public_configs = [ "//third_party/abseil-cpp:absl_include_config" ] - sources = [ - "leak_check.cc", - ] - public = [ - "leak_check.h", - ] - visibility = [] - visibility += [ ":*" ] +if (is_lsan) { + source_set("leak_check_api_enabled_for_testing") { + testonly = true + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + "//third_party/abseil-cpp:absl_default_cflags_cc", + ] + public_configs = [ "//third_party/abseil-cpp:absl_include_config" ] + sources = [ + "leak_check.cc", + ] + public = [ + "leak_check.h", + ] + visibility = [] + visibility += [ ":*" ] + } +} else { + source_set("leak_check_api_disabled_for_testing") { + testonly = true + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + "//third_party/abseil-cpp:absl_default_cflags_cc", + ] + public_configs = [ "//third_party/abseil-cpp:absl_include_config" ] + sources = [ + "leak_check.cc", + ] + public = [ + "leak_check.h", + ] + visibility = [] + visibility += [ ":*" ] + } } source_set("stack_consumption") { diff --git a/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc b/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc index 261daae932..8434709fac 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc +++ b/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc @@ -46,6 +46,8 @@ void* GetProgramCounter(void* vuc) { #elif defined(__i386__) if (14 < ABSL_ARRAYSIZE(context->uc_mcontext.gregs)) return reinterpret_cast(context->uc_mcontext.gregs[14]); +#elif defined(__mips__) + return reinterpret_cast(context->uc_mcontext.pc); #elif defined(__powerpc64__) return reinterpret_cast(context->uc_mcontext.gp_regs[32]); #elif defined(__powerpc__) diff --git a/third_party/abseil-cpp/absl/memory/BUILD.gn b/third_party/abseil-cpp/absl/memory/BUILD.gn index 13309be4cf..889e877394 100644 --- a/third_party/abseil-cpp/absl/memory/BUILD.gn +++ b/third_party/abseil-cpp/absl/memory/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/meta/BUILD.gn b/third_party/abseil-cpp/absl/meta/BUILD.gn index 79f0f28248..88259514bf 100644 --- a/third_party/abseil-cpp/absl/meta/BUILD.gn +++ b/third_party/abseil-cpp/absl/meta/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/numeric/BUILD.gn b/third_party/abseil-cpp/absl/numeric/BUILD.gn index e56da0a3f6..be3761e4b7 100644 --- a/third_party/abseil-cpp/absl/numeric/BUILD.gn +++ b/third_party/abseil-cpp/absl/numeric/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/strings/BUILD.gn b/third_party/abseil-cpp/absl/strings/BUILD.gn index 2f73f5d8fe..7434eb23cd 100644 --- a/third_party/abseil-cpp/absl/strings/BUILD.gn +++ b/third_party/abseil-cpp/absl/strings/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/synchronization/BUILD.gn b/third_party/abseil-cpp/absl/synchronization/BUILD.gn index eb19f0948c..e00188a08f 100644 --- a/third_party/abseil-cpp/absl/synchronization/BUILD.gn +++ b/third_party/abseil-cpp/absl/synchronization/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/time/BUILD.gn b/third_party/abseil-cpp/absl/time/BUILD.gn index 9f728f4101..1cc3276f8f 100644 --- a/third_party/abseil-cpp/absl/time/BUILD.gn +++ b/third_party/abseil-cpp/absl/time/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.gn b/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.gn index 9270e21f88..2af6d9fe98 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.gn +++ b/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/types/BUILD.gn b/third_party/abseil-cpp/absl/types/BUILD.gn index b05a14aa61..b3d9ebe6de 100644 --- a/third_party/abseil-cpp/absl/types/BUILD.gn +++ b/third_party/abseil-cpp/absl/types/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/abseil-cpp/absl/utility/BUILD.gn b/third_party/abseil-cpp/absl/utility/BUILD.gn index dc1fcc2ef8..f30df7afc8 100644 --- a/third_party/abseil-cpp/absl/utility/BUILD.gn +++ b/third_party/abseil-cpp/absl/utility/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# WARNING: This file is automatically generated. - import("//build_overrides/build.gni") if (build_with_chromium) { diff --git a/third_party/closure_compiler/PRESUBMIT.py b/third_party/closure_compiler/PRESUBMIT.py index 957ea7a6a7..af7a56f6ee 100644 --- a/third_party/closure_compiler/PRESUBMIT.py +++ b/third_party/closure_compiler/PRESUBMIT.py @@ -6,6 +6,6 @@ def PostUploadHook(cl, change, output_api): return output_api.EnsureCQIncludeTrybotsAreAdded( cl, [ - 'master.tryserver.chromium.linux:closure_compilation', + 'luci.chromium.try:closure_compilation', ], 'Automatically added optional Closure bots to run on CQ.') diff --git a/third_party/closure_compiler/compile_js.gni b/third_party/closure_compiler/compile_js.gni index 55e8c91a36..66063bcb38 100644 --- a/third_party/closure_compiler/compile_js.gni +++ b/third_party/closure_compiler/compile_js.gni @@ -69,6 +69,7 @@ template("js_library") { args += [ "--sources" ] + rebase_path(sources, root_build_dir) if (defined(extra_sources)) { args += rebase_path(extra_sources, root_build_dir) + sources += extra_sources } if (defined(deps)) { @@ -83,6 +84,7 @@ template("js_library") { } if (defined(externs_list)) { args += [ "--externs" ] + rebase_path(externs_list, root_build_dir) + sources += externs_list } if (defined(extra_deps)) { if (!defined(deps)) { diff --git a/third_party/closure_compiler/externs/networking_private.js b/third_party/closure_compiler/externs/networking_private.js index 80133913fc..06888780a0 100644 --- a/third_party/closure_compiler/externs/networking_private.js +++ b/third_party/closure_compiler/externs/networking_private.js @@ -189,6 +189,7 @@ chrome.networkingPrivate.ManagedProxySettingsType; /** * @typedef {{ * AccessPointName: string, + * Authentication: (string|undefined), * Language: (string|undefined), * LocalizedName: (string|undefined), * Name: (string|undefined), @@ -202,6 +203,7 @@ chrome.networkingPrivate.APNProperties; /** * @typedef {{ * AccessPointName: !chrome.networkingPrivate.ManagedDOMString, + * Authentication: (!chrome.networkingPrivate.ManagedDOMString|undefined), * Language: (!chrome.networkingPrivate.ManagedDOMString|undefined), * LocalizedName: (!chrome.networkingPrivate.ManagedDOMString|undefined), * Name: (!chrome.networkingPrivate.ManagedDOMString|undefined), diff --git a/third_party/freetype/roll-freetype.sh b/third_party/freetype/roll-freetype.sh index 67a818e276..5e7f927fa2 100755 --- a/third_party/freetype/roll-freetype.sh +++ b/third_party/freetype/roll-freetype.sh @@ -14,7 +14,7 @@ previousrev() { addtrybots() { STEP="add trybots" && OLD_MSG=$(git show -s --format=%B HEAD) && - git commit --amend -m"$OLD_MSG" -m"CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_msan_rel_ng" + git commit --amend -m"$OLD_MSG" -m"CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux_chromium_msan_rel_ng" } addotherprojectbugs() { diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index 2675a35245..2dbdd77326 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium @@ -5,9 +5,9 @@ License: BSD License File: source/libvpx/LICENSE Security Critical: yes -Date: Tuesday June 12 2018 +Date: Saturday June 16 2018 Branch: master -Commit: 37a0283b18a12b60e28050ea05682e5a39f0ec9e +Commit: 8648a64c83b5660eae774d5d41f34fc014ba7b4b Description: Contains the sources used to compile libvpx binaries used by Google Chrome and diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index 9fb2a13abf..91ffdce327 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h @@ -2,7 +2,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 7 #define VERSION_PATCH 0 -#define VERSION_EXTRA "465-g37a0283b1" +#define VERSION_EXTRA "493-g8648a64c8" #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.7.0-465-g37a0283b1" -#define VERSION_STRING " v1.7.0-465-g37a0283b1" +#define VERSION_STRING_NOSP "v1.7.0-493-g8648a64c8" +#define VERSION_STRING " v1.7.0-493-g8648a64c8" diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium index 3a4f72f87c..6fb2195921 100644 --- a/third_party/protobuf/README.chromium +++ b/third_party/protobuf/README.chromium @@ -122,3 +122,7 @@ Description of the patches: - 0020-Add-support-for-libc-on-Windows.patch Cherry-picks upstream https://github.com/google/protobuf/commit/3ba21cd5f + +-- patches/0023-php_generator.patch + + Cherry-picks upstream https://github.com/google/protobuf/commit/662e8b20 diff --git a/third_party/protobuf/patches/0023-php_generator.patch b/third_party/protobuf/patches/0023-php_generator.patch new file mode 100644 index 0000000000..6dc5b56fe9 --- /dev/null +++ b/third_party/protobuf/patches/0023-php_generator.patch @@ -0,0 +1,87 @@ +diff --git a/src/google/protobuf/compiler/php/php_generator.cc b/src/google/protobuf/compiler/php/php_generator.cc +index 60e6fce99d09..bf0fa95be7be 100644 +--- a/src/google/protobuf/compiler/php/php_generator.cc ++++ b/src/google/protobuf/compiler/php/php_generator.cc +@@ -165,19 +165,12 @@ std::string NamespacedName(const string& classname, + + template + std::string FullClassName(const DescriptorType* desc, bool is_descriptor) { +- string classname = desc->name(); +- const Descriptor* containing = desc->containing_type(); +- while (containing != NULL) { +- classname = containing->name() + '_' + classname; +- containing = containing->containing_type(); +- } +- classname = ClassNamePrefix(classname, desc) + classname; ++ string classname = GeneratedClassName(desc); + return NamespacedName(classname, desc, is_descriptor); + } + + std::string FullClassName(const ServiceDescriptor* desc, bool is_descriptor) { +- string classname = desc->name(); +- classname = ClassNamePrefix(classname, desc) + classname; ++ string classname = GeneratedClassName(desc); + return NamespacedName(classname, desc, is_descriptor); + } + +@@ -1369,6 +1362,31 @@ bool Generator::Generate(const FileDescriptor* file, const string& parameter, + return true; + } + ++std::string GeneratedClassName(const Descriptor* desc) { ++ std::string classname = desc->name(); ++ const Descriptor* containing = desc->containing_type(); ++ while (containing != NULL) { ++ classname = containing->name() + '_' + classname; ++ containing = containing->containing_type(); ++ } ++ return ClassNamePrefix(classname, desc) + classname; ++} ++ ++std::string GeneratedClassName(const EnumDescriptor* desc) { ++ std::string classname = desc->name(); ++ const Descriptor* containing = desc->containing_type(); ++ while (containing != NULL) { ++ classname = containing->name() + '_' + classname; ++ containing = containing->containing_type(); ++ } ++ return ClassNamePrefix(classname, desc) + classname; ++} ++ ++std::string GeneratedClassName(const ServiceDescriptor* desc) { ++ std::string classname = desc->name(); ++ return ClassNamePrefix(classname, desc) + classname; ++} ++ + } // namespace php + } // namespace compiler + } // namespace protobuf +diff --git a/src/google/protobuf/compiler/php/php_generator.h b/src/google/protobuf/compiler/php/php_generator.h +index ce2b000adb1a..67e70bc7b544 100644 +--- a/src/google/protobuf/compiler/php/php_generator.h ++++ b/src/google/protobuf/compiler/php/php_generator.h +@@ -32,6 +32,7 @@ + #define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ + + #include ++#include + + #include + +@@ -47,8 +48,16 @@ class LIBPROTOC_EXPORT Generator + const string& parameter, + GeneratorContext* generator_context, + string* error) const; ++ + }; + ++// To skip reserved keywords in php, some generated classname are prefixed. ++// Other code generators may need following API to figure out the actual ++// classname. ++std::string GeneratedClassName(const google::protobuf::Descriptor* desc); ++std::string GeneratedClassName(const google::protobuf::EnumDescriptor* desc); ++std::string GeneratedClassName(const google::protobuf::ServiceDescriptor* desc); ++ + } // namespace php + } // namespace compiler + } // namespace protobuf diff --git a/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc b/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc index 60e6fce99d..bf0fa95be7 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc @@ -165,19 +165,12 @@ std::string NamespacedName(const string& classname, template std::string FullClassName(const DescriptorType* desc, bool is_descriptor) { - string classname = desc->name(); - const Descriptor* containing = desc->containing_type(); - while (containing != NULL) { - classname = containing->name() + '_' + classname; - containing = containing->containing_type(); - } - classname = ClassNamePrefix(classname, desc) + classname; + string classname = GeneratedClassName(desc); return NamespacedName(classname, desc, is_descriptor); } std::string FullClassName(const ServiceDescriptor* desc, bool is_descriptor) { - string classname = desc->name(); - classname = ClassNamePrefix(classname, desc) + classname; + string classname = GeneratedClassName(desc); return NamespacedName(classname, desc, is_descriptor); } @@ -1369,6 +1362,31 @@ bool Generator::Generate(const FileDescriptor* file, const string& parameter, return true; } +std::string GeneratedClassName(const Descriptor* desc) { + std::string classname = desc->name(); + const Descriptor* containing = desc->containing_type(); + while (containing != NULL) { + classname = containing->name() + '_' + classname; + containing = containing->containing_type(); + } + return ClassNamePrefix(classname, desc) + classname; +} + +std::string GeneratedClassName(const EnumDescriptor* desc) { + std::string classname = desc->name(); + const Descriptor* containing = desc->containing_type(); + while (containing != NULL) { + classname = containing->name() + '_' + classname; + containing = containing->containing_type(); + } + return ClassNamePrefix(classname, desc) + classname; +} + +std::string GeneratedClassName(const ServiceDescriptor* desc) { + std::string classname = desc->name(); + return ClassNamePrefix(classname, desc) + classname; +} + } // namespace php } // namespace compiler } // namespace protobuf diff --git a/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.h b/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.h index ce2b000adb..67e70bc7b5 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.h +++ b/third_party/protobuf/src/google/protobuf/compiler/php/php_generator.h @@ -32,6 +32,7 @@ #define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ #include +#include #include @@ -47,8 +48,16 @@ class LIBPROTOC_EXPORT Generator const string& parameter, GeneratorContext* generator_context, string* error) const; + }; +// To skip reserved keywords in php, some generated classname are prefixed. +// Other code generators may need following API to figure out the actual +// classname. +std::string GeneratedClassName(const google::protobuf::Descriptor* desc); +std::string GeneratedClassName(const google::protobuf::EnumDescriptor* desc); +std::string GeneratedClassName(const google::protobuf::ServiceDescriptor* desc); + } // namespace php } // namespace compiler } // namespace protobuf