Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID

This change bulk changes RenderProcessHost::GetID to
RenderProcessHost::GetDeprecatedID to support the transition to a
strongly typed ChildProcessId.

Bug: 379869738
Change-Id: Ib0c991536486ef29702ea166cdcf12ea68ed70ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065543
Reviewed-by: Arthur Sonzogni <[email protected]>
Owners-Override: Arthur Sonzogni <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Commit-Queue: Emily Andrews <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394500}
diff --git a/content/browser/renderer_host/document_token_browsertest.cc b/content/browser/renderer_host/document_token_browsertest.cc
index fe4445bf..beb0055 100644
--- a/content/browser/renderer_host/document_token_browsertest.cc
+++ b/content/browser/renderer_host/document_token_browsertest.cc
@@ -101,7 +101,8 @@
         static_cast<RenderFrameHostImpl*>(adapter.render_frame_host());
     FrameTreeNode* const frame_tree_node =
         old_render_frame_host->frame_tree_node();
-    const int old_process_id = old_render_frame_host->GetProcess()->GetID();
+    const int old_process_id =
+        old_render_frame_host->GetProcess()->GetDeprecatedID();
     const blink::LocalFrameToken old_frame_token =
         old_render_frame_host->GetFrameToken();
     const blink::DocumentToken old_document_token =
@@ -164,10 +165,10 @@
       EXPECT_EQ(old_render_frame_host, RenderFrameHostImpl::FromDocumentToken(
                                            old_process_id, old_document_token));
     }
-    EXPECT_EQ(
-        new_render_frame_host,
-        RenderFrameHostImpl::FromDocumentToken(
-            new_render_frame_host->GetProcess()->GetID(), new_document_token));
+    EXPECT_EQ(new_render_frame_host,
+              RenderFrameHostImpl::FromDocumentToken(
+                  new_render_frame_host->GetProcess()->GetDeprecatedID(),
+                  new_document_token));
     return new_document_token;
   }
 };
@@ -256,7 +257,8 @@
         static_cast<RenderFrameHostImpl*>(new_contents->GetPrimaryMainFrame());
     FrameTreeNode* const frame_tree_node =
         old_render_frame_host->frame_tree_node();
-    const int old_process_id = old_render_frame_host->GetProcess()->GetID();
+    const int old_process_id =
+        old_render_frame_host->GetProcess()->GetDeprecatedID();
     const blink::LocalFrameToken old_frame_token =
         old_render_frame_host->GetFrameToken();
     const blink::DocumentToken old_document_token =
@@ -318,10 +320,10 @@
       EXPECT_EQ(old_render_frame_host, RenderFrameHostImpl::FromDocumentToken(
                                            old_process_id, old_document_token));
     }
-    EXPECT_EQ(
-        new_render_frame_host,
-        RenderFrameHostImpl::FromDocumentToken(
-            new_render_frame_host->GetProcess()->GetID(), new_document_token));
+    EXPECT_EQ(new_render_frame_host,
+              RenderFrameHostImpl::FromDocumentToken(
+                  new_render_frame_host->GetProcess()->GetDeprecatedID(),
+                  new_document_token));
     seen_tokens.push_back(new_document_token);
     // The original `WebContents` should still have the same `DocumentToken`.
     EXPECT_EQ(seen_tokens[0], GetBrowserSideToken(web_contents()));
@@ -456,7 +458,7 @@
       web_contents(), embedded_test_server()->GetURL("a.com", "/title1.html")));
   EXPECT_TRUE(VerifyMatchingTokens(web_contents()));
   const int old_process_id =
-      web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
+      web_contents()->GetPrimaryMainFrame()->GetProcess()->GetDeprecatedID();
   const blink::DocumentToken old_document_token =
       GetBrowserSideToken(web_contents());
 
@@ -481,7 +483,7 @@
   shell()->LoadURL(embedded_test_server()->GetURL("a.com", "/title1.html"));
   EXPECT_TRUE(VerifyMatchingTokens(web_contents()));
   const int new_process_id =
-      web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
+      web_contents()->GetPrimaryMainFrame()->GetProcess()->GetDeprecatedID();
   const blink::DocumentToken token_after_navigation_started =
       GetBrowserSideToken(web_contents());
   EXPECT_NE(token_after_navigation_started, old_document_token);
@@ -551,13 +553,17 @@
   // Even though the RenderFrameHost did not change, only a lookup using the new
   // DocumentToken should succeed.
   EXPECT_EQ(web_contents()->GetPrimaryMainFrame(),
-            RenderFrameHostImpl::FromDocumentToken(
-                web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID(),
-                new_document_token));
+            RenderFrameHostImpl::FromDocumentToken(web_contents()
+                                                       ->GetPrimaryMainFrame()
+                                                       ->GetProcess()
+                                                       ->GetDeprecatedID(),
+                                                   new_document_token));
   EXPECT_EQ(nullptr,
-            RenderFrameHostImpl::FromDocumentToken(
-                web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID(),
-                old_document_token));
+            RenderFrameHostImpl::FromDocumentToken(web_contents()
+                                                       ->GetPrimaryMainFrame()
+                                                       ->GetProcess()
+                                                       ->GetDeprecatedID(),
+                                                   old_document_token));
 }
 
 // TODO(crbug.com/40238502): Add tests for bfcache navigations and
@@ -572,7 +578,7 @@
         EXPECT_EQ("process ID does not match requested DocumentToken", reason);
       });
   EXPECT_EQ(nullptr, RenderFrameHostImpl::FromDocumentToken(
-                         main_frame->GetProcess()->GetID() + 1,
+                         main_frame->GetProcess()->GetDeprecatedID() + 1,
                          main_frame->GetDocumentToken(), &callback));
   EXPECT_TRUE(called);
 }