hbp: Rename and rehouse extension_lock -> internal/message_lock

PiperOrigin-RevId: 665459381
pull/17876/head
Hong Shin 6 months ago committed by Copybara-Service
parent 6a95fad912
commit 0c8c922681
  1. 33
      hpb/BUILD
  2. 2
      hpb/hpb.cc
  3. 43
      hpb/internal/BUILD
  4. 2
      hpb/internal/message_lock.cc
  5. 0
      hpb/internal/message_lock.h
  6. 2
      hpb/internal/message_lock_test.cc
  7. 4
      hpb_generator/tests/BUILD

@ -53,9 +53,9 @@ cc_library(
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//visibility:public"],
deps = [
":extension_lock",
"//hpb:ptr",
"//hpb/internal",
"//hpb/internal:message_lock",
"//hpb/internal:template_help",
"//upb:base",
"//upb:mem",
@ -99,22 +99,6 @@ cc_library(
],
)
cc_library(
name = "extension_lock",
srcs = ["extension_lock.cc"],
hdrs = [
"extension_lock.h",
],
compatible_with = ["//buildenv/target:non_prod"],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//upb:friends"],
deps = [
"//upb:message",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/synchronization",
],
)
# Common support code for C++ generated code.
cc_library(
name = "generated_hpb_support",
@ -166,21 +150,6 @@ cc_test(
],
)
cc_test(
name = "extension_lock_test",
srcs = ["extension_lock_test.cc"],
deps = [
"//hpb",
"//hpb:extension_lock",
"//src/google/protobuf/compiler/hpb/tests:test_model_upb_cc_proto",
"//upb:mem",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/log:absl_check",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "requires",
hdrs = ["requires.h"],

@ -14,7 +14,7 @@
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/hpb/extension_lock.h"
#include "google/protobuf/hpb/internal/message_lock.h"
#include "upb/mem/arena.h"
#include "upb/message/accessors.h"
#include "upb/message/copy.h"

@ -5,6 +5,11 @@
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
load(
"//upb/bazel:build_defs.bzl",
"UPB_DEFAULT_CPPOPTS",
)
# begin:google_only
# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# end:google_only
@ -29,3 +34,41 @@ cc_library(
"//upb:message",
],
)
cc_library(
name = "message_lock",
srcs = ["message_lock.cc"],
hdrs = [
"message_lock.h",
],
compatible_with = ["//buildenv/target:non_prod"],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//upb:friends"],
deps = [
"//upb:mem",
"//upb:message",
"//upb:message_copy",
"//upb:message_promote",
"//upb:mini_table",
"//upb:wire",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/synchronization",
],
)
cc_test(
name = "message_lock_test",
srcs = ["message_lock_test.cc"],
deps = [
"//hpb",
"//hpb/internal:message_lock",
"//src/google/protobuf/compiler/hpb/tests:test_model_upb_cc_proto",
"//upb:mem",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/log:absl_check",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "google/protobuf/hpb/extension_lock.h"
#include "google/protobuf/hpb/internal/message_lock.h"
#include <atomic>

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "google/protobuf/hpb/extension_lock.h"
#include "google/protobuf/hpb/internal/message_lock.h"
#include <atomic>
#include <mutex>

@ -68,7 +68,7 @@
# upb_c_proto_library(
# name = "test_model_upb_proto",
# visibility = [
# "//hpb:__pkg__",
# "//hpb:__subpackages__",
# "//protos:__pkg__",
# ],
# deps = [":test_model_proto"],
@ -77,7 +77,7 @@
# upb_cc_proto_library(
# name = "test_model_upb_cc_proto",
# visibility = [
# "//hpb:__pkg__",
# "//hpb:__subpackages__",
# "//protos:__pkg__",
# ],
# deps = [":test_model_proto"],

Loading…
Cancel
Save