blob: fbfc309ddafc7b01b9391ff332f17046745c9993 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module blink.mojom;
import "third_party/blink/public/mojom/dom_storage/session_storage_namespace.mojom";
import "third_party/blink/public/mojom/dom_storage/storage_area.mojom";
import "url/mojom/origin.mojom";
// This interface is used by renderers to bootstrap their connection to the
// browser's DOM Storage implementation.
interface DomStorageProvider {
// Binds the renderer's main control interface to the DOM Storage
// implementation and provides a client interface the browser can use to call
// back into the renderer.
BindDomStorage(pending_receiver<DomStorage> receiver,
pending_remote<DomStorageClient> client);
};
// The main control interface renderers use to talk to the browser's DOM Storage
// implementation. Each renderer has a single global connection to this
// interface and a corresponding DomStorageClient interface pointing back at the
// renderer.
interface DomStorage {
// Binds to a StorageArea interface for Local Storage within |origin|, which
// must be validated by the browser to ensure the renderer is allowed to
// access that origin's data.
OpenLocalStorage(url.mojom.Origin origin,
pending_receiver<StorageArea> area);
// Binds a control interface for Session Storage within the identified
// namespace.
BindSessionStorageNamespace(
string namespace_id,
pending_receiver<SessionStorageNamespace> receiver);
// Binds to a StorageArea interface for Session Storage within the identified
// namespace and origin. The given origin must be validated by the browser to
// ensure the renderer is allowed to access that origin's data.
BindSessionStorageArea(
url.mojom.Origin origin,
string namespace_id,
pending_receiver<StorageArea> session_namespace);
};
// The main client interface that the browser's DOM Storage implementation can
// use to push notifications to renderers.
interface DomStorageClient {
// Notifies the client that any of its existing StorageArea and
// SessionStorageNamespace connections will no longer function properly (e.g.
// due to a backend crash and recovery) and they should be re-established by
// the client.
ResetStorageAreaAndNamespaceConnections();
};