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

Unified Diff: components/font_service/public/cpp/font_loader.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 | « components/font_service/public/cpp/font_loader.h ('k') | components/html_viewer/ax_provider_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/font_service/public/cpp/font_loader.cc
diff --git a/components/font_service/public/cpp/font_loader.cc b/components/font_service/public/cpp/font_loader.cc
index db60de6c682679728888cec7aab950b095786103..8f7718cb76111d7d3746f0b1ff7d828d34fede34 100644
--- a/components/font_service/public/cpp/font_loader.cc
+++ b/components/font_service/public/cpp/font_loader.cc
@@ -9,33 +9,13 @@
#include "base/bind.h"
#include "base/trace_event/trace_event.h"
#include "components/font_service/public/cpp/font_service_thread.h"
-#include "mojo/shell/public/cpp/application_impl.h"
-#include "mojo/shell/public/cpp/connect.h"
-#include "mojo/shell/public/interfaces/shell.mojom.h"
+#include "mojo/shell/public/cpp/shell.h"
namespace font_service {
-namespace {
-void OnGotRemoteIDs(uint32_t instance_id, uint32_t content_handler_id) {}
-} // namespace
-FontLoader::FontLoader(mojo::shell::mojom::Shell* shell) {
- mojo::ServiceProviderPtr font_service_provider;
- mojo::URLRequestPtr request(mojo::URLRequest::New());
- request->url = mojo::String::From("mojo:font_service");
+FontLoader::FontLoader(mojo::Shell* shell) {
FontServicePtr font_service;
- shell->ConnectToApplication(std::move(request),
- GetProxy(&font_service_provider), nullptr,
- mojo::CreatePermissiveCapabilityFilter(),
- base::Bind(&OnGotRemoteIDs));
- mojo::ConnectToService(font_service_provider.get(), &font_service);
-
- thread_ = new internal::FontServiceThread(std::move(font_service));
-}
-
-FontLoader::FontLoader(mojo::ApplicationImpl* application_impl) {
- FontServicePtr font_service;
- application_impl->ConnectToService("mojo:font_service", &font_service);
-
+ shell->ConnectToService("mojo:font_service", &font_service);
thread_ = new internal::FontServiceThread(std::move(font_service));
}
« no previous file with comments | « components/font_service/public/cpp/font_loader.h ('k') | components/html_viewer/ax_provider_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698