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

Side by Side Diff: ui/gfx/image/image.cc

Issue 1456703004: ScopedPtrMap -> std::map from /ui/gfx/image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/image/image.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/gfx/image/image.h" 5 #include "ui/gfx/image/image.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 736
737 internal::ImageRep* Image::GetRepresentation( 737 internal::ImageRep* Image::GetRepresentation(
738 RepresentationType rep_type, bool must_exist) const { 738 RepresentationType rep_type, bool must_exist) const {
739 CHECK(storage_.get()); 739 CHECK(storage_.get());
740 RepresentationMap::const_iterator it = 740 RepresentationMap::const_iterator it =
741 storage_->representations().find(rep_type); 741 storage_->representations().find(rep_type);
742 if (it == storage_->representations().end()) { 742 if (it == storage_->representations().end()) {
743 CHECK(!must_exist); 743 CHECK(!must_exist);
744 return NULL; 744 return NULL;
745 } 745 }
746 return it->second; 746 return it->second.get();
747 } 747 }
748 748
749 void Image::AddRepresentation(scoped_ptr<internal::ImageRep> rep) const { 749 void Image::AddRepresentation(scoped_ptr<internal::ImageRep> rep) const {
750 CHECK(storage_.get()); 750 CHECK(storage_.get());
751 RepresentationType type = rep->type(); 751 RepresentationType type = rep->type();
752 storage_->representations().insert(type, rep.Pass()); 752 storage_->representations()[type] = std::move(rep);
danakj 2015/11/18 23:03:56 why'd you change it to [] instead to insert? it's
limasdf 2015/11/18 23:12:07 Hm..No big reason, going back to 'insert()'.
753 } 753 }
754 754
755 } // namespace gfx 755 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698