@Override
 public void grant(String[] resources) {
   long requestedResource = mAwPermissionRequest.getResources();
   if ((requestedResource & toAwPermissionResources(resources)) == requestedResource)
     mAwPermissionRequest.grant();
   else mAwPermissionRequest.deny();
 }
 @Override
 public String[] getResources() {
   synchronized (this) {
     if (mResources == null) {
       mResources = toPermissionResources(mAwPermissionRequest.getResources());
     }
     return mResources;
   }
 }
 @Override
 public void onPermissionRequest(AwPermissionRequest permissionRequest) {
   TraceEvent.begin();
   if (mWebChromeClient != null) {
     if (TRACE) Log.d(TAG, "onPermissionRequest");
     if (mOngoingPermissionRequests == null) {
       mOngoingPermissionRequests =
           new WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdapter>>();
     }
     PermissionRequestAdapter adapter = new PermissionRequestAdapter(permissionRequest);
     mOngoingPermissionRequests.put(
         permissionRequest, new WeakReference<PermissionRequestAdapter>(adapter));
     mWebChromeClient.onPermissionRequest(adapter);
   } else {
     // By default, we deny the permission.
     permissionRequest.deny();
   }
   TraceEvent.end();
 }
 @Override
 public void deny() {
   mAwPermissionRequest.deny();
 }
 @Override
 public Uri getOrigin() {
   return mAwPermissionRequest.getOrigin();
 }