@LinkerOrder(value=PRIMARY) @Shardable public class CrossSiteIframeLinker extends SelectionScriptLinker
COMPUTE_SCRIPT_BASE_JS, FRAGMENT_EXTENSION, FRAGMENT_SUBDIR, permutationsUtil, PROCESS_METAS_JS, USE_SOURCE_MAPS_PROPERTY
Constructor and Description |
---|
CrossSiteIframeLinker() |
Modifier and Type | Method and Description |
---|---|
protected String |
fillSelectionScriptTemplate(StringBuffer ss,
TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts,
CompilationResult result)
Generate a selection script.
|
protected boolean |
getBooleanConfigurationProperty(LinkerContext context,
String name,
boolean def) |
protected String |
getCompilationExtension(TreeLogger logger,
LinkerContext context) |
protected String |
getDeferredFragmentSuffix2(TreeLogger logger,
LinkerContext context,
int fragment,
String strongName)
Returns the suffix at the end of a JavaScript fragment other than the initial fragment
(new version).
|
String |
getDescription()
Returns a human-readable String describing the Linker.
|
protected String |
getHostedFilename() |
protected String |
getHostedFilenameFull(LinkerContext context) |
protected String |
getJsComputeScriptBase(LinkerContext context)
Returns the name of the
ComputeScriptBase script. |
protected String |
getJsComputeUrlForResource(LinkerContext context)
Returns the name of the
UrlForResource script. |
protected String |
getJsDevModeRedirectHook(LinkerContext context)
Returns a JavaScript fragment that starts Super Dev Mode, if enabled.
|
protected String |
getJsDevModeRedirectHookPermitted(LinkerContext context)
Returns a JavaScript expression that determines whether Super Dev Mode may be turned on
for the current page.
|
protected 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 String |
getJsInstallLocation(LinkerContext context)
Returns the name of the
JsInstallLocation script. |
protected String |
getJsInstallScript(LinkerContext context)
Returns the name of the
JsInstallScript script. |
protected String |
getJsIsBodyLoaded(LinkerContext context)
Returns the name of the
JsIsBodyLoaded script. |
protected String |
getJsLoadExternalStylesheets(LinkerContext context)
Returns the name of the
JsLoadExternalStylesheets script. |
protected String |
getJsModuleFunctionErrorCatch(LinkerContext context)
Returns the name of the
JsModuleFunctionErrorCatch script. |
protected String |
getJsPermutations(LinkerContext context)
Returns the name of the
JsPermutations script. |
protected String |
getJsProcessMetas(LinkerContext context)
Returns the name of the
JsProcessMetas script. |
protected String |
getJsProperties(LinkerContext context)
Returns the name of the
JsProperties script. |
protected String |
getJsRunAsync(LinkerContext context)
Returns the name of the
JsRunAsync script. |
protected String |
getJsWaitForBodyLoaded(LinkerContext context)
Returns the name of the
JsWaitForBodyLoaded script. |
protected String |
getModulePrefix(TreeLogger logger,
LinkerContext context,
String strongName)
Compute the beginning of a JavaScript file that will hold the main module implementation.
|
protected String |
getModuleSuffix2(TreeLogger logger,
LinkerContext context,
String strongName)
Returns the suffix for the initial JavaScript fragment (new version).
|
protected String |
getScriptChunkSeparator(TreeLogger logger,
LinkerContext context)
Some subclasses support "chunking" of the primary fragment.
|
protected String |
getSelectionScriptTemplate(TreeLogger logger,
LinkerContext context) |
protected String |
getSourceMapUrl(LinkerContext context,
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 String |
getStringConfigurationProperty(LinkerContext context,
String name,
String def) |
protected void |
includeJs(StringBuffer selectionScript,
TreeLogger logger,
String jsSource,
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) |
protected boolean |
shouldUseSelfForWindowAndDocument(LinkerContext context)
Returns whether to use "self" for $wnd and $doc references.
|
protected String |
wrapDeferredFragment(TreeLogger logger,
LinkerContext context,
int fragment,
String js,
ArtifactSet artifacts) |
protected String |
wrapPrimaryFragment(TreeLogger logger,
LinkerContext context,
String script,
ArtifactSet artifacts,
CompilationResult result) |
charsPerChunk, doEmitCompilation, emitSelectionInformation, emitSelectionScript, generateDeferredFragment, generatePrimaryFragment, generatePrimaryFragmentString, generateSelectionScript, generateSelectionScript, getDeferredFragmentPrefix, getDeferredFragmentSuffix, getFragmentSubdir, getModulePrefix, getModuleSuffix, link, link, readFileToStringBuffer, replaceAll, splitPrimaryJavaScript, supportsDevModeInJunit
emitBytes, emitBytes, emitInputStream, emitInputStream, emitString, emitString, emitWithStrongName, emitWithStrongName
isShardable, relink
public String getDescription()
Linker
getDescription
in class Linker
protected String fillSelectionScriptTemplate(StringBuffer ss, TreeLogger logger, LinkerContext context, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
SelectionScriptLinker
PermutationsUtil.setupPermutationsMap(ArtifactSet)
.fillSelectionScriptTemplate
in class SelectionScriptLinker
UnableToCompleteException
protected boolean getBooleanConfigurationProperty(LinkerContext context, String name, boolean def)
protected String getCompilationExtension(TreeLogger logger, LinkerContext context)
getCompilationExtension
in class SelectionScriptLinker
protected String getDeferredFragmentSuffix2(TreeLogger logger, LinkerContext context, int fragment, String strongName)
SelectionScriptLinker
SelectionScriptLinker.getDeferredFragmentSuffix(com.google.gwt.core.ext.TreeLogger, com.google.gwt.core.ext.LinkerContext, int)
is overridden
to return non-null. Subclasses should stop implementing getDeferredFramgnentSuffix and
implement getDeferredFragmentSuffix2 instead.getDeferredFragmentSuffix2
in class SelectionScriptLinker
protected String getHostedFilename()
getHostedFilename
in class SelectionScriptLinker
protected String getHostedFilenameFull(LinkerContext context)
protected String getJsComputeScriptBase(LinkerContext context)
ComputeScriptBase
script. By default,
returns "com/google/gwt/core/ext/linker/impl/computeScriptBase.js"
.context
- a LinkerContextprotected String getJsComputeUrlForResource(LinkerContext context)
UrlForResource
script. By default,
returns "com/google/gwt/core/ext/linker/impl/computeUrlForResource.js"
.context
- a LinkerContextprotected String getJsDevModeRedirectHook(LinkerContext context)
protected String getJsDevModeUrlValidation(LinkerContext context)
protected 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 String getJsInstallLocation(LinkerContext context)
JsInstallLocation
script. By default,
returns "com/google/gwt/core/ext/linker/impl/installLocationIframe.js"
.context
- a LinkerContextprotected String getJsInstallScript(LinkerContext context)
JsInstallScript
script. By default,
returns "com/google/gwt/core/ext/linker/impl/installScriptEarlyDownload.js"
.
If you override this to return installScriptDirect.js
, then you
should also override shouldInstallCode(LinkerContext)
to return
false
.
context
- a LinkerContextprotected String getJsIsBodyLoaded(LinkerContext context)
JsIsBodyLoaded
script. By default,
returns "com/google/gwt/core/ext/linker/impl/isBodyLoaded.js"
.context
- a LinkerContextprotected String getJsLoadExternalStylesheets(LinkerContext context)
JsLoadExternalStylesheets
script. By default,
returns "com/google/gwt/core/ext/linker/impl/loadExternalStylesheets.js"
.context
- a LinkerContextprotected 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 String getJsPermutations(LinkerContext context)
JsPermutations
script. By default,
returns "com/google/gwt/core/ext/linker/impl/permutations.js"
.context
- a LinkerContextprotected String getJsProcessMetas(LinkerContext context)
JsProcessMetas
script. By default,
returns "com/google/gwt/core/ext/linker/impl/processMetas.js"
.context
- a LinkerContextprotected String getJsProperties(LinkerContext context)
JsProperties
script. By default,
returns "com/google/gwt/core/ext/linker/impl/properties.js"
.context
- a LinkerContextprotected String getJsRunAsync(LinkerContext context)
JsRunAsync
script. By default,
returns "com/google/gwt/core/ext/linker/impl/runAsync.js"
.context
- a LinkerContextprotected String getJsWaitForBodyLoaded(LinkerContext context)
JsWaitForBodyLoaded
script. By default,
returns "com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js"
.context
- a LinkerContextprotected String getModulePrefix(TreeLogger logger, LinkerContext context, String strongName) throws UnableToCompleteException
SelectionScriptLinker
getModulePrefix
in class SelectionScriptLinker
UnableToCompleteException
protected String getModuleSuffix2(TreeLogger logger, LinkerContext context, String strongName)
SelectionScriptLinker
SelectionScriptLinker.getModuleSuffix(com.google.gwt.core.ext.TreeLogger, com.google.gwt.core.ext.LinkerContext)
is overridden so that it doesn't return null.
Subclasses should stop implementing getModuleSuffix and implmenet getModuleSuffix2 instead.getModuleSuffix2
in class SelectionScriptLinker
protected String getScriptChunkSeparator(TreeLogger logger, LinkerContext context)
SelectionScriptLinker
getScriptChunkSeparator
in class SelectionScriptLinker
protected String getSelectionScriptTemplate(TreeLogger logger, LinkerContext context)
getSelectionScriptTemplate
in class SelectionScriptLinker
protected String getSourceMapUrl(LinkerContext context, String strongName, int fragmentId)
protected String getStringConfigurationProperty(LinkerContext context, String name, String def)
protected void includeJs(StringBuffer selectionScript, TreeLogger logger, String jsSource, String templateVar) throws UnableToCompleteException
UnableToCompleteException
protected void maybeAddHostedModeFile(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
SelectionScriptLinker
maybeAddHostedModeFile
in class SelectionScriptLinker
UnableToCompleteException
protected void maybeOutputPropertyMap(TreeLogger logger, LinkerContext context, ArtifactSet toReturn)
maybeOutputPropertyMap
in class SelectionScriptLinker
protected boolean shouldIncludeBootstrapInPrimaryFragment(LinkerContext context)
protected boolean shouldInstallCode(LinkerContext context)
protected boolean shouldUseSelfForWindowAndDocument(LinkerContext context)
protected String wrapDeferredFragment(TreeLogger logger, LinkerContext context, int fragment, String js, ArtifactSet artifacts)
wrapDeferredFragment
in class SelectionScriptLinker
protected String wrapPrimaryFragment(TreeLogger logger, LinkerContext context, String script, ArtifactSet artifacts, CompilationResult result) throws UnableToCompleteException
wrapPrimaryFragment
in class SelectionScriptLinker
UnableToCompleteException
Copyright © 2018. All rights reserved.