Index: third_party/grpc/src/core/census/grpc_context.c |
diff --git a/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.cpp b/third_party/grpc/src/core/census/grpc_context.c |
similarity index 68% |
copy from third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.cpp |
copy to third_party/grpc/src/core/census/grpc_context.c |
index e2a03397c2b4d1f58be71cf0e16fadc0711b6a03..4b61382a2c2fd0abbda851379fa9c5ceff12b96d 100644 |
--- a/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.cpp |
+++ b/third_party/grpc/src/core/census/grpc_context.c |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2013 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,28 +28,26 @@ |
* 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. |
+ * |
*/ |
-#include "modules/mediasource/HTMLVideoElementMediaSource.h" |
- |
-#include "core/html/HTMLVideoElement.h" |
-#include "modules/mediasource/VideoPlaybackQuality.h" |
+#include <grpc/census.h> |
+#include <grpc/grpc.h> |
+#include "src/core/surface/api_trace.h" |
+#include "src/core/surface/call.h" |
-namespace blink { |
- |
-VideoPlaybackQuality* HTMLVideoElementMediaSource::getVideoPlaybackQuality(HTMLVideoElement& videoElement) |
-{ |
- unsigned total = 0; |
- unsigned dropped = 0; |
- unsigned corrupted = 0; |
- WebMediaPlayer* webMediaPlayer = videoElement.webMediaPlayer(); |
- if (webMediaPlayer) { |
- total = webMediaPlayer->decodedFrameCount(); |
- dropped = webMediaPlayer->droppedFrameCount(); |
- corrupted = webMediaPlayer->corruptedFrameCount(); |
- } |
- |
- return VideoPlaybackQuality::create(videoElement.document(), total, dropped, corrupted); |
+void grpc_census_call_set_context(grpc_call *call, census_context *context) { |
+ GRPC_API_TRACE("grpc_census_call_set_context(call=%p, census_context=%p)", 2, |
+ (call, context)); |
+ if (census_enabled() == CENSUS_FEATURE_NONE) { |
+ return; |
+ } |
+ if (context != NULL) { |
+ grpc_call_context_set(call, GRPC_CONTEXT_TRACING, context, NULL); |
+ } |
} |
-} // namespace blink |
+census_context *grpc_census_call_get_context(grpc_call *call) { |
+ GRPC_API_TRACE("grpc_census_call_get_context(call=%p)", 1, (call)); |
+ return (census_context *)grpc_call_context_get(call, GRPC_CONTEXT_TRACING); |
+} |