Rename [IsolatedApplication] blink attribute to [IsolatedContext]
This blink attribute currently directly maps to the isolated application isolation level. We would like to enable IWA APIs in Chrome Apps without turning them into IWAs (the last attempt at crrev.com/c/3817183 proved unreliable), therefore it's necessary to decouple the API guard from IWAs. Bug: 1371797 Change-Id: Ie8d7476ce278b832aa15b649f71a0cc46f3a7b76 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3955718 Reviewed-by: Yuki Shiino <yukishiino@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Commit-Queue: Alex Moshchuk <alexmos@chromium.org> Auto-Submit: Andrew Rayskiy <greengrape@google.com> Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Robbie McElrath <rmcelrath@chromium.org> Cr-Commit-Position: refs/heads/main@{#1061720}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
3c51322224
commit
9edb7e2aed
content
browser
renderer_host
common
renderer
third_party/blink
public
web
renderer
bindings
controller
core
execution_context
frame
layout
testing
workers
dedicated_worker.ccdedicated_worker_global_scope.ccdedicated_worker_global_scope.hglobal_scope_creation_params.ccglobal_scope_creation_params.hshared_worker_global_scope.ccshared_worker_global_scope.hthreaded_worklet_messaging_proxy.ccworker_thread_test_helper.hworklet_global_scope.ccworklet_global_scope.h
modules
csspaint
direct_sockets
exported
service_worker
@ -3091,7 +3091,7 @@ void RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate() {
|
||||
GetContentClient()->browser()->IsIsolatedAppsDeveloperModeAllowed(
|
||||
GetBrowserContext());
|
||||
|
||||
GetRendererInterface()->SetIsIsolatedApplication(
|
||||
GetRendererInterface()->SetIsIsolatedContext(
|
||||
isolated_apps_developer_mode_allowed &&
|
||||
process_lock.GetWebExposedIsolationInfo().is_isolated_application());
|
||||
|
||||
|
@ -154,13 +154,12 @@ interface Renderer {
|
||||
// This is called at most once, prior to committing a navigation.
|
||||
SetIsCrossOriginIsolated(bool value);
|
||||
|
||||
// Set whether this renderer process has the "isolated application" isolation
|
||||
// level. Similarly to the `SetIsCrossOriginIsolated()` method above, this
|
||||
// flag is process global, and called at most once, prior to committing a
|
||||
// navigation.
|
||||
// Set whether this renderer process is allowed to use Isolated Context APIs.
|
||||
// Similarly to the `SetIsCrossOriginIsolated()` method above, this flag is
|
||||
// process global, and called at most once, prior to committing a navigation.
|
||||
//
|
||||
// TODO(crbug.com/1206150): We need a specification for this restriction.
|
||||
SetIsIsolatedApplication(bool value);
|
||||
SetIsIsolatedContext(bool value);
|
||||
|
||||
// Initialize renderer user agent string, user agent metadata and CORS exempt
|
||||
// header list on renderer startup.
|
||||
|
@ -1383,8 +1383,8 @@ void RenderThreadImpl::SetIsCrossOriginIsolated(bool value) {
|
||||
blink::SetIsCrossOriginIsolated(value);
|
||||
}
|
||||
|
||||
void RenderThreadImpl::SetIsIsolatedApplication(bool value) {
|
||||
blink::SetIsIsolatedApplication(value);
|
||||
void RenderThreadImpl::SetIsIsolatedContext(bool value) {
|
||||
blink::SetIsIsolatedContext(value);
|
||||
}
|
||||
|
||||
void RenderThreadImpl::CompositingModeFallbackToSoftware() {
|
||||
|
@ -442,7 +442,7 @@ class CONTENT_EXPORT RenderThreadImpl
|
||||
WriteClangProfilingProfileCallback callback) override;
|
||||
#endif
|
||||
void SetIsCrossOriginIsolated(bool value) override;
|
||||
void SetIsIsolatedApplication(bool value) override;
|
||||
void SetIsIsolatedContext(bool value) override;
|
||||
void OnMemoryPressure(
|
||||
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
|
||||
|
||||
|
9
third_party/blink/public/web/blink.h
vendored
9
third_party/blink/public/web/blink.h
vendored
@ -122,13 +122,12 @@ BLINK_EXPORT void ForceNextDrawingBufferCreationToFailForTest();
|
||||
// This is called at most once. This is called earlier than any frame commit.
|
||||
BLINK_EXPORT void SetIsCrossOriginIsolated(bool value);
|
||||
|
||||
// Set whether this renderer process has the "isolated application" isolation
|
||||
// level. Similarly to the `SetIsCrossOriginIsolated()` method above, this
|
||||
// flag is process global, and called at most once, prior to committing a
|
||||
// frame.
|
||||
// Set whether this renderer process is allowed to use Isolated Context APIs.
|
||||
// Similarly to the `SetIsCrossOriginIsolated()` method above, this flag is
|
||||
// process global, and called at most once, prior to committing a frame.
|
||||
//
|
||||
// TODO(mkwst): We need a specification for this restriction.
|
||||
BLINK_EXPORT void SetIsIsolatedApplication(bool value);
|
||||
BLINK_EXPORT void SetIsIsolatedContext(bool value);
|
||||
|
||||
} // namespace blink
|
||||
|
||||
|
@ -1606,17 +1606,17 @@ In case of `func1(...)`, if JavaScript calls `func1(100, 200)`, then `HTMLFoo::f
|
||||
In case of `func2(...)` which adds `[DefaultValue=Undefined]`, if JavaScript calls `func2(100, 200)`, then it behaves as if JavaScript called `func2(100, 200, undefined)`. Consequently, `HTMLFoo::func2(int a, int b, int c)` is called in Blink. 100 is passed to `a`, 200 is passed to `b`, and 0 is passed to `c`. (A JavaScript `undefined` is converted to 0, following the value conversion rule in the Web IDL spec; if it were a DOMString parameter, it would end up as the string `"undefined"`.) In this way, Blink needs to just implement `func2(int a, int b, int c)` and needs not to implement both `func2(int a, int b)` and `func2(int a, int b, int c)`.
|
||||
|
||||
|
||||
### [IsolatedApplication] _(a, i, m)_
|
||||
### [IsolatedContext] _(a, i, m)_
|
||||
|
||||
Summary: Interfaces and interface members with a `IsolatedApplication` extended attribute are exposed only inside contexts with isolated application isolation level.
|
||||
See [explainer](https://github.com/reillyeon/isolated-web-apps) for more details.
|
||||
Summary: Interfaces and interface members with a `IsolatedContext` extended attribute are exposed only inside isolated contexts.
|
||||
This attribute is primarily intended for Isolated Apps (see [explainer](https://github.com/reillyeon/isolated-web-apps)) with an option for the embedder to include their own additional scenarios.
|
||||
|
||||
Note that it's likely for these requirements to shift over time: <https://crbug.com/1206150>.
|
||||
|
||||
Usage: The `[IsolatedApplication]` extended attribute may be specified on interfaces, attributes, and operations:
|
||||
Usage: The `[IsolatedContext]` extended attribute may be specified on interfaces, attributes, and operations:
|
||||
|
||||
```webidl
|
||||
[IsolatedApplication]
|
||||
[IsolatedContext]
|
||||
interface TCPSocket {
|
||||
...
|
||||
};
|
||||
|
@ -62,7 +62,7 @@ HTMLConstructor
|
||||
ImmutablePrototype
|
||||
ImplementedAs=*
|
||||
IsCodeLike
|
||||
IsolatedApplication
|
||||
IsolatedContext
|
||||
LegacyLenientSetter
|
||||
LegacyLenientThis
|
||||
LegacyNoInterfaceObject
|
||||
|
@ -181,7 +181,7 @@ def expr_from_exposure(exposure,
|
||||
# feature_selector-2nd-phase-term))
|
||||
# which can be represented in more details as:
|
||||
# (and cross_origin_isolated_term
|
||||
# isolated_application_term
|
||||
# isolated_context_term
|
||||
# secure_context_term
|
||||
# uncond_exposed_term
|
||||
# (or
|
||||
@ -193,7 +193,7 @@ def expr_from_exposure(exposure,
|
||||
# feature_selector_term)))
|
||||
# where
|
||||
# cross_origin_isolated_term represents [CrossOriginIsolated]
|
||||
# isolated_application_term represents [IsolatedApplication]
|
||||
# isolated_context_term represents [IsolatedContext]
|
||||
# secure_context_term represents [SecureContext=F1]
|
||||
# uncond_exposed_term represents [Exposed=(G1, G2)]
|
||||
# cond_exposed_term represents [Exposed(G1 F1, G2 F2)]
|
||||
@ -226,11 +226,11 @@ def expr_from_exposure(exposure,
|
||||
else:
|
||||
cross_origin_isolated_term = _Expr(True)
|
||||
|
||||
# [IsolatedApplication]
|
||||
if exposure.only_in_isolated_application_contexts:
|
||||
isolated_application_term = _Expr("${is_isolated_application}")
|
||||
# [IsolatedContext]
|
||||
if exposure.only_in_isolated_contexts:
|
||||
isolated_context_term = _Expr("${is_in_isolated_context}")
|
||||
else:
|
||||
isolated_application_term = _Expr(True)
|
||||
isolated_context_term = _Expr(True)
|
||||
|
||||
# [SecureContext]
|
||||
if exposure.only_in_secure_contexts is True:
|
||||
@ -314,7 +314,7 @@ def expr_from_exposure(exposure,
|
||||
# Build an expression.
|
||||
top_level_terms = []
|
||||
top_level_terms.append(cross_origin_isolated_term)
|
||||
top_level_terms.append(isolated_application_term)
|
||||
top_level_terms.append(isolated_context_term)
|
||||
top_level_terms.append(secure_context_term)
|
||||
if uncond_exposed_terms:
|
||||
top_level_terms.append(expr_or(uncond_exposed_terms))
|
||||
|
@ -215,9 +215,9 @@ def bind_local_vars(code_node, cg_context):
|
||||
S("is_cross_origin_isolated",
|
||||
("const bool ${is_cross_origin_isolated} = "
|
||||
"${execution_context}->CrossOriginIsolatedCapability();")),
|
||||
S("is_isolated_application",
|
||||
("const bool ${is_isolated_application} = "
|
||||
"${execution_context}->IsolatedApplicationCapability();")),
|
||||
S("is_in_isolated_context",
|
||||
("const bool ${is_in_isolated_context} = "
|
||||
"${execution_context}->IsIsolatedContext();")),
|
||||
S("is_in_secure_context",
|
||||
("const bool ${is_in_secure_context} = "
|
||||
"${execution_context}->IsSecureContext();")),
|
||||
|
@ -1962,7 +1962,7 @@ EventListener* event_handler = JSEventHandler::CreateOrNull(
|
||||
elif key == "Reflect":
|
||||
has_reflect = True
|
||||
elif key in ("Affects", "CrossOriginIsolated", "DeprecateAs",
|
||||
"Exposed", "IsolatedApplication", "LogActivity",
|
||||
"Exposed", "IsolatedContext", "LogActivity",
|
||||
"LogAllWorlds", "Measure", "MeasureAs",
|
||||
"ReflectEmpty", "ReflectInvalid", "ReflectMissing",
|
||||
"ReflectOnly", "RuntimeCallStatsCounter",
|
||||
@ -4769,9 +4769,9 @@ def bind_installer_local_vars(code_node, cg_context):
|
||||
S("is_cross_origin_isolated",
|
||||
("const bool ${is_cross_origin_isolated} = "
|
||||
"${execution_context}->CrossOriginIsolatedCapability();")),
|
||||
S("is_isolated_application",
|
||||
("const bool ${is_isolated_application} = "
|
||||
"${execution_context}->IsolatedApplicationCapability();")),
|
||||
S("is_in_isolated_context",
|
||||
("const bool ${is_in_isolated_context} = "
|
||||
"${execution_context}->IsIsolatedContext();")),
|
||||
S("is_in_secure_context",
|
||||
("const bool ${is_in_secure_context} = "
|
||||
"${execution_context}->IsSecureContext();")),
|
||||
|
@ -59,8 +59,7 @@ class Exposure(object):
|
||||
self._context_enabled_features = tuple(
|
||||
other.context_enabled_features)
|
||||
self._only_in_coi_contexts = other.only_in_coi_contexts
|
||||
self._only_in_isolated_application_contexts = (
|
||||
other.only_in_isolated_application_contexts)
|
||||
self._only_in_isolated_contexts = (other.only_in_isolated_contexts)
|
||||
self._only_in_secure_contexts = other.only_in_secure_contexts
|
||||
else:
|
||||
self._global_names_and_features = tuple()
|
||||
@ -69,7 +68,7 @@ class Exposure(object):
|
||||
self._context_dependent_runtime_enabled_features = tuple()
|
||||
self._context_enabled_features = tuple()
|
||||
self._only_in_coi_contexts = False
|
||||
self._only_in_isolated_application_contexts = False
|
||||
self._only_in_isolated_contexts = False
|
||||
self._only_in_secure_contexts = None
|
||||
|
||||
@property
|
||||
@ -118,7 +117,7 @@ class Exposure(object):
|
||||
return self._only_in_coi_contexts
|
||||
|
||||
@property
|
||||
def only_in_isolated_application_contexts(self):
|
||||
def only_in_isolated_contexts(self):
|
||||
"""
|
||||
Returns whether this construct is available only in isolated app
|
||||
contexts. The returned value is a boolean: True if the construct
|
||||
@ -126,7 +125,7 @@ class Exposure(object):
|
||||
|
||||
TODO(crbug.com/1206150): This needs a specification (and definition).
|
||||
"""
|
||||
return self._only_in_isolated_application_contexts
|
||||
return self._only_in_isolated_contexts
|
||||
|
||||
@property
|
||||
def only_in_secure_contexts(self):
|
||||
@ -156,7 +155,7 @@ class Exposure(object):
|
||||
|
||||
if (self.context_dependent_runtime_enabled_features
|
||||
or self.context_enabled_features or self.only_in_coi_contexts
|
||||
or self.only_in_isolated_application_contexts
|
||||
or self.only_in_isolated_contexts
|
||||
or self.only_in_secure_contexts):
|
||||
return True
|
||||
|
||||
@ -182,7 +181,7 @@ class ExposureMutable(Exposure):
|
||||
self._context_dependent_runtime_enabled_features = []
|
||||
self._context_enabled_features = []
|
||||
self._only_in_coi_contexts = False
|
||||
self._only_in_isolated_application_contexts = False
|
||||
self._only_in_isolated_contexts = False
|
||||
self._only_in_secure_contexts = None
|
||||
|
||||
def __getstate__(self):
|
||||
@ -212,9 +211,9 @@ class ExposureMutable(Exposure):
|
||||
assert isinstance(value, bool)
|
||||
self._only_in_coi_contexts = value
|
||||
|
||||
def set_only_in_isolated_application_contexts(self, value):
|
||||
def set_only_in_isolated_contexts(self, value):
|
||||
assert isinstance(value, bool)
|
||||
self._only_in_isolated_application_contexts = value
|
||||
self._only_in_isolated_contexts = value
|
||||
|
||||
def set_only_in_secure_contexts(self, value):
|
||||
assert (isinstance(value, (bool, str))
|
||||
|
@ -227,8 +227,7 @@ class IdlCompiler(object):
|
||||
propagate(('ContextEnabled', 'add_context_enabled_feature'))
|
||||
propagate(('CrossOriginIsolated', 'set_only_in_coi_contexts'),
|
||||
default_value=True)
|
||||
propagate(('IsolatedApplication',
|
||||
'set_only_in_isolated_application_contexts'),
|
||||
propagate(('IsolatedContext', 'set_only_in_isolated_contexts'),
|
||||
default_value=True)
|
||||
propagate(('SecureContext', 'set_only_in_secure_contexts'),
|
||||
default_value=True)
|
||||
@ -527,9 +526,9 @@ class IdlCompiler(object):
|
||||
|
||||
def _propagate_extattrs_to_overload_group(self):
|
||||
ANY_OF = ('CrossOrigin', 'CrossOriginIsolated', 'Custom',
|
||||
'IsolatedApplication', 'LegacyLenientThis',
|
||||
'LegacyUnforgeable', 'NoAllocDirectCall', 'NotEnumerable',
|
||||
'PerWorldBindings', 'SecureContext', 'Unscopable')
|
||||
'IsolatedContext', 'LegacyLenientThis', 'LegacyUnforgeable',
|
||||
'NoAllocDirectCall', 'NotEnumerable', 'PerWorldBindings',
|
||||
'SecureContext', 'Unscopable')
|
||||
|
||||
old_irs = self._ir_map.irs_of_kinds(IRMap.IR.Kind.INTERFACE,
|
||||
IRMap.IR.Kind.NAMESPACE)
|
||||
@ -610,13 +609,12 @@ class IdlCompiler(object):
|
||||
else:
|
||||
group.exposure.set_only_in_coi_contexts(True)
|
||||
|
||||
# [IsolatedApplication]
|
||||
if any(not exposure.only_in_isolated_application_contexts
|
||||
# [IsolatedContext]
|
||||
if any(not exposure.only_in_isolated_contexts
|
||||
for exposure in exposures):
|
||||
pass # Exposed by default.
|
||||
else:
|
||||
group.exposure.set_only_in_isolated_application_contexts(
|
||||
True)
|
||||
group.exposure.set_only_in_isolated_contexts(True)
|
||||
|
||||
# [SecureContext]
|
||||
if any(exposure.only_in_secure_contexts is False
|
||||
|
@ -218,8 +218,8 @@ void SetIsCrossOriginIsolated(bool value) {
|
||||
}
|
||||
|
||||
// Function defined in third_party/blink/public/web/blink.h.
|
||||
void SetIsIsolatedApplication(bool value) {
|
||||
Agent::SetIsIsolatedApplication(value);
|
||||
void SetIsIsolatedContext(bool value) {
|
||||
Agent::SetIsIsolatedContext(value);
|
||||
}
|
||||
|
||||
void BlinkInitializer::RegisterInterfaces(mojo::BinderMap& binders) {
|
||||
|
@ -14,11 +14,11 @@ namespace blink {
|
||||
|
||||
namespace {
|
||||
bool is_cross_origin_isolated = false;
|
||||
bool is_isolated_application = false;
|
||||
bool is_isolated_context = false;
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
bool is_cross_origin_isolated_set = false;
|
||||
bool is_isolated_application_set = false;
|
||||
bool is_isolated_context_set = false;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
@ -71,18 +71,18 @@ void Agent::SetIsCrossOriginIsolated(bool value) {
|
||||
}
|
||||
|
||||
// static
|
||||
bool Agent::IsIsolatedApplication() {
|
||||
return is_isolated_application;
|
||||
bool Agent::IsIsolatedContext() {
|
||||
return is_isolated_context;
|
||||
}
|
||||
|
||||
// static
|
||||
void Agent::SetIsIsolatedApplication(bool value) {
|
||||
void Agent::SetIsIsolatedContext(bool value) {
|
||||
#if DCHECK_IS_ON()
|
||||
if (is_isolated_application_set)
|
||||
DCHECK_EQ(is_isolated_application, value);
|
||||
is_isolated_application_set = true;
|
||||
if (is_isolated_context_set)
|
||||
DCHECK_EQ(is_isolated_context, value);
|
||||
is_isolated_context_set = true;
|
||||
#endif
|
||||
is_isolated_application = value;
|
||||
is_isolated_context = value;
|
||||
}
|
||||
|
||||
bool Agent::IsOriginKeyed() const {
|
||||
|
@ -71,9 +71,9 @@ class CORE_EXPORT Agent : public GarbageCollected<Agent>,
|
||||
//
|
||||
// TODO(mkwst): We need a specification for these restrictions:
|
||||
// https://crbug.com/1206150.
|
||||
static bool IsIsolatedApplication();
|
||||
// Only called from blink::SetIsIsolatedApplication.
|
||||
static void SetIsIsolatedApplication(bool value);
|
||||
static bool IsIsolatedContext();
|
||||
// Only called from blink::SetIsIsolatedContext.
|
||||
static void SetIsIsolatedContext(bool value);
|
||||
|
||||
// Representing agent cluster's "is origin-keyed" concept:
|
||||
// https://html.spec.whatwg.org/C/#is-origin-keyed
|
||||
|
@ -399,11 +399,10 @@ class CORE_EXPORT ExecutionContext : public Supplementable<ExecutionContext>,
|
||||
virtual bool CrossOriginIsolatedCapability() const = 0;
|
||||
|
||||
// Returns true if scripts within this ExecutionContext are allowed to use
|
||||
// APIs that require the page to be part of an isolated application.
|
||||
// https://github.com/reillyeon/isolated-web-apps
|
||||
// Trusted Context APIs (i.e. annotated with [IsolatedContext] IDL attribute).
|
||||
//
|
||||
// TODO(mkwst): We need a specification for the necessary restrictions.
|
||||
virtual bool IsolatedApplicationCapability() const = 0;
|
||||
virtual bool IsIsolatedContext() const = 0;
|
||||
|
||||
// Returns true if SharedArrayBuffers can be transferred via PostMessage,
|
||||
// false otherwise. SharedArrayBuffer allows pages to craft high-precision
|
||||
|
@ -2310,8 +2310,8 @@ bool LocalDOMWindow::CrossOriginIsolatedCapability() const {
|
||||
mojom::blink::PermissionsPolicyFeature::kCrossOriginIsolated);
|
||||
}
|
||||
|
||||
bool LocalDOMWindow::IsolatedApplicationCapability() const {
|
||||
return Agent::IsIsolatedApplication();
|
||||
bool LocalDOMWindow::IsIsolatedContext() const {
|
||||
return Agent::IsIsolatedContext();
|
||||
}
|
||||
|
||||
ukm::UkmRecorder* LocalDOMWindow::UkmRecorder() {
|
||||
|
@ -452,7 +452,7 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow,
|
||||
void ClearIsolatedWorldCSPForTesting(int32_t world_id);
|
||||
|
||||
bool CrossOriginIsolatedCapability() const override;
|
||||
bool IsolatedApplicationCapability() const override;
|
||||
bool IsIsolatedContext() const override;
|
||||
|
||||
// These delegate to the document_.
|
||||
ukm::UkmRecorder* UkmRecorder() override;
|
||||
|
@ -42,9 +42,9 @@ LayoutWorkletGlobalScopeProxy::LayoutWorkletGlobalScopeProxy(
|
||||
const String user_agent =
|
||||
RuntimeEnabledFeatures::SendFullUserAgentAfterReductionEnabled(window)
|
||||
? frame_client->FullUserAgent()
|
||||
: RuntimeEnabledFeatures::UserAgentReductionEnabled(window)
|
||||
? frame_client->ReducedUserAgent()
|
||||
: frame_client->UserAgent();
|
||||
: RuntimeEnabledFeatures::UserAgentReductionEnabled(window)
|
||||
? frame_client->ReducedUserAgent()
|
||||
: frame_client->UserAgent();
|
||||
|
||||
auto creation_params = std::make_unique<GlobalScopeCreationParams>(
|
||||
window->Url(), mojom::blink::ScriptType::kModule, global_scope_name,
|
||||
@ -64,8 +64,7 @@ LayoutWorkletGlobalScopeProxy::LayoutWorkletGlobalScopeProxy(
|
||||
mojo::NullRemote() /* blob_url_store */, BeginFrameProviderParams(),
|
||||
nullptr /* parent_permissions_policy */, window->GetAgentClusterID(),
|
||||
ukm::kInvalidSourceId, window->GetExecutionContextToken(),
|
||||
window->CrossOriginIsolatedCapability(),
|
||||
window->IsolatedApplicationCapability());
|
||||
window->CrossOriginIsolatedCapability(), window->IsIsolatedContext());
|
||||
global_scope_ = LayoutWorkletGlobalScope::Create(
|
||||
frame, std::move(creation_params), *reporting_proxy_,
|
||||
pending_layout_registry);
|
||||
|
@ -52,7 +52,7 @@ class NullExecutionContext : public GarbageCollected<NullExecutionContext>,
|
||||
|
||||
ResourceFetcher* Fetcher() override { return nullptr; }
|
||||
bool CrossOriginIsolatedCapability() const override { return false; }
|
||||
bool IsolatedApplicationCapability() const override { return false; }
|
||||
bool IsIsolatedContext() const override { return false; }
|
||||
ukm::UkmRecorder* UkmRecorder() override { return nullptr; }
|
||||
ukm::SourceId UkmSourceID() const override { return ukm::kInvalidSourceId; }
|
||||
FrameOrWorkerScheduler* GetScheduler() override;
|
||||
|
@ -507,7 +507,7 @@ DedicatedWorker::CreateGlobalScopeCreationParams(
|
||||
execution_context->GetAgentClusterID(), execution_context->UkmSourceID(),
|
||||
execution_context->GetExecutionContextToken(),
|
||||
execution_context->CrossOriginIsolatedCapability(),
|
||||
execution_context->IsolatedApplicationCapability(),
|
||||
execution_context->IsIsolatedContext(),
|
||||
/*interface_registry=*/nullptr,
|
||||
std::move(agent_group_scheduler_compositor_task_runner));
|
||||
}
|
||||
|
@ -81,16 +81,16 @@ DedicatedWorkerGlobalScope* DedicatedWorkerGlobalScope::Create(
|
||||
creation_params->referrer_policy;
|
||||
const bool parent_cross_origin_isolated_capability =
|
||||
creation_params->parent_cross_origin_isolated_capability;
|
||||
const bool parent_isolated_application_capability =
|
||||
creation_params->parent_isolated_application_capability;
|
||||
const bool parent_is_isolated_context =
|
||||
creation_params->parent_is_isolated_context;
|
||||
|
||||
Vector<network::mojom::blink::ContentSecurityPolicyPtr> response_csp =
|
||||
std::move(creation_params->response_content_security_policies);
|
||||
auto* global_scope = MakeGarbageCollected<DedicatedWorkerGlobalScope>(
|
||||
std::move(creation_params), thread, time_origin,
|
||||
std::move(inherited_trial_features), begin_frame_provider_params,
|
||||
parent_cross_origin_isolated_capability,
|
||||
parent_isolated_application_capability, std::move(dedicated_worker_host),
|
||||
parent_cross_origin_isolated_capability, parent_is_isolated_context,
|
||||
std::move(dedicated_worker_host),
|
||||
std::move(back_forward_cache_controller_host));
|
||||
|
||||
if (global_scope->IsOffMainThreadScriptFetchDisabled()) {
|
||||
@ -130,7 +130,7 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(
|
||||
std::unique_ptr<Vector<OriginTrialFeature>> inherited_trial_features,
|
||||
const BeginFrameProviderParams& begin_frame_provider_params,
|
||||
bool parent_cross_origin_isolated_capability,
|
||||
bool parent_isolated_application_capability,
|
||||
bool parent_is_isolated_context,
|
||||
mojo::PendingRemote<mojom::blink::DedicatedWorkerHost>
|
||||
dedicated_worker_host,
|
||||
mojo::PendingRemote<mojom::blink::BackForwardCacheControllerHost>
|
||||
@ -142,7 +142,7 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(
|
||||
std::move(inherited_trial_features),
|
||||
begin_frame_provider_params,
|
||||
parent_cross_origin_isolated_capability,
|
||||
parent_isolated_application_capability,
|
||||
parent_is_isolated_context,
|
||||
std::move(dedicated_worker_host),
|
||||
std::move(back_forward_cache_controller_host)) {}
|
||||
|
||||
@ -153,7 +153,7 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(
|
||||
std::unique_ptr<Vector<OriginTrialFeature>> inherited_trial_features,
|
||||
const BeginFrameProviderParams& begin_frame_provider_params,
|
||||
bool parent_cross_origin_isolated_capability,
|
||||
bool parent_isolated_application_capability,
|
||||
bool parent_is_isolated_context,
|
||||
mojo::PendingRemote<mojom::blink::DedicatedWorkerHost>
|
||||
dedicated_worker_host,
|
||||
mojo::PendingRemote<mojom::blink::BackForwardCacheControllerHost>
|
||||
@ -165,7 +165,7 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(
|
||||
token_(thread->WorkerObjectProxy().token()),
|
||||
parent_token_(parsed_creation_params.parent_context_token),
|
||||
cross_origin_isolated_capability_(Agent::IsCrossOriginIsolated()),
|
||||
isolated_application_capability_(Agent::IsIsolatedApplication()),
|
||||
is_isolated_context_(Agent::IsIsolatedContext()),
|
||||
animation_frame_provider_(
|
||||
MakeGarbageCollected<WorkerAnimationFrameProvider>(
|
||||
this,
|
||||
@ -179,8 +179,8 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(
|
||||
}
|
||||
|
||||
// TODO(mkwst): This needs a specification.
|
||||
if (!parent_isolated_application_capability) {
|
||||
isolated_application_capability_ = false;
|
||||
if (!parent_is_isolated_context) {
|
||||
is_isolated_context_ = false;
|
||||
}
|
||||
|
||||
// Dedicated workers don't need to pause after script fetch.
|
||||
@ -254,7 +254,7 @@ void DedicatedWorkerGlobalScope::Initialize(
|
||||
cross_origin_isolated_capability_ = false;
|
||||
|
||||
// TODO(mkwst): This needs a spec.
|
||||
isolated_application_capability_ = false;
|
||||
is_isolated_context_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,9 +165,7 @@ class CORE_EXPORT DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
|
||||
bool CrossOriginIsolatedCapability() const final {
|
||||
return cross_origin_isolated_capability_;
|
||||
}
|
||||
bool IsolatedApplicationCapability() const final {
|
||||
return isolated_application_capability_;
|
||||
}
|
||||
bool IsIsolatedContext() const final { return is_isolated_context_; }
|
||||
ExecutionContextToken GetExecutionContextToken() const final {
|
||||
return token_;
|
||||
}
|
||||
@ -200,7 +198,7 @@ class CORE_EXPORT DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
|
||||
std::unique_ptr<Vector<OriginTrialFeature>> inherited_trial_features,
|
||||
const BeginFrameProviderParams& begin_frame_provider_params,
|
||||
bool parent_cross_origin_isolated_capability,
|
||||
bool isolated_application_capability,
|
||||
bool is_isolated_context,
|
||||
mojo::PendingRemote<mojom::blink::DedicatedWorkerHost>
|
||||
dedicated_worker_host,
|
||||
mojo::PendingRemote<mojom::blink::BackForwardCacheControllerHost>
|
||||
@ -218,7 +216,7 @@ class CORE_EXPORT DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
|
||||
// The ID of the parent context that owns this worker.
|
||||
const ExecutionContextToken parent_token_;
|
||||
bool cross_origin_isolated_capability_;
|
||||
bool isolated_application_capability_;
|
||||
bool is_isolated_context_;
|
||||
Member<WorkerAnimationFrameProvider> animation_frame_provider_;
|
||||
RejectCoepUnsafeNone reject_coep_unsafe_none_ = RejectCoepUnsafeNone(false);
|
||||
|
||||
|
@ -45,7 +45,7 @@ GlobalScopeCreationParams::GlobalScopeCreationParams(
|
||||
ukm::SourceId ukm_source_id,
|
||||
const absl::optional<ExecutionContextToken>& parent_context_token,
|
||||
bool parent_cross_origin_isolated_capability,
|
||||
bool parent_isolated_application_capability,
|
||||
bool parent_is_isolated_context,
|
||||
InterfaceRegistry* interface_registry,
|
||||
scoped_refptr<base::SingleThreadTaskRunner>
|
||||
agent_group_scheduler_compositor_task_runner)
|
||||
@ -84,8 +84,7 @@ GlobalScopeCreationParams::GlobalScopeCreationParams(
|
||||
parent_context_token(parent_context_token),
|
||||
parent_cross_origin_isolated_capability(
|
||||
parent_cross_origin_isolated_capability),
|
||||
parent_isolated_application_capability(
|
||||
parent_isolated_application_capability),
|
||||
parent_is_isolated_context(parent_is_isolated_context),
|
||||
interface_registry(interface_registry),
|
||||
agent_group_scheduler_compositor_task_runner(
|
||||
std::move(agent_group_scheduler_compositor_task_runner)) {
|
||||
|
@ -78,7 +78,7 @@ struct CORE_EXPORT GlobalScopeCreationParams final {
|
||||
const absl::optional<ExecutionContextToken>& parent_context_token =
|
||||
absl::nullopt,
|
||||
bool parent_cross_origin_isolated_capability = false,
|
||||
bool parent_isolated_application_capability = false,
|
||||
bool parent_is_isolated_context = false,
|
||||
InterfaceRegistry* interface_registry = nullptr,
|
||||
scoped_refptr<base::SingleThreadTaskRunner>
|
||||
agent_group_scheduler_compositor_task_runner = nullptr);
|
||||
@ -205,7 +205,7 @@ struct CORE_EXPORT GlobalScopeCreationParams final {
|
||||
// when no parent exists.
|
||||
//
|
||||
// TODO(crbug.com/1206150): We need a specification for this capability.
|
||||
const bool parent_isolated_application_capability;
|
||||
const bool parent_is_isolated_context;
|
||||
|
||||
InterfaceRegistry* const interface_registry;
|
||||
|
||||
|
@ -308,8 +308,8 @@ bool SharedWorkerGlobalScope::CrossOriginIsolatedCapability() const {
|
||||
return Agent::IsCrossOriginIsolated();
|
||||
}
|
||||
|
||||
bool SharedWorkerGlobalScope::IsolatedApplicationCapability() const {
|
||||
return Agent::IsIsolatedApplication();
|
||||
bool SharedWorkerGlobalScope::IsIsolatedContext() const {
|
||||
return Agent::IsIsolatedContext();
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
@ -97,7 +97,7 @@ class CORE_EXPORT SharedWorkerGlobalScope final : public WorkerGlobalScope {
|
||||
const SharedWorkerToken& GetSharedWorkerToken() const { return token_; }
|
||||
WorkerToken GetWorkerToken() const final { return token_; }
|
||||
bool CrossOriginIsolatedCapability() const final;
|
||||
bool IsolatedApplicationCapability() const final;
|
||||
bool IsIsolatedContext() const final;
|
||||
ExecutionContextToken GetExecutionContextToken() const final {
|
||||
return token_;
|
||||
}
|
||||
|
@ -91,8 +91,7 @@ void ThreadedWorkletMessagingProxy::Initialize(
|
||||
BeginFrameProviderParams(), nullptr /* parent_permissions_policy */,
|
||||
window->GetAgentClusterID(), ukm::kInvalidSourceId,
|
||||
window->GetExecutionContextToken(),
|
||||
window->CrossOriginIsolatedCapability(),
|
||||
window->IsolatedApplicationCapability());
|
||||
window->CrossOriginIsolatedCapability(), window->IsIsolatedContext());
|
||||
|
||||
// Worklets share the pre-initialized backing thread so that we don't have to
|
||||
// specify the backing thread startup data.
|
||||
|
@ -122,7 +122,7 @@ class FakeWorkerGlobalScope : public WorkerGlobalScope {
|
||||
// Returns a token uniquely identifying this fake worker.
|
||||
WorkerToken GetWorkerToken() const final { return token_; }
|
||||
bool CrossOriginIsolatedCapability() const final { return false; }
|
||||
bool IsolatedApplicationCapability() const final { return false; }
|
||||
bool IsIsolatedContext() const final { return false; }
|
||||
ExecutionContextToken GetExecutionContextToken() const final {
|
||||
return token_;
|
||||
}
|
||||
|
@ -106,8 +106,7 @@ WorkletGlobalScope::WorkletGlobalScope(
|
||||
creation_params->parent_context_token->GetAs<LocalFrameToken>()),
|
||||
parent_cross_origin_isolated_capability_(
|
||||
creation_params->parent_cross_origin_isolated_capability),
|
||||
parent_isolated_application_capability_(
|
||||
creation_params->parent_isolated_application_capability) {
|
||||
parent_is_isolated_context_(creation_params->parent_is_isolated_context) {
|
||||
DCHECK((thread_type_ == ThreadType::kMainThread && frame_) ||
|
||||
(thread_type_ == ThreadType::kOffMainThread && worker_thread_));
|
||||
|
||||
@ -311,8 +310,8 @@ bool WorkletGlobalScope::CrossOriginIsolatedCapability() const {
|
||||
return parent_cross_origin_isolated_capability_;
|
||||
}
|
||||
|
||||
bool WorkletGlobalScope::IsolatedApplicationCapability() const {
|
||||
return parent_isolated_application_capability_;
|
||||
bool WorkletGlobalScope::IsIsolatedContext() const {
|
||||
return parent_is_isolated_context_;
|
||||
}
|
||||
|
||||
ukm::UkmRecorder* WorkletGlobalScope::UkmRecorder() {
|
||||
|
@ -68,7 +68,7 @@ class CORE_EXPORT WorkletGlobalScope
|
||||
scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(TaskType) final;
|
||||
FrameOrWorkerScheduler* GetScheduler() final;
|
||||
bool CrossOriginIsolatedCapability() const final;
|
||||
bool IsolatedApplicationCapability() const final;
|
||||
bool IsIsolatedContext() const final;
|
||||
ukm::UkmRecorder* UkmRecorder() final;
|
||||
ukm::SourceId UkmSourceID() const final;
|
||||
|
||||
@ -210,7 +210,7 @@ class CORE_EXPORT WorkletGlobalScope
|
||||
// like Direct Sockets if they're made available in Worklets.
|
||||
//
|
||||
// TODO(crbug.com/1206150): We need a spec for this capability.
|
||||
const bool parent_isolated_application_capability_;
|
||||
const bool parent_is_isolated_context_;
|
||||
|
||||
// This is the interface that handles generated code cache
|
||||
// requests both to fetch code cache when loading resources
|
||||
|
@ -40,9 +40,9 @@ PaintWorkletGlobalScopeProxy::PaintWorkletGlobalScopeProxy(
|
||||
const String user_agent =
|
||||
RuntimeEnabledFeatures::SendFullUserAgentAfterReductionEnabled(window)
|
||||
? frame_client->FullUserAgent()
|
||||
: RuntimeEnabledFeatures::UserAgentReductionEnabled(window)
|
||||
? frame_client->ReducedUserAgent()
|
||||
: frame_client->UserAgent();
|
||||
: RuntimeEnabledFeatures::UserAgentReductionEnabled(window)
|
||||
? frame_client->ReducedUserAgent()
|
||||
: frame_client->UserAgent();
|
||||
|
||||
auto creation_params = std::make_unique<GlobalScopeCreationParams>(
|
||||
window->Url(), mojom::blink::ScriptType::kModule, global_scope_name,
|
||||
@ -62,8 +62,7 @@ PaintWorkletGlobalScopeProxy::PaintWorkletGlobalScopeProxy(
|
||||
mojo::NullRemote() /* blob_url_store */, BeginFrameProviderParams(),
|
||||
nullptr /* parent_permissions_policy */, window->GetAgentClusterID(),
|
||||
ukm::kInvalidSourceId, window->GetExecutionContextToken(),
|
||||
window->CrossOriginIsolatedCapability(),
|
||||
window->IsolatedApplicationCapability());
|
||||
window->CrossOriginIsolatedCapability(), window->IsIsolatedContext());
|
||||
global_scope_ = PaintWorkletGlobalScope::Create(
|
||||
frame, std::move(creation_params), *reporting_proxy_);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
ActiveScriptWrappable,
|
||||
SecureContext,
|
||||
RuntimeEnabled=DirectSockets,
|
||||
IsolatedApplication
|
||||
IsolatedContext
|
||||
] interface TCPSocket {
|
||||
[CallWith=ScriptState, RaisesException]
|
||||
constructor(DOMString remoteAddress, unsigned short remotePort, optional TCPSocketOptions options = {});
|
||||
|
@ -9,7 +9,7 @@
|
||||
ActiveScriptWrappable,
|
||||
SecureContext,
|
||||
RuntimeEnabled=DirectSockets,
|
||||
IsolatedApplication
|
||||
IsolatedContext
|
||||
] interface UDPSocket {
|
||||
[CallWith=ScriptState, RaisesException]
|
||||
constructor(UDPSocketOptions options);
|
||||
|
@ -217,7 +217,7 @@ void WebEmbeddedWorkerImpl::StartWorkerThread(
|
||||
worker_start_data->ukm_source_id,
|
||||
absl::nullopt, /* parent_context_token */
|
||||
false, /* parent_cross_origin_isolated_capability */
|
||||
false, /* parent_isolated_application_capability */
|
||||
false, /* parent_is_isolated_context */
|
||||
interface_registry);
|
||||
|
||||
worker_thread_ = std::make_unique<ServiceWorkerThread>(
|
||||
|
@ -803,7 +803,7 @@ bool ServiceWorkerGlobalScope::CrossOriginIsolatedCapability() const {
|
||||
return Agent::IsCrossOriginIsolated();
|
||||
}
|
||||
|
||||
bool ServiceWorkerGlobalScope::IsolatedApplicationCapability() const {
|
||||
bool ServiceWorkerGlobalScope::IsIsolatedContext() const {
|
||||
// TODO(mkwst): Make a decision here, and spec it.
|
||||
return false;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final
|
||||
const ServiceWorkerToken& GetServiceWorkerToken() const { return token_; }
|
||||
WorkerToken GetWorkerToken() const final { return token_; }
|
||||
bool CrossOriginIsolatedCapability() const final;
|
||||
bool IsolatedApplicationCapability() const final;
|
||||
bool IsIsolatedContext() const final;
|
||||
ExecutionContextToken GetExecutionContextToken() const final {
|
||||
return token_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user