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

Unified Diff: third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp

Issue 2710823003: NOCOMMIT prototype: GRC service plumbing and process priority
Patch Set: Buildfixes Created 3 years, 9 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
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

Powered by Google App Engine
This is Rietveld 408576698