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

Unified Diff: content/test/content_test_suite.cc

Issue 1140523005: content: Remove the use of linked_ptr from content_test_suite.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 5 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_test_suite.cc
diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc
index 6a3610a46ac4a425edbc5b4891f2a03eb60ee8f2..561e6a9e03c4d5d187966ba96040318bc27b030f 100644
--- a/content/test/content_test_suite.cc
+++ b/content/test/content_test_suite.cc
@@ -7,7 +7,6 @@
#if defined(OS_ANDROID)
#include <android/native_window.h>
#include <android/native_window_jni.h>
-#include <map>
#endif
#include "base/base_paths.h"
@@ -38,7 +37,8 @@
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
-#include "base/memory/linked_ptr.h"
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/memory/scoped_ptr.h"
#include "content/common/android/surface_texture_manager.h"
#include "ui/gl/android/scoped_java_surface.h"
#include "ui/gl/android/surface_texture.h"
@@ -74,8 +74,8 @@ class TestSurfaceTextureManager : public SurfaceTextureManager {
void RegisterSurfaceTexture(int surface_texture_id,
int client_id,
gfx::SurfaceTexture* surface_texture) override {
- surfaces_[surface_texture_id] =
- make_linked_ptr(new gfx::ScopedJavaSurface(surface_texture));
+ surfaces_.add(surface_texture_id,
+ make_scoped_ptr(new gfx::ScopedJavaSurface(surface_texture)));
}
void UnregisterSurfaceTexture(int surface_texture_id,
int client_id) override {
@@ -85,11 +85,12 @@ class TestSurfaceTextureManager : public SurfaceTextureManager {
int surface_texture_id) override {
JNIEnv* env = base::android::AttachCurrentThread();
return ANativeWindow_fromSurface(
- env, surfaces_[surface_texture_id]->j_surface().obj());
+ env, surfaces_.get(surface_texture_id)->j_surface().obj());
}
private:
- typedef std::map<int, linked_ptr<gfx::ScopedJavaSurface>> SurfaceMap;
+ using SurfaceMap =
+ base::ScopedPtrHashMap<int, scoped_ptr<gfx::ScopedJavaSurface>>;
SurfaceMap surfaces_;
};
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698