Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: webkit/plugins/ppapi/resource_tracker.cc

Issue 5828003: Move the Pepper implementation from webkit/glue/plugins/pepper_* to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.h ('k') | webkit/plugins/ppapi/resource_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/resource_tracker.cc
===================================================================
--- webkit/plugins/ppapi/resource_tracker.cc (revision 0)
+++ webkit/plugins/ppapi/resource_tracker.cc (working copy)
@@ -2,18 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/glue/plugins/pepper_resource_tracker.h"
+#include "webkit/plugins/ppapi/resource_tracker.h"
#include <limits>
#include <set>
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "ppapi/c/pp_resource.h"
-#include "webkit/glue/plugins/pepper_resource.h"
+#include "webkit/plugins/ppapi/resource.h"
-namespace pepper {
+namespace webkit {
+namespace ppapi {
+static base::LazyInstance<ResourceTracker> g_resource_tracker(
+ base::LINKER_INITIALIZED);
+
scoped_refptr<Resource> ResourceTracker::GetResource(PP_Resource res) const {
ResourceMap::const_iterator result = live_resources_.find(res);
if (result == live_resources_.end()) {
@@ -36,7 +41,7 @@
ResourceTracker* ResourceTracker::Get() {
if (singleton_override_)
return singleton_override_;
- return Singleton<ResourceTracker>::get();
+ return g_resource_tracker.Pointer();
}
PP_Resource ResourceTracker::AddResource(Resource* resource) {
@@ -186,4 +191,6 @@
singleton_override_ = NULL;
}
-} // namespace pepper
+} // namespace ppapi
+} // namespace webkit
+
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.h ('k') | webkit/plugins/ppapi/resource_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698