Commit 9bbb6775 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

[jumbo] avoid g_num_instances clash in pepper_*_socket_message_filter.cc

Bug: 746953
Change-Id: Id2bf0dbb4c4c67a5905586c3cee28290dfc00da2
Reviewed-on: https://chromium-review.googlesource.com/696082Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Cr-Commit-Position: refs/heads/master@{#505801}
parent 4c7fa0b6
...@@ -52,7 +52,7 @@ using ppapi::TCPSocketVersion; ...@@ -52,7 +52,7 @@ using ppapi::TCPSocketVersion;
namespace { namespace {
size_t g_num_instances = 0; size_t g_num_tcp_filter_instances = 0;
} // namespace } // namespace
...@@ -87,7 +87,7 @@ PepperTCPSocketMessageFilter::PepperTCPSocketMessageFilter( ...@@ -87,7 +87,7 @@ PepperTCPSocketMessageFilter::PepperTCPSocketMessageFilter(
DCHECK(host); DCHECK(host);
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
++g_num_instances; ++g_num_tcp_filter_instances;
host_->AddInstanceObserver(instance_, this); host_->AddInstanceObserver(instance_, this);
if (!host->GetRenderFrameIDsForInstance( if (!host->GetRenderFrameIDsForInstance(
instance, &render_process_id_, &render_frame_id_)) { instance, &render_process_id_, &render_frame_id_)) {
...@@ -125,7 +125,7 @@ PepperTCPSocketMessageFilter::PepperTCPSocketMessageFilter( ...@@ -125,7 +125,7 @@ PepperTCPSocketMessageFilter::PepperTCPSocketMessageFilter(
DCHECK_NE(version, ppapi::TCP_SOCKET_VERSION_1_0); DCHECK_NE(version, ppapi::TCP_SOCKET_VERSION_1_0);
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
++g_num_instances; ++g_num_tcp_filter_instances;
host_->AddInstanceObserver(instance_, this); host_->AddInstanceObserver(instance_, this);
if (!host->GetRenderFrameIDsForInstance( if (!host->GetRenderFrameIDsForInstance(
instance, &render_process_id_, &render_frame_id_)) { instance, &render_process_id_, &render_frame_id_)) {
...@@ -141,12 +141,12 @@ PepperTCPSocketMessageFilter::~PepperTCPSocketMessageFilter() { ...@@ -141,12 +141,12 @@ PepperTCPSocketMessageFilter::~PepperTCPSocketMessageFilter() {
socket_->Close(); socket_->Close();
if (ssl_socket_) if (ssl_socket_)
ssl_socket_->Disconnect(); ssl_socket_->Disconnect();
--g_num_instances; --g_num_tcp_filter_instances;
} }
// static // static
size_t PepperTCPSocketMessageFilter::GetNumInstances() { size_t PepperTCPSocketMessageFilter::GetNumInstances() {
return g_num_instances; return g_num_tcp_filter_instances;
} }
scoped_refptr<base::TaskRunner> scoped_refptr<base::TaskRunner>
......
...@@ -45,7 +45,7 @@ using ppapi::proxy::UDPSocketResourceConstants; ...@@ -45,7 +45,7 @@ using ppapi::proxy::UDPSocketResourceConstants;
namespace { namespace {
size_t g_num_instances = 0; size_t g_num_udp_filter_instances = 0;
} // namespace } // namespace
...@@ -82,7 +82,7 @@ PepperUDPSocketMessageFilter::PepperUDPSocketMessageFilter( ...@@ -82,7 +82,7 @@ PepperUDPSocketMessageFilter::PepperUDPSocketMessageFilter(
render_frame_id_(0), render_frame_id_(0),
is_potentially_secure_plugin_context_( is_potentially_secure_plugin_context_(
host->IsPotentiallySecurePluginContext(instance)) { host->IsPotentiallySecurePluginContext(instance)) {
++g_num_instances; ++g_num_udp_filter_instances;
DCHECK(host); DCHECK(host);
if (!host->GetRenderFrameIDsForInstance( if (!host->GetRenderFrameIDsForInstance(
...@@ -93,12 +93,12 @@ PepperUDPSocketMessageFilter::PepperUDPSocketMessageFilter( ...@@ -93,12 +93,12 @@ PepperUDPSocketMessageFilter::PepperUDPSocketMessageFilter(
PepperUDPSocketMessageFilter::~PepperUDPSocketMessageFilter() { PepperUDPSocketMessageFilter::~PepperUDPSocketMessageFilter() {
Close(); Close();
--g_num_instances; --g_num_udp_filter_instances;
} }
// static // static
size_t PepperUDPSocketMessageFilter::GetNumInstances() { size_t PepperUDPSocketMessageFilter::GetNumInstances() {
return g_num_instances; return g_num_udp_filter_instances;
} }
scoped_refptr<base::TaskRunner> scoped_refptr<base::TaskRunner>
......
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