tree: 9e95943b8b15202670525dc4e64addc2fbe8c917 [path history] [tgz]
  1. BUILD.gn
  2. content_capture_manager.cc
  3. content_capture_manager.h
  4. content_capture_task.cc
  5. content_capture_task.h
  6. content_capture_task_histogram_reporter.cc
  7. content_capture_task_histogram_reporter.h
  8. content_capture_test.cc
  9. content_holder.cc
  10. content_holder.h
  11. DEPS
  12. OWNERS
  13. README.md
  14. sent_nodes.cc
  15. sent_nodes.h
  16. task_session.cc
  17. task_session.h
third_party/blink/renderer/core/content_capture/README.md

ContentCapture

Rendered

This directory contains ContentCapture which is for capturing on-screen text content and streaming it to a client.

The implementation injects a cc::NodeHolder into cc::DrawTextBlobOp in paint stage, schedules a best-effort task to retrieve on-screen text content (using an r-tree to capture all cc::NodeHolder intersecting the screen), and streams the text out through ContentCaptureClient interface. The ContentCaptureTask is a best-effort task in the idle queue and could be paused if there are higher-priority tasks.

There are two ways to associate cc::NodeHolder with Node which are being compared. One of these approaches will be removed once performance data is available.

  1. NodeHolder::Type::kID where the ID from DOMNodeIds::IdForNode() is used to identify nodes.
  2. NodeHolder::Type::kTextHolder which uses ContentCapture’s implementation of cc::TextHolder to identify the node. Since the NodeHolder is captured and sent out in a separate task, the Node could be removed. To avoid using removed Nodes, a weak pointer to Node is implemented. This weak pointer will be reset when the Node associated with the LayoutText is destroyed. Though a Node can be associated with multiple LayoutObjects, only the main LayoutObject has the pointer back to Node, so it isn’t a problem to use the removing of LayoutText to reset the pointer to the Node.