< prev index next >
modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java
Print this page
*** 23,32 ****
--- 23,34 ----
* questions.
*/
package com.sun.webkit.network;
+ import com.sun.javafx.logging.PlatformLogger;
+ import com.sun.javafx.logging.PlatformLogger.Level;
import com.sun.webkit.Invoker;
import com.sun.webkit.LoadListenerClient;
import com.sun.webkit.WebPage;
import static com.sun.webkit.network.URLs.newURL;
import java.io.EOFException;
*** 54,65 ****
import java.security.PrivilegedAction;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
- import java.util.logging.Level;
- import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;
import javax.net.ssl.SSLHandshakeException;
/**
--- 56,65 ----
*** 67,78 ****
*/
final class URLLoader implements Runnable {
@Native public static final int ALLOW_UNASSIGNED = java.net.IDN.ALLOW_UNASSIGNED;
! private static final Logger logger =
! Logger.getLogger(URLLoader.class.getName());
private static final int MAX_REDIRECTS = 10;
private static final int MAX_BUF_COUNT = 3;
private static final String GET = "GET";
private static final String HEAD = "HEAD";
private static final String DELETE = "DELETE";
--- 67,78 ----
*/
final class URLLoader implements Runnable {
@Native public static final int ALLOW_UNASSIGNED = java.net.IDN.ALLOW_UNASSIGNED;
! private static final PlatformLogger logger =
! PlatformLogger.getLogger(URLLoader.class.getName());
private static final int MAX_REDIRECTS = 10;
private static final int MAX_BUF_COUNT = 3;
private static final String GET = "GET";
private static final String HEAD = "HEAD";
private static final String DELETE = "DELETE";
*** 115,125 ****
/**
* Cancels this loader.
*/
private void fwkCancel() {
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format("data: [0x%016X]", data));
}
canceled = true;
}
/**
--- 115,125 ----
/**
* Cancels this loader.
*/
private void fwkCancel() {
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format("data: [0x%016X]", data));
}
canceled = true;
}
/**
*** 243,255 ****
errorCode = LoadListenerClient.UNKNOWN_ERROR;
}
if (error != null) {
if (errorCode == LoadListenerClient.UNKNOWN_ERROR) {
! logger.log(Level.WARNING, "Unexpected error", error);
} else {
! logger.log(Level.FINEST, "Load error", error);
}
didFail(errorCode, error.getMessage());
}
}
--- 243,255 ----
errorCode = LoadListenerClient.UNKNOWN_ERROR;
}
if (error != null) {
if (errorCode == LoadListenerClient.UNKNOWN_ERROR) {
! logger.warning("Unexpected error", error);
} else {
! logger.finest("Load error", error);
}
didFail(errorCode, error.getMessage());
}
}
*** 521,531 ****
// HttpRetryException is handled from doRun() method.
// Hence rethrowing the exception to caller(doRun() method)
throw ex;
} catch (IOException e) {
if (logger.isLoggable(Level.FINE)) {
! logger.log(Level.FINE, String.format("Exception caught: [%s], %s",
e.getClass().getSimpleName(),
e.getMessage()));
}
}
--- 521,531 ----
// HttpRetryException is handled from doRun() method.
// Hence rethrowing the exception to caller(doRun() method)
throw ex;
} catch (IOException e) {
if (logger.isLoggable(Level.FINE)) {
! logger.fine(String.format("Exception caught: [%s], %s",
e.getClass().getSimpleName(),
e.getMessage()));
}
}
*** 537,547 ****
} else if ("deflate".equalsIgnoreCase(encoding)) {
inputStream = new InflaterInputStream(inputStream);
}
} catch (IOException e) {
if (logger.isLoggable(Level.FINE)) {
! logger.log(Level.FINE, String.format("Exception caught: [%s], %s",
e.getClass().getSimpleName(),
e.getMessage()));
}
}
}
--- 537,547 ----
} else if ("deflate".equalsIgnoreCase(encoding)) {
inputStream = new InflaterInputStream(inputStream);
}
} catch (IOException e) {
if (logger.isLoggable(Level.FINE)) {
! logger.fine(String.format("Exception caught: [%s], %s",
e.getClass().getSimpleName(),
e.getMessage()));
}
}
}
*** 670,680 ****
private void notifyDidSendData(long totalBytesSent,
long totalBytesToBeSent)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format(
"totalBytesSent: [%d], "
+ "totalBytesToBeSent: [%d], "
+ "data: [0x%016X]",
totalBytesSent,
totalBytesToBeSent,
--- 670,680 ----
private void notifyDidSendData(long totalBytesSent,
long totalBytesToBeSent)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format(
"totalBytesSent: [%d], "
+ "totalBytesToBeSent: [%d], "
+ "data: [0x%016X]",
totalBytesSent,
totalBytesToBeSent,
*** 731,741 ****
long contentLength,
String headers,
String url)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format(
"newUrl: [%s], "
+ "newMethod: [%s], "
+ "status: [%d], "
+ "contentType: [%s], "
+ "contentEncoding: [%s], "
--- 731,741 ----
long contentLength,
String headers,
String url)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format(
"newUrl: [%s], "
+ "newMethod: [%s], "
+ "status: [%d], "
+ "contentType: [%s], "
+ "contentEncoding: [%s], "
*** 762,772 ****
contentLength,
headers,
url,
data);
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format("result: [%s]", result));
}
return result;
}
private void didReceiveResponse(URLConnection c) {
--- 762,772 ----
contentLength,
headers,
url,
data);
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format("result: [%s]", result));
}
return result;
}
private void didReceiveResponse(URLConnection c) {
*** 795,805 ****
long contentLength,
String headers,
String url)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format(
"status: [%d], "
+ "contentType: [%s], "
+ "contentEncoding: [%s], "
+ "contentLength: [%d], "
+ "url: [%s], "
--- 795,805 ----
long contentLength,
String headers,
String url)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format(
"status: [%d], "
+ "contentType: [%s], "
+ "contentEncoding: [%s], "
+ "contentLength: [%d], "
+ "url: [%s], "
*** 841,851 ****
private void notifyDidReceiveData(ByteBuffer byteBuffer,
int position,
int remaining)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format(
"byteBuffer: [%s], "
+ "position: [%s], "
+ "remaining: [%s], "
+ "data: [0x%016X]",
byteBuffer,
--- 841,851 ----
private void notifyDidReceiveData(ByteBuffer byteBuffer,
int position,
int remaining)
{
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format(
"byteBuffer: [%s], "
+ "position: [%s], "
+ "remaining: [%s], "
+ "data: [0x%016X]",
byteBuffer,
*** 864,874 ****
});
}
private void notifyDidFinishLoading() {
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format("data: [0x%016X]", data));
}
twkDidFinishLoading(data);
}
private void didFail(final int errorCode, final String message) {
--- 864,874 ----
});
}
private void notifyDidFinishLoading() {
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format("data: [0x%016X]", data));
}
twkDidFinishLoading(data);
}
private void didFail(final int errorCode, final String message) {
*** 880,890 ****
});
}
private void notifyDidFail(int errorCode, String url, String message) {
if (logger.isLoggable(Level.FINEST)) {
! logger.log(Level.FINEST, String.format(
"errorCode: [%d], "
+ "url: [%s], "
+ "message: [%s], "
+ "data: [0x%016X]",
errorCode,
--- 880,890 ----
});
}
private void notifyDidFail(int errorCode, String url, String message) {
if (logger.isLoggable(Level.FINEST)) {
! logger.finest(String.format(
"errorCode: [%d], "
+ "url: [%s], "
+ "message: [%s], "
+ "data: [0x%016X]",
errorCode,
< prev index next >