Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: third_party/grpc/test/core/util/grpc_profiler.c

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/test/core/util/grpc_profiler.h ('k') | third_party/grpc/test/core/util/parse_hexstring.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/test/core/util/grpc_profiler.c
diff --git a/third_party/WebKit/public/platform/WebTextRun.h b/third_party/grpc/test/core/util/grpc_profiler.c
similarity index 68%
copy from third_party/WebKit/public/platform/WebTextRun.h
copy to third_party/grpc/test/core/util/grpc_profiler.c
index 571294a1288370874c30606f0257a00345d15b69..c2c0c9cf53b0169a37d04c3eb776755eb1b1033c 100644
--- a/third_party/WebKit/public/platform/WebTextRun.h
+++ b/third_party/grpc/test/core/util/grpc_profiler.c
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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
@@ -26,42 +28,33 @@
* 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.
+ *
*/
-#ifndef WebTextRun_h
-#define WebTextRun_h
-
-#include "WebCommon.h"
-#include "WebString.h"
+#include "test/core/util/grpc_profiler.h"
-namespace blink {
+#if GRPC_HAVE_PERFTOOLS
+#include <gperftools/profiler.h>
-class TextRun;
+void grpc_profiler_start(const char *filename) { ProfilerStart(filename); }
-struct WebTextRun {
- WebTextRun(const WebString& t, bool isRTL, bool hasDirectionalOverride)
- : text(t)
- , rtl(isRTL)
- , directionalOverride(hasDirectionalOverride)
- {
- }
- WebTextRun()
- : rtl(false)
- , directionalOverride(false)
- {
- }
-
- WebString text;
- bool rtl;
- bool directionalOverride;
-
-#if INSIDE_BLINK
- // The resulting blink::TextRun will refer to the text in this
- // struct, so "this" must outlive the WebCore text run.
- BLINK_PLATFORM_EXPORT operator TextRun() const;
-#endif
-};
+void grpc_profiler_stop() { ProfilerStop(); }
+#else
+#include <grpc/support/log.h>
-} // namespace blink
+void grpc_profiler_start(const char *filename) {
+ static int printed_warning = 0;
+ if (!printed_warning) {
+ gpr_log(GPR_DEBUG,
+ "You do not have google-perftools installed, profiling is disabled "
+ "[for %s]",
+ filename);
+ gpr_log(GPR_DEBUG,
+ "To install on ubuntu: sudo apt-get install google-perftools "
+ "libgoogle-perftools-dev");
+ printed_warning = 1;
+ }
+}
+void grpc_profiler_stop(void) {}
#endif
« no previous file with comments | « third_party/grpc/test/core/util/grpc_profiler.h ('k') | third_party/grpc/test/core/util/parse_hexstring.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698