Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
08458888
Commit
08458888
authored
4 years ago
by
Anna Malova
Committed by
Android (Google) Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use SystemClock.elapsedRealtime() to record WebView startup timestamps." into sc-dev
parents
ae759b07
f649ddfc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/java/android/webkit/WebViewFactory.java
+9
-8
9 additions, 8 deletions
core/java/android/webkit/WebViewFactory.java
with
9 additions
and
8 deletions
core/java/android/webkit/WebViewFactory.java
+
9
−
8
View file @
08458888
...
...
@@ -31,6 +31,7 @@ import android.content.pm.Signature;
import
android.os.Build
;
import
android.os.RemoteException
;
import
android.os.ServiceManager
;
import
android.os.SystemClock
;
import
android.os.Trace
;
import
android.util.AndroidRuntimeException
;
import
android.util.ArraySet
;
...
...
@@ -261,7 +262,7 @@ public final class WebViewFactory {
// us honest and minimize usage of WebView internals when binding the proxy.
if
(
sProviderInstance
!=
null
)
return
sProviderInstance
;
sTimestamps
[
WEBVIEW_LOAD_START
]
=
System
.
currentTimeMillis
();
sTimestamps
[
WEBVIEW_LOAD_START
]
=
System
Clock
.
elapsedRealtime
();
final
int
uid
=
android
.
os
.
Process
.
myUid
();
if
(
uid
==
android
.
os
.
Process
.
ROOT_UID
||
uid
==
android
.
os
.
Process
.
SYSTEM_UID
||
uid
==
android
.
os
.
Process
.
PHONE_UID
||
uid
==
android
.
os
.
Process
.
NFC_UID
...
...
@@ -401,7 +402,7 @@ public final class WebViewFactory {
Trace
.
traceBegin
(
Trace
.
TRACE_TAG_WEBVIEW
,
"initialApplication.createApplicationContext"
);
sTimestamps
[
CREATE_CONTEXT_START
]
=
System
.
currentTimeMillis
();
sTimestamps
[
CREATE_CONTEXT_START
]
=
System
Clock
.
elapsedRealtime
();
try
{
// Construct an app context to load the Java code into the current app.
Context
webViewContext
=
initialApplication
.
createApplicationContext
(
...
...
@@ -410,7 +411,7 @@ public final class WebViewFactory {
sPackageInfo
=
newPackageInfo
;
return
webViewContext
;
}
finally
{
sTimestamps
[
CREATE_CONTEXT_END
]
=
System
.
currentTimeMillis
();
sTimestamps
[
CREATE_CONTEXT_END
]
=
System
Clock
.
elapsedRealtime
();
Trace
.
traceEnd
(
Trace
.
TRACE_TAG_WEBVIEW
);
}
}
catch
(
RemoteException
|
PackageManager
.
NameNotFoundException
e
)
{
...
...
@@ -436,26 +437,26 @@ public final class WebViewFactory {
Trace
.
traceBegin
(
Trace
.
TRACE_TAG_WEBVIEW
,
"WebViewFactory.getChromiumProviderClass()"
);
try
{
sTimestamps
[
ADD_ASSETS_START
]
=
System
.
currentTimeMillis
();
sTimestamps
[
ADD_ASSETS_START
]
=
System
Clock
.
elapsedRealtime
();
for
(
String
newAssetPath
:
webViewContext
.
getApplicationInfo
().
getAllApkPaths
())
{
initialApplication
.
getAssets
().
addAssetPathAsSharedLibrary
(
newAssetPath
);
}
sTimestamps
[
ADD_ASSETS_END
]
=
sTimestamps
[
GET_CLASS_LOADER_START
]
=
System
.
currentTimeMillis
();
System
Clock
.
elapsedRealtime
();
ClassLoader
clazzLoader
=
webViewContext
.
getClassLoader
();
Trace
.
traceBegin
(
Trace
.
TRACE_TAG_WEBVIEW
,
"WebViewFactory.loadNativeLibrary()"
);
sTimestamps
[
GET_CLASS_LOADER_END
]
=
sTimestamps
[
NATIVE_LOAD_START
]
=
System
.
currentTimeMillis
();
System
Clock
.
elapsedRealtime
();
WebViewLibraryLoader
.
loadNativeLibrary
(
clazzLoader
,
getWebViewLibrary
(
sPackageInfo
.
applicationInfo
));
Trace
.
traceEnd
(
Trace
.
TRACE_TAG_WEBVIEW
);
Trace
.
traceBegin
(
Trace
.
TRACE_TAG_WEBVIEW
,
"Class.forName()"
);
sTimestamps
[
NATIVE_LOAD_END
]
=
sTimestamps
[
PROVIDER_CLASS_FOR_NAME_START
]
=
System
.
currentTimeMillis
();
System
Clock
.
elapsedRealtime
();
try
{
return
getWebViewProviderClass
(
clazzLoader
);
}
finally
{
sTimestamps
[
PROVIDER_CLASS_FOR_NAME_END
]
=
System
.
currentTimeMillis
();
sTimestamps
[
PROVIDER_CLASS_FOR_NAME_END
]
=
System
Clock
.
elapsedRealtime
();
Trace
.
traceEnd
(
Trace
.
TRACE_TAG_WEBVIEW
);
}
}
catch
(
ClassNotFoundException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment