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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2475543003: Introduce the image_decoder service (Closed)
Patch Set: . Created 4 years, 1 month 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 | « chrome/utility/chrome_content_utility_client.h ('k') | chrome/utility/image_decoder_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 0c2fc196555375004bc4b6a414d49cb321b1e856..d653678d5a881ff2548f64ade2d6c2ef850ccfa6 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -16,17 +16,19 @@
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer_results.h"
#include "chrome/utility/chrome_content_utility_ipc_whitelist.h"
-#include "chrome/utility/image_decoder_impl.h"
#include "chrome/utility/utility_message_handler.h"
#include "components/safe_json/utility/safe_json_parser_mojo_impl.h"
#include "content/public/child/image_decoder_utils.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/service_info.h"
#include "content/public/utility/utility_thread.h"
#include "courgette/courgette.h"
#include "courgette/third_party/bsdiff/bsdiff.h"
#include "ipc/ipc_channel.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "printing/features/features.h"
+#include "services/image_decoder/image_decoder_service.h"
+#include "services/image_decoder/public/cpp/constants.h"
#include "services/service_manager/public/cpp/interface_registry.h"
#include "third_party/zlib/google/zip.h"
#include "ui/gfx/geometry/size.h"
@@ -100,10 +102,9 @@ void CreateResourceUsageReporter(
}
#endif // !defined(OS_ANDROID)
-void CreateImageDecoder(mojo::InterfaceRequest<mojom::ImageDecoder> request) {
+std::unique_ptr<service_manager::Service> CreateImageDecoderService() {
content::UtilityThread::Get()->EnsureBlinkInitialized();
- mojo::MakeStrongBinding(base::MakeUnique<ImageDecoderImpl>(),
- std::move(request));
+ return image_decoder::ImageDecoderService::Create();
}
} // namespace
@@ -206,7 +207,6 @@ void ChromeContentUtilityClient::ExposeInterfacesToBrowser(
base::Bind(CreateProxyResolverFactory));
registry->AddInterface(base::Bind(CreateResourceUsageReporter));
#endif
- registry->AddInterface(base::Bind(&CreateImageDecoder));
registry->AddInterface(
base::Bind(&safe_json::SafeJsonParserMojoImpl::Create));
#if defined(OS_WIN)
@@ -214,6 +214,13 @@ void ChromeContentUtilityClient::ExposeInterfacesToBrowser(
#endif
}
+void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) {
+ content::ServiceInfo image_decoder_info;
+ image_decoder_info.factory = base::Bind(&CreateImageDecoderService);
+ services->insert(
+ std::make_pair(image_decoder::kServiceName, image_decoder_info));
+}
+
void ChromeContentUtilityClient::AddHandler(
std::unique_ptr<UtilityMessageHandler> handler) {
handlers_.push_back(std::move(handler));
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | chrome/utility/image_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698