| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.sdk.internal.wip; | 5 package org.chromium.sdk.internal.wip; |
| 6 | 6 |
| 7 import java.io.IOException; | 7 import java.io.IOException; |
| 8 import java.io.OutputStream; | 8 import java.io.OutputStream; |
| 9 import java.net.InetSocketAddress; | 9 import java.net.InetSocketAddress; |
| 10 import java.net.URI; | 10 import java.net.URI; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 Hybi17WsConnection.MaskStrategy.TRANSPARENT_MASK, connectionLogger); | 118 Hybi17WsConnection.MaskStrategy.TRANSPARENT_MASK, connectionLogger); |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 return new WipTabImpl(socket, browserImpl, listener, description.url()); | 122 return new WipTabImpl(socket, browserImpl, listener, description.url()); |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 private String readHttpResponseContent(InetSocketAddress socketAddress, String
resource, | 126 private String readHttpResponseContent(InetSocketAddress socketAddress, String
resource, |
| 127 LoggerFactory loggerFactory) throws IOException { | 127 LoggerFactory loggerFactory) throws IOException { |
| 128 ConnectionLogger browserConnectionLogger = loggerFactory.newBrowserConnectio
nLogger(); | 128 ConnectionLogger browserConnectionLogger; |
| 129 if (loggerFactory == null) { |
| 130 browserConnectionLogger = null; |
| 131 } else { |
| 132 browserConnectionLogger = loggerFactory.newBrowserConnectionLogger(); |
| 133 } |
| 129 final SocketWrapper socketWrapper = new SocketWrapper( | 134 final SocketWrapper socketWrapper = new SocketWrapper( |
| 130 socketAddress, DEFAULT_CONNECTION_TIMEOUT_MS, browserConnectionLogger, | 135 socketAddress, DEFAULT_CONNECTION_TIMEOUT_MS, browserConnectionLogger, |
| 131 HandshakeUtil.ASCII_CHARSET); | 136 HandshakeUtil.ASCII_CHARSET); |
| 132 try { | 137 try { |
| 133 if (browserConnectionLogger != null) { | 138 if (browserConnectionLogger != null) { |
| 134 browserConnectionLogger.start(); | 139 browserConnectionLogger.start(); |
| 135 browserConnectionLogger.setConnectionCloser(new ConnectionLogger.Connect
ionCloser() { | 140 browserConnectionLogger.setConnectionCloser(new ConnectionLogger.Connect
ionCloser() { |
| 136 @Override | 141 @Override |
| 137 public void closeConnection() { | 142 public void closeConnection() { |
| 138 socketWrapper.getShutdownRelay().sendSignal(null, new Exception("UI
close request")); | 143 socketWrapper.getShutdownRelay().sendSignal(null, new Exception("UI
close request")); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 210 |
| 206 try { | 211 try { |
| 207 WipTabList tabList = WipParserAccess.get().parseTabList(jsonValue); | 212 WipTabList tabList = WipParserAccess.get().parseTabList(jsonValue); |
| 208 return tabList.asTabList(); | 213 return tabList.asTabList(); |
| 209 } catch (JsonProtocolParseException e) { | 214 } catch (JsonProtocolParseException e) { |
| 210 throw new IOException( | 215 throw new IOException( |
| 211 "Failed to parse tab list response (on protocol level)", e); | 216 "Failed to parse tab list response (on protocol level)", e); |
| 212 } | 217 } |
| 213 } | 218 } |
| 214 } | 219 } |
| OLD | NEW |