@LinkerOrder(value=PRIMARY) @Shardable public class CrossSiteIframeLinker extends com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
Constructor and Description |
---|
CrossSiteIframeLinker() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
fillSelectionScriptTemplate(java.lang.StringBuffer ss,
TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts,
CompilationResult result)
Generate a selection script.
|
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)
Returns the suffix at the end of a JavaScript fragment other than the initial fragment.
|
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)
Compute the beginning of a JavaScript file that will hold the main module implementation.
|
protected java.lang.String |
getModuleSuffix2(TreeLogger logger,
LinkerContext context,
java.lang.String strongName)
Returns the suffix for the initial JavaScript fragment.
|
protected java.lang.String |
getScriptChunkSeparator(TreeLogger logger,
LinkerContext context)
Some subclasses support "chunking" of the primary fragment.
|
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)
Add the Development Mode file to the artifact set.
|
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) |
charsPerChunk, doEmitCompilation, emitSelectionInformation, emitSelectionScript, generateDeferredFragment, generatePrimaryFragment, generatePrimaryFragmentString, generateSelectionScript, generateSelectionScript, getDeferredFragmentPrefix, getFragmentSubdir, getModulePrefix, link, link, readFileToStringBuffer, replaceAll, splitPrimaryJavaScript, supportsDevModeInJunit
emitBytes, emitBytes, emitInputStream, emitInputStream, emitString, emitString, emitWithStrongName, emitWithStrongName
isShardable, relink
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
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
PermutationsUtil.setupPermutationsMap(ArtifactSet)
.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)
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
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
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
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)
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
getModuleSuffix2
in class com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
protected java.lang.String getScriptChunkSeparator(TreeLogger logger, LinkerContext context)
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
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
com.google.gwt.core.ext.linker.impl.SelectionScriptLinker
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