forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Move getPacProcessor() to GlueApiHelperForR"
This is a reland of 02b24a7 Forgot to add the line in proguard.py to make VerifiesOnR work correctly. Original change's description: > Move getPacProcessor() to GlueApiHelperForR > > Follow up after feedback on http://crrev.com/c/2328302. > > Bug: 1111909 > Change-Id: If3107a6bc513d2aad898e8bc87c8436392ee057d > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335385 > Commit-Queue: Clark DuVall <[email protected]> > Reviewed-by: Nate Fischer <[email protected]> > Reviewed-by: Richard Coles <[email protected]> > Cr-Commit-Position: refs/heads/master@{#794655} [email protected] Bug: 1111909 Change-Id: I64eafe0fb9093907a5510142d73455aee3af2c67 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2337385 Commit-Queue: Clark DuVall <[email protected]> Reviewed-by: Sam Maier <[email protected]> Reviewed-by: Nate Fischer <[email protected]> Cr-Commit-Position: refs/heads/master@{#794814}
- Loading branch information
1 parent
a15d6d3
commit 528e18d
Showing
9 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
android_webview/glue/java/src/com/android/webview/chromium/GlueApiHelperForR.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2020 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 com.android.webview.chromium; | ||
|
||
import android.annotation.TargetApi; | ||
import android.os.Build; | ||
import android.webkit.PacProcessor; | ||
|
||
import org.chromium.base.annotations.VerifiesOnR; | ||
|
||
/** | ||
* Utility class to use new APIs that were added in R (API level 30). These need to exist in a | ||
* separate class so that Android framework can successfully verify glue layer classes without | ||
* encountering the new APIs. Note that GlueApiHelper is only for APIs that cannot go to ApiHelper | ||
* in base/, for reasons such as using system APIs or instantiating an adapter class that is | ||
* specific to glue layer. | ||
*/ | ||
@VerifiesOnR | ||
@TargetApi(Build.VERSION_CODES.R) | ||
public final class GlueApiHelperForR { | ||
private GlueApiHelperForR() {} | ||
|
||
public static PacProcessor getPacProcessor() { | ||
return PacProcessorImpl.getInstance(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
base/android/java/src/org/chromium/base/annotations/VerifiesOnR.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2020 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.base.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* The annotated method or class verifies on R, but not below. | ||
* | ||
* The annotated method (or methods on the annotated class) are guaranteed to not be inlined by R8 | ||
* on builds targeted below R. This prevents class verification errors (which results in a very slow | ||
* retry-verification-at-runtime) from spreading into other classes on these lower versions. | ||
*/ | ||
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE}) | ||
@Retention(RetentionPolicy.CLASS) | ||
public @interface VerifiesOnR {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters