Commit 0cee631b authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

[AW] Move webview services to //aw/apk

//aw/apk is where all standalone webview code should live (things not
run in another app's process as a result of starting a webview).
Since services run in webview's process, they belong in the apk folder.
This also moves the aidl files to //aw/java/.../common/services.

Test: Manually verify starting SystemWebView still starts the service.
Bug: 934152
Change-Id: I4e3c2f43c4dfbab41b8f187d82dbd03ce09147da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864317Reviewed-by: default avatarChris Palmer <palmer@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709306}
parent 404a726e
......@@ -491,7 +491,6 @@ source_set("common") {
java_group("android_webview_java") {
deps = [
":browser_java",
":services_java",
]
}
......@@ -759,7 +758,7 @@ android_library("common_crash_java") {
android_library("common_java") {
java_files = [
"java/src/org/chromium/android_webview/common/AwResource.java",
"java/src/org/chromium/android_webview/common/ServiceNames.java",
"java/src/org/chromium/android_webview/common/services/ServiceNames.java",
]
deps = [
"//base:base_java",
......@@ -775,53 +774,16 @@ android_library("common_commandline_java") {
]
}
android_aidl("services_variations_seed_server_aidl") {
android_aidl("common_aidl") {
import_include = [ "java/src" ]
sources = [
"java/src/org/chromium/android_webview/services/IVariationsSeedServer.aidl",
]
}
android_aidl("services_crash_receiver_aidl") {
import_include = [ "java/src" ]
sources = [
"java/src/org/chromium/android_webview/services/ICrashReceiverService.aidl",
"java/src/org/chromium/android_webview/common/services/ICrashReceiverService.aidl",
"java/src/org/chromium/android_webview/common/services/IVariationsSeedServer.aidl",
]
}
android_library("common_aidl_java") {
srcjar_deps = [
":services_crash_receiver_aidl",
":services_variations_seed_server_aidl",
]
}
# Keep WebView's services separate from other WebView code to keep their deps clean
# (and make them easy to move).
android_library("services_java") {
java_files = [
"java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
"java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
"java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
"java/src/org/chromium/android_webview/services/CrashReceiverService.java",
"java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
"java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
]
deps = [
":common_aidl_java",
":common_commandline_java",
":common_crash_java",
":common_platform_services_java",
":common_variations_utils_java",
":system_webview_manifest",
"//base:base_java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/variations/android:variations_java",
"//components/version_info/android:version_constants_java",
]
android_manifest_for_lint = system_webview_android_manifest
min_sdk_version = 21
srcjar_deps = [ ":common_aidl" ]
}
# Generate LocaleConfig.java so that android_webview_locale_config_java's
......
......@@ -26,6 +26,7 @@ android_library("apk_java") {
]
deps = [
":devui_java",
":services_java",
"//android_webview:android_webview_locale_config_java",
"//android_webview:common_commandline_java",
"//base:base_java",
......@@ -57,6 +58,32 @@ android_library("devui_java") {
min_sdk_version = 21
}
android_library("services_java") {
java_files = [
"java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
"java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
"java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
"java/src/org/chromium/android_webview/services/CrashReceiverService.java",
"java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
"java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
]
deps = [
"//android_webview:common_aidl_java",
"//android_webview:common_commandline_java",
"//android_webview:common_crash_java",
"//android_webview:common_platform_services_java",
"//android_webview:common_variations_utils_java",
"//android_webview:system_webview_manifest",
"//base:base_java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/variations/android:variations_java",
"//components/version_info/android:version_constants_java",
]
android_manifest_for_lint = system_webview_android_manifest
min_sdk_version = 21
}
source_set("apk") {
sources = [
"webview_apk_application.cc",
......
include_rules = [
"+components/background_task_scheduler/android/java",
"+components/minidump_uploader/android/java",
"+components/variations/android/java",
]
// Copyright 2016 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.
package org.chromium.android_webview.services;
import android.os.PersistableBundle;
......
......@@ -14,6 +14,7 @@ import android.os.ParcelFileDescriptor;
import org.chromium.android_webview.common.crash.CrashInfo;
import org.chromium.android_webview.common.crash.SystemWideCrashDirectories;
import org.chromium.android_webview.common.services.ICrashReceiverService;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.components.background_task_scheduler.TaskIds;
......
......@@ -9,6 +9,8 @@ import android.content.Intent;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import org.chromium.android_webview.common.services.IVariationsSeedServer;
/**
* VariationsSeedServer is a bound service that shares the Variations seed with all the WebViews
* on the system. A WebView will bind and call getSeed, passing a file descriptor to which the
......
include_rules = [
"+components/autofill/android/java",
"+components/background_task_scheduler/android/java",
"+components/embedder_support/android/java",
"+components/navigation_interception/android/java",
"+components/policy/android/java",
"+components/safe_browsing/android/java",
"+components/variations/android/java",
"-content/public/android/java",
"+content/public/android/java/src/org/chromium/content_public",
......
......@@ -16,11 +16,11 @@ import android.os.StrictMode;
import org.chromium.android_webview.common.CommandLineUtil;
import org.chromium.android_webview.common.PlatformServiceBridge;
import org.chromium.android_webview.common.ServiceNames;
import org.chromium.android_webview.common.services.ICrashReceiverService;
import org.chromium.android_webview.common.services.ServiceNames;
import org.chromium.android_webview.metrics.AwMetricsServiceClient;
import org.chromium.android_webview.policy.AwPolicyProvider;
import org.chromium.android_webview.safe_browsing.AwSafeBrowsingConfigHelper;
import org.chromium.android_webview.services.ICrashReceiverService;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
......
......@@ -16,9 +16,9 @@ import android.os.SystemClock;
import androidx.annotation.IntDef;
import org.chromium.android_webview.common.ServiceNames;
import org.chromium.android_webview.common.services.IVariationsSeedServer;
import org.chromium.android_webview.common.services.ServiceNames;
import org.chromium.android_webview.common.variations.VariationsUtils;
import org.chromium.android_webview.services.IVariationsSeedServer;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.services;
package org.chromium.android_webview.common.services;
interface ICrashReceiverService {
void transmitCrashes(in ParcelFileDescriptor[] fileDescriptors, in List crashInfo);
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.services;
package org.chromium.android_webview.common.services;
oneway interface IVariationsSeedServer {
// Apps request variations seeds from WebView's service by calling this interface. They should
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.common;
package org.chromium.android_webview.common.services;
/**
* Defines constants containing the fully-qualified names of WebView services.
......
......@@ -8,7 +8,7 @@ import android.content.Intent;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import org.chromium.android_webview.services.IVariationsSeedServer;
import org.chromium.android_webview.common.services.IVariationsSeedServer;
import org.chromium.android_webview.services.VariationsSeedServer;
import org.chromium.base.test.util.CallbackHelper;
......
......@@ -22,7 +22,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.android_webview.services.IVariationsSeedServer;
import org.chromium.android_webview.common.services.IVariationsSeedServer;
import org.chromium.android_webview.services.VariationsSeedServer;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.robolectric.common;
package org.chromium.android_webview.robolectric.common.services;
import android.support.test.filters.SmallTest;
......@@ -11,7 +11,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
import org.chromium.android_webview.common.ServiceNames;
import org.chromium.android_webview.common.services.ServiceNames;
import org.chromium.android_webview.services.CrashReceiverService;
import org.chromium.android_webview.services.VariationsSeedServer;
import org.chromium.testing.local.LocalRobolectricTestRunner;
......
......@@ -167,8 +167,6 @@ instrumentation_test_apk("webview_instrumentation_test_apk") {
min_sdk_version = 21
deps = [
"//android_webview:android_webview_java",
"//android_webview:services_java",
"//android_webview:services_variations_seed_server_aidl",
"//android_webview/test/embedded_test_server:aw_net_java_test_support",
"//base:base_java",
"//base:base_java_test_support",
......@@ -438,11 +436,12 @@ junit_binary("android_webview_junit_tests") {
"../junit/src/org/chromium/android_webview/robolectric/AwLayoutSizerTest.java",
"../junit/src/org/chromium/android_webview/robolectric/FindAddressTest.java",
"../junit/src/org/chromium/android_webview/robolectric/AwScrollOffsetManagerTest.java",
"../junit/src/org/chromium/android_webview/robolectric/common/ServiceNamesTest.java",
"../junit/src/org/chromium/android_webview/robolectric/common/services/ServiceNamesTest.java",
]
deps = [
"//android_webview:android_webview_java",
"//android_webview/apk:services_java",
"//base:base_java_test_support",
"//content/public/test/android:content_java_test_support",
"//third_party/android_support_test_runner:runner_java",
......
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