| 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
|
|
|