| Index: android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| index 5bc5ed20db83fbd55e62eb8c2593276e57d6b097..9c5d8d6ff198b830457d65a59c69500bf56a32cc 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| @@ -35,6 +35,7 @@ public abstract class AwBrowserProcess {
|
|
|
| private static final String TAG = "AwBrowserProcess";
|
| private static final String EXCLUSIVE_LOCK_FILE = "webview_data.lock";
|
| + private static RandomAccessFile sLockFile;
|
| private static FileLock sExclusiveFileLock;
|
|
|
| /**
|
| @@ -115,9 +116,9 @@ public abstract class AwBrowserProcess {
|
| File lockFile = new File(dataPath, EXCLUSIVE_LOCK_FILE);
|
| boolean success = false;
|
| try {
|
| - // Note that the file is not closed intentionally.
|
| - RandomAccessFile file = new RandomAccessFile(lockFile, "rw");
|
| - sExclusiveFileLock = file.getChannel().tryLock();
|
| + // Note that the file is kept open intentionally.
|
| + sLockFile = new RandomAccessFile(lockFile, "rw");
|
| + sExclusiveFileLock = sLockFile.getChannel().tryLock();
|
| success = sExclusiveFileLock != null;
|
| } catch (IOException e) {
|
| Log.w(TAG, "Failed to create lock file " + lockFile, e);
|
|
|