| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.ServiceConnection; | 10 import android.content.ServiceConnection; |
| 11 import android.os.AsyncTask; | 11 import android.os.AsyncTask; |
| 12 import android.os.Bundle; | 12 import android.os.Bundle; |
| 13 import android.os.Handler; | 13 import android.os.Handler; |
| 14 import android.os.IBinder; | 14 import android.os.IBinder; |
| 15 import android.os.Looper; | 15 import android.os.Looper; |
| 16 import android.os.ParcelFileDescriptor; | 16 import android.os.ParcelFileDescriptor; |
| 17 import android.util.Log; | 17 import android.util.Log; |
| 18 | 18 |
| 19 import java.io.IOException; | 19 import java.io.IOException; |
| 20 import java.util.concurrent.atomic.AtomicBoolean; | 20 import java.util.concurrent.atomic.AtomicBoolean; |
| 21 | 21 |
| 22 import org.chromium.base.CalledByNative; | 22 import org.chromium.base.CalledByNative; |
| 23 import org.chromium.base.CommandLine; |
| 23 import org.chromium.base.CpuFeatures; | 24 import org.chromium.base.CpuFeatures; |
| 24 import org.chromium.base.SysUtils; | 25 import org.chromium.base.SysUtils; |
| 25 import org.chromium.base.ThreadUtils; | 26 import org.chromium.base.ThreadUtils; |
| 26 import org.chromium.content.app.ChildProcessService; | 27 import org.chromium.content.app.ChildProcessService; |
| 27 import org.chromium.content.app.Linker; | 28 import org.chromium.content.app.Linker; |
| 28 import org.chromium.content.app.LinkerParams; | 29 import org.chromium.content.app.LinkerParams; |
| 29 import org.chromium.content.common.CommandLine; | |
| 30 import org.chromium.content.common.IChildProcessCallback; | 30 import org.chromium.content.common.IChildProcessCallback; |
| 31 import org.chromium.content.common.IChildProcessService; | 31 import org.chromium.content.common.IChildProcessService; |
| 32 import org.chromium.content.common.TraceEvent; | 32 import org.chromium.content.common.TraceEvent; |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * Manages a connection between the browser activity and a child service. The cl
ass is responsible | 35 * Manages a connection between the browser activity and a child service. The cl
ass is responsible |
| 36 * for estabilishing the connection (start()), closing it (stop()) and increasin
g the priority of | 36 * for estabilishing the connection (start()), closing it (stop()) and increasin
g the priority of |
| 37 * the service when it is in active use (between calls to attachAsActive() and d
etachAsActive()). | 37 * the service when it is in active use (between calls to attachAsActive() and d
etachAsActive()). |
| 38 */ | 38 */ |
| 39 public class ChildProcessConnection { | 39 public class ChildProcessConnection { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 /** | 475 /** |
| 476 * @return The connection PID, or 0 if not yet connected. | 476 * @return The connection PID, or 0 if not yet connected. |
| 477 */ | 477 */ |
| 478 int getPid() { | 478 int getPid() { |
| 479 synchronized(mLock) { | 479 synchronized(mLock) { |
| 480 return mPID; | 480 return mPID; |
| 481 } | 481 } |
| 482 } | 482 } |
| 483 } | 483 } |
| OLD | NEW |