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

Unified Diff: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java

Issue 2133923002: Simplify caller checking logic in WebApkServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into sandbox_on_transact1 Created 4 years, 5 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 | « chrome/android/webapk/shell_apk/javatests/DEPS ('k') | chrome/test/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java
index 575a076437f70c30b0b37ce42c2566426615d1b3..7b49621d8f65a3597b0ce024c21864cb9cad21d6 100644
--- a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java
+++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java
@@ -34,9 +34,9 @@ public class WebApkServiceFactory extends Service {
private static final String KEY_SMALL_ICON_ID = "small_icon_id";
/**
- * Key for passing package name of only process allowed to call the service's methods.
+ * Key for passing uid of only application allowed to call the service's methods.
*/
- private static final String KEY_HOST_BROWSER_PACKAGE = "host_browser_package";
+ private static final String KEY_HOST_BROWSER_UID = "host_browser_uid";
@Override
public IBinder onBind(Intent intent) {
@@ -52,10 +52,10 @@ public class WebApkServiceFactory extends Service {
webApkClassLoader.loadClass(WEBAPK_SERVICE_IMPL_CLASS_NAME);
Constructor<?> webApkServiceImplConstructor =
webApkServiceImplClass.getConstructor(Context.class, Bundle.class);
- String hostPackageName = WebApkUtils.getHostBrowserPackageName(this);
+ int hostBrowserUid = WebApkUtils.getHostBrowserUid(this);
Bundle bundle = new Bundle();
bundle.putInt(KEY_SMALL_ICON_ID, R.drawable.app_icon);
- bundle.putString(KEY_HOST_BROWSER_PACKAGE, hostPackageName);
+ bundle.putInt(KEY_HOST_BROWSER_UID, hostBrowserUid);
return (IBinder) webApkServiceImplConstructor.newInstance(new Object[] {this, bundle});
} catch (Exception e) {
Log.w(TAG, "Unable to create WebApkServiceImpl.");
« no previous file with comments | « chrome/android/webapk/shell_apk/javatests/DEPS ('k') | chrome/test/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698