Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2017-02-07 22:22:51 +0000
committerGerrit Code Review @ Eclipse.org2017-02-09 11:20:31 +0000
commit413be3831164594d6dba55695a5cfe41bdbedb29 (patch)
tree7c4246c1bcf1c656b51b0ab29be05b302467bbca /bundles
parent7a5348c60580327689d5fb9a440089242f0ca2e7 (diff)
downloadorg.eclipse.rap-413be3831164594d6dba55695a5cfe41bdbedb29.tar.gz
org.eclipse.rap-413be3831164594d6dba55695a5cfe41bdbedb29.tar.xz
org.eclipse.rap-413be3831164594d6dba55695a5cfe41bdbedb29.zip
Render ServerPush deactivation when display is disposed
We should deactivate active server push session on the client when display is disposed. Otherwize, the client will continue sending server push request non-stop in some cases. Also deactivate server push on the client before sending shutdown request as server renders empty response in this case. 510553: Add possibility to stop a ServerPushSession even if there are still Runnables to process https://bugs.eclipse.org/bugs/show_bug.cgi?id=510553 Change-Id: I20ddc1a50ebf244fb5a8d94a8bebe0447cbd96e2
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/Display.js3
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java13
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/ServerPushRenderer.java4
3 files changed, 13 insertions, 7 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Display.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Display.js
index 4bb6fa60cc..df42c974ab 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Display.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Display.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 EclipseSource and others.
+ * Copyright (c) 2011, 2017 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -166,6 +166,7 @@ rwt.widgets.Display.prototype = {
this._document.removeEventListener( "windowresize", this._onResize, this );
this._document.removeEventListener( "keypress", this._onKeyPress, this );
this._server.removeEventListener( "send", this._onSend, this );
+ rwt.client.ServerPush.getInstance().setActive( false );
this._sendShutdown();
},
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java
index f41ae47420..3e14fd49b5 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2016 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -102,7 +102,7 @@ public class DisplayLCA {
renderFocus( display );
renderBeep( display );
renderResizeListener( display );
- renderUICallBack();
+ renderServerPush( display );
ActiveKeysUtil.renderActiveKeys( display );
ActiveKeysUtil.renderCancelKeys( display );
ActiveKeysUtil.renderMnemonicActivator( display );
@@ -250,8 +250,13 @@ public class DisplayLCA {
}
}
- private static void renderUICallBack() {
- new ServerPushRenderer().render();
+ private static void renderServerPush( Display display ) {
+ ServerPushRenderer serverPushRenderer = new ServerPushRenderer();
+ if( display.isDisposed() ) {
+ serverPushRenderer.renderActivation( false );
+ } else {
+ serverPushRenderer.render();
+ }
}
private static void renderEnableUiTests( Display display ) {
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/ServerPushRenderer.java b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/ServerPushRenderer.java
index b6cefe594d..336f609e7f 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/ServerPushRenderer.java
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/displaykit/ServerPushRenderer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 EclipseSource and others.
+ * Copyright (c) 2012, 2017 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,7 +63,7 @@ public class ServerPushRenderer {
return preserved != null ? preserved.booleanValue() : false;
}
- private static void renderActivation( boolean activation ) {
+ void renderActivation( boolean activation ) {
ProtocolMessageWriter writer = ContextProvider.getProtocolWriter();
writer.appendSet( REMOTE_OBJECT_ID, PROP_ACTIVE, activation );
}

Back to the top