diff options
author | Selim Gurun <sgurun@android.com> | 2015-03-03 01:54:25 +0000 |
---|---|---|
committer | Selim Gurun <sgurun@android.com> | 2015-03-03 01:54:25 +0000 |
commit | 49f9ad8e2a5467813c25eb6b032e790548f36233 (patch) | |
tree | af98b286d6454200b4f2a672ee1f436bc1c25195 /core/java/android/webkit | |
parent | 37bd8907cb94be69c9bd4c308e49c38524e87269 (diff) | |
download | frameworks_base-49f9ad8e2a5467813c25eb6b032e790548f36233.zip frameworks_base-49f9ad8e2a5467813c25eb6b032e790548f36233.tar.gz frameworks_base-49f9ad8e2a5467813c25eb6b032e790548f36233.tar.bz2 |
Revert "Add potential future APIs for postmessage"
This reverts commit 37bd8907cb94be69c9bd4c308e49c38524e87269.
Change-Id: Iaa9356b95859846ce9c3209d3d1bcfc800d2ff93
Diffstat (limited to 'core/java/android/webkit')
-rw-r--r-- | core/java/android/webkit/WebMessage.java | 63 | ||||
-rw-r--r-- | core/java/android/webkit/WebMessagePort.java | 87 | ||||
-rw-r--r-- | core/java/android/webkit/WebView.java | 30 | ||||
-rw-r--r-- | core/java/android/webkit/WebViewProvider.java | 4 |
4 files changed, 0 insertions, 184 deletions
diff --git a/core/java/android/webkit/WebMessage.java b/core/java/android/webkit/WebMessage.java deleted file mode 100644 index 73ee03b..0000000 --- a/core/java/android/webkit/WebMessage.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.webkit; - -/** - * The Java representation of the HTML5 PostMessage event. See - * https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces - * for definition of a MessageEvent in HTML5. - * - * @hide unhide when implementation is complete - */ -public class WebMessage { - - private String mData; - private WebMessagePort[] mPorts; - - /** - * Creates a WebMessage. - * @param data the data of the message. - */ - public WebMessage(String data) { - mData = data; - } - - /** - * Creates a WebMessage. - * @param data the data of the message. - * @param ports the ports array that are sent with the message. - */ - public WebMessage(String data, WebMessagePort[] ports) { - mData = data; - mPorts = ports; - } - - /** - * Returns the data of the message. - */ - public String getData() { - return mData; - } - - /** - * Returns the ports that are sent with the message, or null if no port - * is sent. - */ - public WebMessagePort[] getPorts() { - return mPorts; - } -} diff --git a/core/java/android/webkit/WebMessagePort.java b/core/java/android/webkit/WebMessagePort.java deleted file mode 100644 index f4347a5..0000000 --- a/core/java/android/webkit/WebMessagePort.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.webkit; - -import android.os.Handler; - -/** - * The Java representation of the HTML5 Message Port. See - * https://html.spec.whatwg.org/multipage/comms.html#messageport - * for definition of MessagePort in HTML5. - * - * A Message port represents one endpoint of a Message Channel. In Android - * webview, there is no separate Message Channel object. When a message channel - * is created, both ports are tangled to each other and started, and then - * returned in a MessagePort array, see {@link WebView#createMessageChannel} - * for creating a message channel. - * - * When a message port is first created or received via transfer, it does not - * have a WebMessageListener to receive web messages. The messages are queued until - * a WebMessageListener is set. - * - * @hide unhide when implementation is complete - */ -public abstract class WebMessagePort { - - /** - * The listener for handling MessagePort events. The message listener - * methods are called on the main thread. If the embedder application - * wants to receive the messages on a different thread, it can do this - * by passing a Handler in {@link setWebMessageListener(WebMessageListener, Handler)}. - * In the latter case, the application should be extra careful for thread safety - * since WebMessagePort methods should be called on main thread. - */ - public static abstract class WebMessageListener { - /** - * Message listener for receiving onMessage events. - * - * @param port The WebMessagePort that the message is destined for - * @param message The message from the entangled port. - */ - public abstract void onMessage(WebMessagePort port, WebMessage message); - } - - /** - * Post a WebMessage to the entangled port. - * - * @param The message. - * - * @throws IllegalStateException If message port is already transferred or closed. - */ - public abstract void postMessage(WebMessage message); - - /** - * Close the message port and free any resources associated with it. - */ - public abstract void close(); - - /** - * Sets a listener to receive message events on the main thread. - * - * @param listener The message listener. - */ - public abstract void setWebMessageListener(WebMessageListener listener); - - /** - * Sets a listener to receive message events on the handler that is provided - * by the application. - * - * @param listener The message listener. - * @param handler The handler to receive the message messages. - */ - public abstract void setWebMessageListener(WebMessageListener listener, Handler handler); -} diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 230c498..6793634 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -27,7 +27,6 @@ import android.graphics.Picture; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.net.http.SslCertificate; -import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Looper; @@ -1789,35 +1788,6 @@ public class WebView extends AbsoluteLayout } /** - * Creates a message channel to communicate with JS and returns the message - * ports that represent the endpoints of this message channel. The HTML5 message - * channel functionality is described here: - * https://html.spec.whatwg.org/multipage/comms.html#messagechannel - * - * The returned message channels are entangled and already in started state. - * - * @return Two message ports that form the message channel. - * - * @hide unhide when implementation is complete - */ - public WebMessagePort[] createWebMessageChannel() { - checkThread(); - if (TRACE) Log.d(LOGTAG, "createWebMessageChannel"); - return mProvider.createWebMessageChannel(); - } - - /** - * Post a message to main frame. - * - * @hide unhide when implementation is complete - */ - public void postMessageToMainFrame(WebMessage message, Uri targetOrigin) { - checkThread(); - if (TRACE) Log.d(LOGTAG, "postMessageToMainFrame. TargetOrigin=" + targetOrigin); - mProvider.postMessageToMainFrame(message, targetOrigin); - } - - /** * Gets the WebSettings object used to control the settings for this * WebView. * diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java index 2d8f1e4..2aee57b 100644 --- a/core/java/android/webkit/WebViewProvider.java +++ b/core/java/android/webkit/WebViewProvider.java @@ -228,10 +228,6 @@ public interface WebViewProvider { public void removeJavascriptInterface(String interfaceName); - public WebMessagePort[] createWebMessageChannel(); - - public void postMessageToMainFrame(WebMessage message, Uri targetOrigin); - public WebSettings getSettings(); public void setMapTrackballToArrowKeys(boolean setMap); |