Replace raw_ptr with raw_ref in DocumentService

This also changes the subclasses of DocumentService to work with
references to RenderFrameHost, since DocumentService no longer vends
a pointer.

While doing so, any public constructor or destructor in a
DocumentService subclass was made private. CreateForTesting() was
added where needed.

CHECK() is added if not present (or converted from DCHECK()) when
turning RenderFrameHost* into RenderFrameHost&.

There are, of course, more pointers that could become references, but
this CL has to stop somewhere.

[email protected]

Bug: 1339061, 1252046
Change-Id: I00033bcbabd9c4d268b0f5745b12031928dbf914
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3721411
Owners-Override: Alexander Timin <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Commit-Queue: Alexander Timin <[email protected]>
Auto-Submit: danakj <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1021695}
diff --git a/content/browser/renderer_host/clipboard_host_impl.h b/content/browser/renderer_host/clipboard_host_impl.h
index 8001a04c..1de8bb5 100644
--- a/content/browser/renderer_host/clipboard_host_impl.h
+++ b/content/browser/renderer_host/clipboard_host_impl.h
@@ -96,7 +96,7 @@
   static const base::TimeDelta kIsPasteContentAllowedRequestTooOld;
 
   explicit ClipboardHostImpl(
-      RenderFrameHost* render_frame_host,
+      RenderFrameHost& render_frame_host,
       mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver);
 
   // Performs a check to see if pasting `data` is allowed by data transfer