Commit cff39bd8 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

[code health] Use GlobalRoutingId

No need for a custom RenderFrameHostId which is the same as
GlobalRoutingId

Change-Id: I4bbf1e8d53c3e42c03cab23ab57874a4bbf8f09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796669Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#696009}
parent 8c9e72f3
...@@ -141,6 +141,7 @@ ...@@ -141,6 +141,7 @@
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "content/public/browser/file_select_listener.h" #include "content/public/browser/file_select_listener.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/network_service_instance.h" #include "content/public/browser/network_service_instance.h"
#include "content/public/browser/page_visibility_state.h" #include "content/public/browser/page_visibility_state.h"
#include "content/public/browser/permission_type.h" #include "content/public/browser/permission_type.h"
...@@ -249,11 +250,9 @@ int g_next_accessibility_reset_token = 1; ...@@ -249,11 +250,9 @@ int g_next_accessibility_reset_token = 1;
bool g_allow_injecting_javascript = false; bool g_allow_injecting_javascript = false;
#endif #endif
// The (process id, routing id) pair that identifies one RenderFrame. typedef std::unordered_map<GlobalFrameRoutingId,
typedef std::pair<int32_t, int32_t> RenderFrameHostID;
typedef std::unordered_map<RenderFrameHostID,
RenderFrameHostImpl*, RenderFrameHostImpl*,
base::IntPairHash<RenderFrameHostID>> GlobalFrameRoutingIdHasher>
RoutingIDFrameMap; RoutingIDFrameMap;
base::LazyInstance<RoutingIDFrameMap>::DestructorAtExit g_routing_id_frame_map = base::LazyInstance<RoutingIDFrameMap>::DestructorAtExit g_routing_id_frame_map =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
...@@ -758,7 +757,7 @@ RenderFrameHostImpl* RenderFrameHostImpl::FromID(int process_id, ...@@ -758,7 +757,7 @@ RenderFrameHostImpl* RenderFrameHostImpl::FromID(int process_id,
int routing_id) { int routing_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
RoutingIDFrameMap* frames = g_routing_id_frame_map.Pointer(); RoutingIDFrameMap* frames = g_routing_id_frame_map.Pointer();
auto it = frames->find(RenderFrameHostID(process_id, routing_id)); auto it = frames->find(GlobalFrameRoutingId(process_id, routing_id));
return it == frames->end() ? NULL : it->second; return it == frames->end() ? NULL : it->second;
} }
...@@ -857,7 +856,7 @@ RenderFrameHostImpl::RenderFrameHostImpl( ...@@ -857,7 +856,7 @@ RenderFrameHostImpl::RenderFrameHostImpl(
commit_callback_interceptor_(nullptr) { commit_callback_interceptor_(nullptr) {
GetProcess()->AddRoute(routing_id_, this); GetProcess()->AddRoute(routing_id_, this);
g_routing_id_frame_map.Get().emplace( g_routing_id_frame_map.Get().emplace(
RenderFrameHostID(GetProcess()->GetID(), routing_id_), this); GlobalFrameRoutingId(GetProcess()->GetID(), routing_id_), this);
site_instance_->AddObserver(this); site_instance_->AddObserver(this);
process_->AddObserver(this); process_->AddObserver(this);
GetSiteInstance()->IncrementActiveFrameCount(); GetSiteInstance()->IncrementActiveFrameCount();
...@@ -1039,7 +1038,7 @@ RenderFrameHostImpl::~RenderFrameHostImpl() { ...@@ -1039,7 +1038,7 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
GetProcess()->RemoveRoute(routing_id_); GetProcess()->RemoveRoute(routing_id_);
g_routing_id_frame_map.Get().erase( g_routing_id_frame_map.Get().erase(
RenderFrameHostID(GetProcess()->GetID(), routing_id_)); GlobalFrameRoutingId(GetProcess()->GetID(), routing_id_));
// Null out the swapout timer; in crash dumps this member will be null only if // Null out the swapout timer; in crash dumps this member will be null only if
// the dtor has run. (It may also be null in tests.) // the dtor has run. (It may also be null in tests.)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment