|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.ext.Linker com.google.gwt.core.ext.linker.AbstractLinker com.google.gwt.core.ext.linker.impl.SelectionScriptLinker com.google.gwt.core.linker.CrossSiteIframeLinker
@LinkerOrder(value=PRIMARY) @Shardable public class CrossSiteIframeLinker
This linker uses an iframe to hold the code and a script tag to download the code. It can download code cross-site, because it uses a script tag to download it and because it never uses XHR. The iframe, meanwhile, makes it trivial to install additional code as the app runs.
Field Summary |
---|
Fields inherited from class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker |
---|
COMPUTE_SCRIPT_BASE_JS, FRAGMENT_EXTENSION, FRAGMENT_SUBDIR, permutationsUtil, PROCESS_METAS_JS, USE_SOURCE_MAPS_PROPERTY |
Constructor Summary | |
---|---|
CrossSiteIframeLinker()
|
Method Summary | |
---|---|
protected java.lang.String |
fillSelectionScriptTemplate(java.lang.StringBuffer ss,
TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts,
CompilationResult result)
|
protected boolean |
getBooleanConfigurationProperty(LinkerContext context,
java.lang.String name,
boolean def)
|
protected java.lang.String |
getCompilationExtension(TreeLogger logger,
LinkerContext context)
|
protected java.lang.String |
getDeferredFragmentSuffix2(TreeLogger logger,
LinkerContext context,
int fragment,
java.lang.String strongName)
|
java.lang.String |
getDescription()
Returns a human-readable String describing the Linker. |
protected java.lang.String |
getHostedFilename()
|
protected java.lang.String |
getHostedFilenameFull(LinkerContext context)
|
protected java.lang.String |
getJsComputeScriptBase(LinkerContext context)
Returns the name of the ComputeScriptBase script. |
protected java.lang.String |
getJsComputeUrlForResource(LinkerContext context)
Returns the name of the UrlForResource script. |
protected java.lang.String |
getJsDevModeRedirectHook(LinkerContext context)
Returns a JavaScript fragment that starts Super Dev Mode, if enabled. |
protected java.lang.String |
getJsDevModeRedirectHookPermitted(LinkerContext context)
Returns a JavaScript expression that determines whether Super Dev Mode may be turned on for the current page. |
protected java.lang.String |
getJsDevModeUrlValidation(LinkerContext context)
Returns a JavaScript fragment that validates "devModeUrl"—the URL that Super Dev Mode's JavaScript is loaded from—before it's used. |
protected java.lang.String |
getJsInstallLocation(LinkerContext context)
Returns the name of the JsInstallLocation script. |
protected java.lang.String |
getJsInstallScript(LinkerContext context)
Returns the name of the JsInstallScript script. |
protected java.lang.String |
getJsIsBodyLoaded(LinkerContext context)
Returns the name of the JsIsBodyLoaded script. |
protected java.lang.String |
getJsLoadExternalStylesheets(LinkerContext context)
Returns the name of the JsLoadExternalStylesheets script. |
protected java.lang.String |
getJsModuleFunctionErrorCatch(LinkerContext context)
Returns the name of the JsModuleFunctionErrorCatch script. |
protected java.lang.String |
getJsPermutations(LinkerContext context)
Returns the name of the JsPermutations script. |
protected java.lang.String |
getJsProcessMetas(LinkerContext context)
Returns the name of the JsProcessMetas script. |
protected java.lang.String |
getJsProperties(LinkerContext context)
Returns the name of the JsProperties script. |
protected java.lang.String |
getJsRunAsync(LinkerContext context)
Returns the name of the JsRunAsync script. |
protected java.lang.String |
getJsWaitForBodyLoaded(LinkerContext context)
Returns the name of the JsWaitForBodyLoaded script. |
protected java.lang.String |
getModulePrefix(TreeLogger logger,
LinkerContext context,
java.lang.String strongName)
|
protected java.lang.String |
getModuleSuffix2(TreeLogger logger,
LinkerContext context,
java.lang.String strongName)
|
protected java.lang.String |
getScriptChunkSeparator(TreeLogger logger,
LinkerContext context)
|
protected java.lang.String |
getSelectionScriptTemplate(TreeLogger logger,
LinkerContext context)
|
protected java.lang.String |
getSourceMapUrl(LinkerContext context,
java.lang.String strongName,
int fragmentId)
Returns the sourcemap URL that will be put in the comment at the end of a JavaScript fragment, or null if the comment should be omitted. |
protected java.lang.String |
getStringConfigurationProperty(LinkerContext context,
java.lang.String name,
java.lang.String def)
|
protected void |
includeJs(java.lang.StringBuffer selectionScript,
TreeLogger logger,
java.lang.String jsSource,
java.lang.String templateVar)
|
protected void |
maybeAddHostedModeFile(TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts,
CompilationResult result)
|
protected void |
maybeOutputPropertyMap(TreeLogger logger,
LinkerContext context,
ArtifactSet toReturn)
|
protected boolean |
shouldIncludeBootstrapInPrimaryFragment(LinkerContext context)
|
protected boolean |
shouldInstallCode(LinkerContext context)
Determines the strategy for installing JavaScript code into the iframe. |
protected boolean |
shouldUseSelfForWindowAndDocument(LinkerContext context)
Returns whether to use "self" for $wnd and $doc references. |
protected java.lang.String |
wrapDeferredFragment(TreeLogger logger,
LinkerContext context,
int fragment,
java.lang.String js,
ArtifactSet artifacts)
|
protected java.lang.String |
wrapPrimaryFragment(TreeLogger logger,
LinkerContext context,
java.lang.String script,
ArtifactSet artifacts,
CompilationResult result)
|
Methods inherited from class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker |
---|
charsPerChunk, doEmitCompilation, emitSelectionInformation, emitSelectionScript, generateDeferredFragment, generatePrimaryFragment, generatePrimaryFragmentString, generateSelectionScript, generateSelectionScript, getDeferredFragmentPrefix, getDeferredFragmentSuffix, getFragmentSubdir, getModulePrefix, getModuleSuffix, link, link, readFileToStringBuffer, replaceAll, splitPrimaryJavaScript, supportsDevModeInJunit |
Methods inherited from class com.google.gwt.core.ext.linker.AbstractLinker |
---|
emitBytes, emitBytes, emitInputStream, emitInputStream, emitString, emitString, emitWithStrongName, emitWithStrongName |
Methods inherited from class com.google.gwt.core.ext.Linker |
---|
isShardable, relink |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrossSiteIframeLinker()
Method Detail |
---|
public java.lang.String getDescription()
Linker
getDescription
in class Linker
protected java.lang.String fillSelectionScriptTemplate(java.lang.StringBuffer ss, TreeLogger logger, LinkerContext context, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
fillSelectionScriptTemplate
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
UnableToCompleteException
protected boolean getBooleanConfigurationProperty(LinkerContext context, java.lang.String name, boolean def)
protected java.lang.String getCompilationExtension(TreeLogger logger, LinkerContext context)
getCompilationExtension
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getDeferredFragmentSuffix2(TreeLogger logger, LinkerContext context, int fragment, java.lang.String strongName)
getDeferredFragmentSuffix2
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getHostedFilename()
getHostedFilename
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getHostedFilenameFull(LinkerContext context)
protected java.lang.String getJsComputeScriptBase(LinkerContext context)
ComputeScriptBase
script. By default,
returns "com/google/gwt/core/ext/linker/impl/computeScriptBase.js"
.
context
- a LinkerContextprotected java.lang.String getJsComputeUrlForResource(LinkerContext context)
UrlForResource
script. By default,
returns "com/google/gwt/core/ext/linker/impl/computeUrlForResource.js"
.
context
- a LinkerContextprotected java.lang.String getJsDevModeRedirectHook(LinkerContext context)
protected java.lang.String getJsDevModeUrlValidation(LinkerContext context)
protected java.lang.String getJsDevModeRedirectHookPermitted(LinkerContext context)
The default implementation allows Super Dev Mode only on http: and file: pages. It could be overridden to implement a blacklist or whitelist of hostnames where Super Dev Mode may run. As a safety precaution, it's recommended to return false for https and for the hostnames in URL's visited by end users.
If you override this method to allow https, it probably won't work anyway because browsers often disallow loading JavaScript from http URL's into https pages. To make it work, you will also have to find a way to run the code server using https.
protected java.lang.String getJsInstallLocation(LinkerContext context)
JsInstallLocation
script. By default,
returns "com/google/gwt/core/ext/linker/impl/installLocationIframe.js"
.
context
- a LinkerContextprotected java.lang.String getJsInstallScript(LinkerContext context)
JsInstallScript
script. The default is chosen
based on the value of shouldInstallCode(com.google.gwt.core.ext.LinkerContext)
.
If you override this, verify that shouldInstallCode(com.google.gwt.core.ext.LinkerContext)
is
set consistently or fragment loading won't work.
protected java.lang.String getJsIsBodyLoaded(LinkerContext context)
JsIsBodyLoaded
script. By default,
returns "com/google/gwt/core/ext/linker/impl/isBodyLoaded.js"
.
context
- a LinkerContextprotected java.lang.String getJsLoadExternalStylesheets(LinkerContext context)
JsLoadExternalStylesheets
script. By default,
returns "com/google/gwt/core/ext/linker/impl/loadExternalStylesheets.js"
.
context
- a LinkerContextprotected java.lang.String getJsModuleFunctionErrorCatch(LinkerContext context)
JsModuleFunctionErrorCatch
script. By default returns null.
This script executes if there's an error loading the module function or executing it.
The error will be available under a local variable named "moduleError". If non-null, the
module function and the call to the module function will be placed in a try/catch block.
context
- a LinkerContextprotected java.lang.String getJsPermutations(LinkerContext context)
JsPermutations
script. By default,
returns "com/google/gwt/core/ext/linker/impl/permutations.js"
.
context
- a LinkerContextprotected java.lang.String getJsProcessMetas(LinkerContext context)
JsProcessMetas
script. By default,
returns "com/google/gwt/core/ext/linker/impl/processMetas.js"
.
context
- a LinkerContextprotected java.lang.String getJsProperties(LinkerContext context)
JsProperties
script. By default,
returns "com/google/gwt/core/ext/linker/impl/properties.js"
.
context
- a LinkerContextprotected java.lang.String getJsRunAsync(LinkerContext context)
JsRunAsync
script. By default,
returns "com/google/gwt/core/ext/linker/impl/runAsync.js"
.
context
- a LinkerContextprotected java.lang.String getJsWaitForBodyLoaded(LinkerContext context)
JsWaitForBodyLoaded
script. By default,
returns "com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js"
.
context
- a LinkerContextprotected java.lang.String getModulePrefix(TreeLogger logger, LinkerContext context, java.lang.String strongName) throws UnableToCompleteException
getModulePrefix
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
UnableToCompleteException
protected java.lang.String getModuleSuffix2(TreeLogger logger, LinkerContext context, java.lang.String strongName)
getModuleSuffix2
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getScriptChunkSeparator(TreeLogger logger, LinkerContext context)
getScriptChunkSeparator
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getSelectionScriptTemplate(TreeLogger logger, LinkerContext context)
getSelectionScriptTemplate
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getSourceMapUrl(LinkerContext context, java.lang.String strongName, int fragmentId)
protected java.lang.String getStringConfigurationProperty(LinkerContext context, java.lang.String name, java.lang.String def)
protected void includeJs(java.lang.StringBuffer selectionScript, TreeLogger logger, java.lang.String jsSource, java.lang.String templateVar) throws UnableToCompleteException
UnableToCompleteException
protected void maybeAddHostedModeFile(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
maybeAddHostedModeFile
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
UnableToCompleteException
protected void maybeOutputPropertyMap(TreeLogger logger, LinkerContext context, ArtifactSet toReturn)
maybeOutputPropertyMap
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected boolean shouldIncludeBootstrapInPrimaryFragment(LinkerContext context)
protected boolean shouldInstallCode(LinkerContext context)
protected boolean shouldUseSelfForWindowAndDocument(LinkerContext context)
protected java.lang.String wrapDeferredFragment(TreeLogger logger, LinkerContext context, int fragment, java.lang.String js, ArtifactSet artifacts)
wrapDeferredFragment
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String wrapPrimaryFragment(TreeLogger logger, LinkerContext context, java.lang.String script, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
wrapPrimaryFragment
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
UnableToCompleteException
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |