Index: third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp |
diff --git a/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp b/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7f8dfb44304a425470ced4f5456005fcbc82821a |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp |
@@ -0,0 +1,42 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "platform/instrumentation/resource_coordinator/FrameResourceCoordinator.h" |
+ |
+#include "public/platform/InterfaceProvider.h" |
+#include "public/platform/Platform.h" |
+#include "services/resource_coordinator/public/interfaces/coordination_unit_provider.mojom-blink.h" |
+ |
+namespace blink { |
+ |
+namespace { |
+ |
+void onConnectionError() {} |
+ |
+} // namespace |
+ |
+FrameResourceCoordinator* FrameResourceCoordinator::create( |
+ InterfaceProvider* interfaceProvider) { |
+ return new FrameResourceCoordinator(interfaceProvider); |
+} |
+ |
+FrameResourceCoordinator::FrameResourceCoordinator( |
+ InterfaceProvider* interfaceProvider) { |
+ interfaceProvider->getInterface(mojo::MakeRequest(&m_service)); |
+ |
+ m_service.set_connection_error_handler( |
+ convertToBaseCallback(WTF::bind(&onConnectionError))); |
+ |
+ resource_coordinator::mojom::blink::EventPtr event = |
+ resource_coordinator::mojom::blink::Event::New(); |
+ event->type = |
+ resource_coordinator::mojom::blink::EventType::ON_RENDERER_FRAME_CREATED; |
+ m_service->SendEvent(std::move(event)); |
+} |
+ |
+FrameResourceCoordinator::~FrameResourceCoordinator() = default; |
+ |
+DEFINE_TRACE(FrameResourceCoordinator) {} |
+ |
+} // namespace blink |