Commit b74eff81 authored by erg's avatar erg Committed by Commit bot

core_services: Move resource_provider to core_services.

This moves the resource provider into the main core service process,
too, eliminating one of the processes.

BUG=477435

Review URL: https://codereview.chromium.org/1137223002

Cr-Commit-Position: refs/heads/master@{#329706}
parent fcd926a5
......@@ -186,10 +186,7 @@ mojo_application_package("html_viewer") {
"//third_party/icu:icudata",
"//ui/resources:ui_test_pak",
]
data_deps = [
"//mojo/services/network:network",
"//components/resource_provider",
]
data_deps = [ "//mojo/services/network:network" ]
resources = [
"$root_out_dir/icudtl.dat",
"$root_out_dir/ui_test.pak",
......
......@@ -20,8 +20,6 @@ if (is_android) {
sources = [
"android/android_hooks.cc",
"main.cc",
"resource_provider_app.cc",
"resource_provider_app.h",
]
deps = [
......@@ -29,7 +27,6 @@ if (is_android) {
":lib",
"//base",
"//components/resource_provider/public/interfaces",
"//mojo/application",
"//mojo/environment:chromium",
"//third_party/mojo/src/mojo/public/c/system:for_shared_library",
"//url",
......@@ -62,15 +59,12 @@ if (is_android) {
mojo_native_application("resource_provider") {
sources = [
"main.cc",
"resource_provider_app.cc",
"resource_provider_app.h",
]
deps = [
":lib",
"//base",
"//components/resource_provider/public/interfaces",
"//mojo/application",
"//mojo/environment:chromium",
"//url",
]
......@@ -81,6 +75,8 @@ source_set("lib") {
sources = [
"file_utils.cc",
"file_utils.h",
"resource_provider_app.cc",
"resource_provider_app.h",
"resource_provider_impl.cc",
"resource_provider_impl.h",
]
......@@ -88,6 +84,7 @@ source_set("lib") {
deps = [
"//base",
"//components/resource_provider/public/interfaces",
"//mojo/application",
"//mojo/common:common_base",
"//mojo/platform_handle",
"//url",
......
......@@ -24,7 +24,8 @@ bool Init() {
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
std::vector<base::android::RegisterCallback> register_callbacks;
register_callbacks.push_back(base::Bind(&RegisterJNI));
register_callbacks.push_back(base::Bind(&RegisterNativesImpl));
register_callbacks.push_back(
base::Bind(&resource_provider::RegisterNativesImpl));
std::vector<base::android::InitCallback> init_callbacks;
init_callbacks.push_back(base::Bind(&Init));
......@@ -45,5 +46,6 @@ extern "C" JNI_EXPORT void InitApplicationContext(
const base::android::JavaRef<jobject>& context) {
JNIEnv* env = base::android::AttachCurrentThread();
base::android::InitApplicationContext(env, context);
Java_Main_init(env, base::android::GetApplicationContext());
resource_provider::Java_Main_init(
env, base::android::GetApplicationContext());
}
......@@ -7,11 +7,13 @@ package org.chromium.resource_provider;
import android.content.Context;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.base.PathUtils;
/**
* This class does setup for resource_provider.
*/
@JNINamespace("resource_provider")
public final class Main {
private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "resource_provider";
......
......@@ -51,7 +51,6 @@ copy_ex("copy_mandoline_assets") {
dest = mandoline_assets_dir
deps = [
"//components/html_viewer",
"//components/resource_provider",
"//components/surfaces",
"//mandoline/services/core_services",
]
......@@ -61,7 +60,6 @@ copy_ex("copy_mandoline_assets") {
"$root_out_dir/lib.stripped/libbootstrap.so",
"$root_out_dir/network_service.mojo",
"$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
"$root_out_dir/resource_provider.mojo",
"$root_out_dir/surfaces_service.mojo",
]
}
......
......@@ -20,6 +20,8 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
manager->RegisterApplicationPackageAlias(
GURL("mojo:omnibox"), GURL("mojo:core_services"), "Core");
#endif
manager->RegisterApplicationPackageAlias(
GURL("mojo:resource_provider"), GURL("mojo:core_services"), "Core");
manager->RegisterApplicationPackageAlias(
GURL("mojo:surfaces_service"), GURL("mojo:core_services"), "Surfaces");
manager->RegisterApplicationPackageAlias(GURL("mojo:tracing"),
......
......@@ -29,6 +29,7 @@ if (is_android) {
deps = [
":sources",
"//base",
"//components/resource_provider:jni_headers",
"//net",
"//third_party/mojo/src/mojo/public/c/system:for_shared_library",
]
......@@ -38,6 +39,7 @@ if (is_android) {
dex_path = java_library_path
deps = [
"//components/resource_provider:java_library",
"//net/android:net_java",
]
}
......@@ -59,6 +61,7 @@ source_set("sources") {
"//base",
"//components/clipboard:lib",
"//components/surfaces:lib",
"//components/resource_provider:lib",
"//components/view_manager:view_manager_lib",
"//mandoline/ui/browser:kiosk_wm_lib",
"//mojo/application",
......
include_rules = [
"+components/clipboard",
"+components/kiosk_wm",
"+components/resource_provider",
"+components/surfaces",
"+components/view_manager",
"+mojo/application",
......
......@@ -8,6 +8,7 @@
#include "base/android/jni_android.h"
#include "base/android/library_loader/library_loader_hooks.h"
#include "base/bind.h"
#include "components/resource_provider/jni/Main_jni.h"
#include "net/android/net_jni_registrar.h"
namespace {
......@@ -25,6 +26,8 @@ bool Init() {
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
std::vector<base::android::RegisterCallback> register_callbacks;
register_callbacks.push_back(base::Bind(&RegisterJNI));
register_callbacks.push_back(
base::Bind(&resource_provider::RegisterNativesImpl));
std::vector<base::android::InitCallback> init_callbacks;
init_callbacks.push_back(base::Bind(&Init));
......@@ -45,4 +48,6 @@ extern "C" JNI_EXPORT void InitApplicationContext(
const base::android::JavaRef<jobject>& context) {
JNIEnv* env = base::android::AttachCurrentThread();
base::android::InitApplicationContext(env, context);
resource_provider::Java_Main_init(
env, base::android::GetApplicationContext());
}
......@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "components/clipboard/clipboard_application_delegate.h"
#include "components/resource_provider/resource_provider_app.h"
#include "components/surfaces/surfaces_service_application.h"
#include "components/view_manager/view_manager_app.h"
#include "mandoline/ui/browser/browser.h"
......@@ -133,6 +134,8 @@ void CoreServicesApplicationDelegate::StartApplication(
else if (url == "mojo://omnibox/")
delegate.reset(new mandoline::OmniboxImpl);
#endif
else if (url == "mojo://resource_provider/")
delegate.reset(new resource_provider::ResourceProviderApp);
else if (url == "mojo://surfaces_service/")
delegate.reset(new surfaces::SurfacesServiceApplication);
else if (url == "mojo://tracing/")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment