DevTools: introduce devtools frame token in the frame_tree_node.

Token is used for devtools instrumentation and trace-ability. The token is
propagated to Blink's LocalFrame and both Blink and content/
can tag calls and requests with this token in order to attribute them
to the context frame. DevTools token is only defined by the browser process and
is never sent back from the renderer in the control calls.
It should be never used to look up the FrameTreeNode instance.

Bug: 715541
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I646ab26b4427c60b440a63afdd1554d13552ed7f
TBR: alexclarke (headless)
Reviewed-on: https://chromium-review.googlesource.com/688485
Commit-Queue: Pavel Feldman <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Reviewed-by: Dmitry Gozman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#507878}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b3f114e..7297db4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5518,6 +5518,7 @@
     RenderViewHost* render_view_host,
     int opener_frame_routing_id,
     int proxy_routing_id,
+    const base::UnguessableToken& devtools_frame_token,
     const FrameReplicationState& replicated_frame_state) {
   TRACE_EVENT0("browser,navigation",
                "WebContentsImpl::CreateRenderViewForRenderManager");
@@ -5527,7 +5528,8 @@
 
   if (!static_cast<RenderViewHostImpl*>(render_view_host)
            ->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
-                              replicated_frame_state, created_with_opener_)) {
+                              devtools_frame_token, replicated_frame_state,
+                              created_with_opener_)) {
     return false;
   }
 
@@ -5600,6 +5602,7 @@
 bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() {
   return CreateRenderViewForRenderManager(
       GetRenderViewHost(), MSG_ROUTING_NONE, MSG_ROUTING_NONE,
+      frame_tree_.root()->devtools_frame_token(),
       frame_tree_.root()->current_replication_state());
 }