Commit 348132b2 authored by thakis@chromium.org's avatar thakis@chromium.org

Remove 1 exit time destructor from ppapi, and possibly fix a bug.

Previously, this was an inline function with a static member, and
since we're building with -fvisibility-inlines-hidden, this resulted
in one copy of the singleton in each translation unit that includes
this header.

Turn on -Wexit-time-destructors for ppapi_proxy.

BUG=104323
TEST=none
TBR=noelallen@google.com (noelallen@chromium.org did LGTM already)

Review URL: http://codereview.chromium.org/8574027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110339 0039d316-1c4b-4281-b951-d872f2087c98
parent fe2adf80
......@@ -7,6 +7,7 @@
#include <limits>
#include <set>
#include "base/basictypes.h"
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/portability.h"
#include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
......@@ -16,6 +17,12 @@
namespace ppapi_proxy {
// static
PluginResourceTracker* PluginResourceTracker::Get() {
CR_DEFINE_STATIC_LOCAL(PluginResourceTracker, tracker, ());
return &tracker;
}
PluginResourceTracker::ResourceAndRefCounts::ResourceAndRefCounts(
PluginResource* r, size_t browser_count)
: resource(r), browser_refcount(browser_count), plugin_refcount(1) {
......
......@@ -25,10 +25,7 @@ class PluginResource;
class PluginResourceTracker {
public:
// Returns the pointer to the singleton object.
static PluginResourceTracker* Get() {
static PluginResourceTracker tracker;
return &tracker;
}
static PluginResourceTracker* Get();
// PP_Resources --------------------------------------------------------------
......
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