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

Unified Diff: cc/CCLayerTreeHostCommon.h

Issue 10940002: Add wrapper container for a vector of OwnPtr<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « cc/CCLayerTreeHost.h ('k') | cc/CCLayerTreeHostCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCLayerTreeHostCommon.h
diff --git a/cc/CCLayerTreeHostCommon.h b/cc/CCLayerTreeHostCommon.h
index d8710e95e5a0a2c52f07ecaaa429fc75b7ebf7e9..65cf7685d2a2f25eab1ecf6be7a807dd9897fb0c 100644
--- a/cc/CCLayerTreeHostCommon.h
+++ b/cc/CCLayerTreeHostCommon.h
@@ -7,6 +7,7 @@
#include "IntRect.h"
#include "IntSize.h"
+#include "cc/own_ptr_vector.h"
#include <public/WebTransformationMatrix.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
@@ -36,6 +37,16 @@ public:
// from the given root layer (including mask and replica layers).
template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId);
+ static LayerChromium* getChildAsRawPtr(const Vector<RefPtr<LayerChromium> >& children, size_t index)
+ {
+ return children[index].get();
+ }
+
+ static CCLayerImpl* getChildAsRawPtr(const OwnPtrVector<CCLayerImpl>& children, size_t index)
+ {
+ return children[index];
+ }
+
struct ScrollUpdateInfo {
int layerId;
IntSize scrollDelta;
@@ -74,7 +85,7 @@ LayerType* CCLayerTreeHostCommon::findLayerInSubtree(LayerType* rootLayer, int l
return rootLayer->replicaLayer();
for (size_t i = 0; i < rootLayer->children().size(); ++i) {
- if (LayerType* found = findLayerInSubtree(rootLayer->children()[i].get(), layerId))
+ if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->children(), i), layerId))
return found;
}
return 0;
« no previous file with comments | « cc/CCLayerTreeHost.h ('k') | cc/CCLayerTreeHostCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698