| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <iterator> | 5 #include <iterator> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "scoped_refptr.h" | 9 #include "scoped_refptr.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 void TestsAScopedRefptr() { | 35 void TestsAScopedRefptr() { |
| 36 MyMap map; | 36 MyMap map; |
| 37 map["foo"] = new Foo; | 37 map["foo"] = new Foo; |
| 38 map["bar"] = new Foo; | 38 map["bar"] = new Foo; |
| 39 MyIter my_begin(map.begin()); | 39 MyIter my_begin(map.begin()); |
| 40 MyIter my_end(map.end()); | 40 MyIter my_end(map.end()); |
| 41 for (MyIter it = my_begin; it != my_end; ++it) { | 41 for (MyIter it = my_begin; it != my_end; ++it) { |
| 42 const Foo* item = NULL; | 42 const Foo* item = NULL; |
| 43 item = it->get(); | 43 if (it->get()) |
| 44 item = it->get(); |
| 44 } | 45 } |
| 45 } | 46 } |
| OLD | NEW |