content_settings_manager.mojom 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module content_settings.mojom;
  5. import "components/content_settings/core/common/content_settings.mojom";
  6. import "services/network/public/mojom/site_for_cookies.mojom";
  7. import "url/mojom/origin.mojom";
  8. import "url/mojom/url.mojom";
  9. // An interface to the content settings manager running in the browser process
  10. // associated with a RenderFrameHost instance.
  11. interface ContentSettingsManager {
  12. // Enable cloning the connection, which helps support worker threads created
  13. // from other worker threads.
  14. Clone(pending_receiver<ContentSettingsManager> clone);
  15. enum StorageType {
  16. DATABASE,
  17. LOCAL_STORAGE,
  18. SESSION_STORAGE,
  19. FILE_SYSTEM,
  20. INDEXED_DB,
  21. CACHE,
  22. WEB_LOCKS,
  23. };
  24. // Sent by the renderer process to check whether access to a particular
  25. // storage system is granted by content settings. Sync support is optional
  26. // for when needed; prefer async whenever possible!
  27. // TODO(darin): Ideally this interface would be attached to a document-
  28. // specific browser-side object that would already know the origin info.
  29. // Then these parameters would not need to be passed here.
  30. [Sync]
  31. AllowStorageAccess(
  32. int32 render_frame_id,
  33. StorageType storage_type,
  34. url.mojom.Origin origin,
  35. network.mojom.SiteForCookies site_for_cookies,
  36. url.mojom.Origin top_frame_origin) => (bool allowed);
  37. // Tells the browser that content in the current page was blocked due to the
  38. // user's content settings.
  39. OnContentBlocked(int32 render_frame_id, ContentSettingsType type);
  40. };