tree: 443fd8a3e0425ebab96d4d0ba268acd74b26aea0 [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. providers/
  15. public/
  16. security/
  17. session/
  18. shell/
  19. test/
  20. thread/
  21. util/
  22. web_state/
  23. web_view_only/
  24. webui/
  25. browser_state.mm
  26. browser_state_unittest.mm
  27. browser_state_utils.mm
  28. browser_state_web_view_partition_inttest.mm
  29. browser_url_rewriter_impl.h
  30. browser_url_rewriter_impl.mm
  31. BUILD.gn
  32. DEPS
  33. DIR_METADATA
  34. history_state_util.cc
  35. history_state_util.h
  36. history_state_util_unittest.mm
  37. ios_web_resources.grd
  38. javascript_flags.gni
  39. network_context_owner.cc
  40. network_context_owner_unittest.cc
  41. OWNERS
  42. README.md
  43. switches.cc
  44. switches.h
  45. url_loader_inttest.mm
  46. web_client.mm
  47. web_client_unittest.mm
  48. web_sub_thread.cc
  49. web_sub_thread.h
  50. web_thread_impl.cc
  51. web_thread_impl.h
  52. 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.