| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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; | 5 package org.chromium.sdk; |
| 6 | 6 |
| 7 import java.net.SocketAddress; | 7 import java.net.SocketAddress; |
| 8 import java.util.logging.Logger; | 8 import java.util.logging.Logger; |
| 9 | 9 |
| 10 import org.chromium.sdk.internal.BrowserFactoryImpl; | 10 import org.chromium.sdk.internal.JavascriptVmFactoryImpl; |
| 11 import org.chromium.sdk.wip.WipBrowser; |
| 12 import org.chromium.sdk.wip.WipBrowserFactory; |
| 11 | 13 |
| 12 /** | 14 /** |
| 13 * A factory for Browser instances. | 15 * A factory for {@link JavascriptVm} instances. Note that {@link WipBrowser} in
stances are |
| 14 * TODO: reflect that it only creates standalone client, no browser. | 16 * created in a specialized class {@link WipBrowserFactory}. |
| 15 */ | 17 */ |
| 16 public abstract class BrowserFactory { | 18 public abstract class JavascriptVmFactory { |
| 17 /** | 19 /** |
| 18 * Gets a {@link BrowserFactory} instance. This method should be overridden by | 20 * Gets a {@link JavascriptVmFactory} instance. This method should be overridd
en by |
| 19 * implementations that want to construct other implementations of | 21 * implementations that want to construct other implementations of |
| 20 * {@link Browser}. | 22 * {@link Browser}. |
| 21 * | 23 * |
| 22 * @return a BrowserFactory singleton instance | 24 * @return a {@link JavascriptVmFactory} singleton instance |
| 23 */ | 25 */ |
| 24 public static BrowserFactory getInstance() { | 26 public static JavascriptVmFactory getInstance() { |
| 25 return BrowserFactoryImpl.INSTANCE; | 27 return JavascriptVmFactoryImpl.INSTANCE; |
| 26 } | 28 } |
| 27 | 29 |
| 28 /** | 30 /** |
| 29 * Constructs StandaloneVm instance that talks to a V8 JavaScript VM via | 31 * Constructs StandaloneVm instance that talks to a V8 JavaScript VM via |
| 30 * DebuggerAgent opened at {@code socketAddress}. | 32 * DebuggerAgent opened at {@code socketAddress}. |
| 31 * @param socketAddress V8 DebuggerAgent is listening on | 33 * @param socketAddress V8 DebuggerAgent is listening on |
| 32 * @param connectionLogger provides facility for listening to network | 34 * @param connectionLogger provides facility for listening to network |
| 33 * traffic; may be null | 35 * traffic; may be null |
| 34 */ | 36 */ |
| 35 public abstract StandaloneVm createStandalone(SocketAddress socketAddress, | 37 public abstract StandaloneVm createStandalone(SocketAddress socketAddress, |
| 36 ConnectionLogger connectionLogger); | 38 ConnectionLogger connectionLogger); |
| 37 | 39 |
| 38 /** | 40 /** |
| 39 * @return SDK root logger that can be used to add handlers or to adjust log l
evel | 41 * @return SDK root logger that can be used to add handlers or to adjust log l
evel |
| 40 */ | 42 */ |
| 41 public static Logger getRootLogger() { | 43 public static Logger getRootLogger() { |
| 42 return LOGGER; | 44 return LOGGER; |
| 43 } | 45 } |
| 44 | 46 |
| 45 private static final Logger LOGGER = Logger.getLogger("org.chromium.sdk"); | 47 private static final Logger LOGGER = Logger.getLogger("org.chromium.sdk"); |
| 46 } | 48 } |
| OLD | NEW |