tree: cfcc94eab918a3d0e69771d91fa35fa252667774 [path history] [tgz]
  1. annotations/
  2. browsing_data/
  3. common/
  4. content/
  5. download/
  6. favicon/
  7. find_in_page/
  8. init/
  9. js_features/
  10. js_image_transcoder/
  11. js_messaging/
  12. navigation/
  13. net/
  14. public/
  15. security/
  16. session/
  17. shell/
  18. test/
  19. thread/
  20. util/
  21. web_state/
  22. web_view_only/
  23. webui/
  24. browser_state.mm
  25. browser_state_unittest.mm
  26. browser_state_utils.mm
  27. browser_state_web_view_partition_inttest.mm
  28. browser_url_rewriter_impl.h
  29. browser_url_rewriter_impl.mm
  30. BUILD.gn
  31. DEPS
  32. DIR_METADATA
  33. history_state_util.cc
  34. history_state_util.h
  35. history_state_util_unittest.mm
  36. ios_web_resources.grd
  37. javascript_flags.gni
  38. network_context_owner.cc
  39. network_context_owner_unittest.cc
  40. OWNERS
  41. README.md
  42. switches.cc
  43. switches.h
  44. url_loader_inttest.mm
  45. web_client.mm
  46. web_client_unittest.mm
  47. web_sub_thread.cc
  48. web_sub_thread.h
  49. web_thread_impl.cc
  50. web_thread_impl.h
  51. web_thread_unittest.cc
ios/web/README.md

iOS Web Layer

Overview

ios/web performs a similar role on iOS as what content/ does on other platforms. It encapsulates the architecture for displaying web content, managing navigation, and providing an API that embedders (like ios/chrome, ios/web_view) can use to build a browser (or browser-like application).

On iOS, Blink is not available. Instead, ios/web wraps WKWebView (provided by WebKit) and layers on top of it to provide features like:

  • WebState: The core class representing a tab/page (analogous to content::WebContents).
  • BrowserState: Represents a user's session (analogous to content::BrowserContext).
  • JavaScript Messaging: A channel for two-way communication between the embedder and JavaScript running in the page content.
  • Navigation: Abstractions over WKWebView's navigation stack.

Minimum Deployment Version

//ios/web supports iOS 16 and above. This is a lower minimum iOS version than Chrome in order to support //ios/web_view deployment to older versions of iOS.

Layering & Dependencies

The ios/web layer sits above base, net, components, ui, and more. It is the renderer equivalent on iOS.

ios/web vs ios/components vs components/

  • ios/web: The renderer-equivalent on iOS. It does not depend on higher-level features found in ios/chrome or ios/web_view.
  • ios/components: Contains reusable feature code that is specific to iOS but shared across multiple embedders (e.g., ios/chrome and ios/web_view). Implementations in ios/components often depend on ios/web/public. See //ios/components/README.md.
  • components/: Generally cross-platform, sometimes excluding iOS. See //components/README.md.

Dependency Notes:

  • ios/components can depend on ios/web.
  • ios/web can depend on ios/components, so long as the component does not depend on ios/web.

Usage

Embedders (like ios/chrome or ios/web_view) must consume ios/web through the Public API, located in ios/web/public.