Use content::GlobalFrameRoutingId instead of std::pair<int, int>.

This CL exposes content::GlobalFrameRoutingId and GlobalRoutingID via
//content/public/browser API and uses it where appropriate instead of
std::pair<int, int>.

This CL also opportunistically fixes some other minor issues:
- IWYU problems reported by |git cl lint|
- Presubmit issues (e.g. using base::Callback instead of OnceCallback)

This CL is intended to be pure refactoring - no intended behavior
change.

Bug: 834185
Change-Id: I39daff220c8a7da19114d28a1ea9ca8e24cc93fe
Reviewed-on: https://chromium-review.googlesource.com/1184150
Reviewed-by: Sami Kyöstilä <[email protected]>
Reviewed-by: mark a. foltz <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Reviewed-by: Lucas Gadani <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: Scott Little <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Commit-Queue: Łukasz Anforowicz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#585498}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index f806c32..51d4ce1e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2670,8 +2670,8 @@
     // FrameTreeNode id instead of the routing id of the Widget for the main
     // frame.  https://crbug.com/545684
     DCHECK_NE(MSG_ROUTING_NONE, main_frame_widget_route_id);
-    pending_contents_[std::make_pair(render_process_id,
-                                     main_frame_widget_route_id)] =
+    pending_contents_[GlobalRoutingID(render_process_id,
+                                      main_frame_widget_route_id)] =
         std::move(new_contents);
     AddDestructionObserver(raw_new_contents);
   }
@@ -2773,7 +2773,7 @@
     widget_view->SetPopupType(popup_type);
   }
   // Save the created widget associated with the route so we can show it later.
-  pending_widget_views_[std::make_pair(render_process_id, route_id)] =
+  pending_widget_views_[GlobalRoutingID(render_process_id, route_id)] =
       widget_view;
 }
 
@@ -2866,7 +2866,7 @@
 std::unique_ptr<WebContents> WebContentsImpl::GetCreatedWindow(
     int process_id,
     int main_frame_widget_route_id) {
-  auto key = std::make_pair(process_id, main_frame_widget_route_id);
+  auto key = GlobalRoutingID(process_id, main_frame_widget_route_id);
   auto iter = pending_contents_.find(key);
 
   // Certain systems can block the creation of new windows. If we didn't succeed
@@ -2894,14 +2894,14 @@
 
 RenderWidgetHostView* WebContentsImpl::GetCreatedWidget(int process_id,
                                                         int route_id) {
-  auto iter = pending_widget_views_.find(std::make_pair(process_id, route_id));
+  auto iter = pending_widget_views_.find(GlobalRoutingID(process_id, route_id));
   if (iter == pending_widget_views_.end()) {
     DCHECK(false);
     return nullptr;
   }
 
   RenderWidgetHostView* widget_host_view = iter->second;
-  pending_widget_views_.erase(std::make_pair(process_id, route_id));
+  pending_widget_views_.erase(GlobalRoutingID(process_id, route_id));
 
   RenderWidgetHost* widget_host = widget_host_view->GetRenderWidgetHost();
   if (!widget_host->GetProcess()->IsInitializedAndNotDead()) {