Index: third_party/protobuf/src/google/protobuf/arena_test_util.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h b/third_party/protobuf/src/google/protobuf/arena_test_util.h |
similarity index 74% |
copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h |
copy to third_party/protobuf/src/google/protobuf/arena_test_util.h |
index 787706629bd10fc72eb7811d9498f19dd0524d11..690cc706ee5f2d029752fe6f1b323130046938e5 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h |
+++ b/third_party/protobuf/src/google/protobuf/arena_test_util.h |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,31 +28,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: rennie@google.com (Jeffrey Rennie) |
+#ifndef GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ |
+#define GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ |
-#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ |
-#include <string> |
- |
-#include <google/protobuf/stubs/common.h> |
namespace google { |
namespace protobuf { |
-namespace compiler { |
-namespace cpp { |
+namespace internal { |
-// Generator options: |
-struct Options { |
- Options() : safe_boundary_check(false) { |
+class NoHeapChecker { |
+ public: |
+ NoHeapChecker() { |
+ capture_alloc.Hook(); |
} |
- string dllexport_decl; |
- bool safe_boundary_check; |
+ ~NoHeapChecker(); |
+ private: |
+ class NewDeleteCapture { |
+ public: |
+ // TOOD(xiaofeng): Implement this for opensource protobuf. |
+ void Hook() {} |
+ void Unhook() {} |
+ int alloc_count() { return 0; } |
+ int free_count() { return 0; } |
+ } capture_alloc; |
}; |
-} // namespace cpp |
-} // namespace compiler |
+} // namespace internal |
} // namespace protobuf |
- |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ |
+#endif // GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ |