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

Side by Side Diff: base/i18n/timezone.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/i18n/time_formatting_unittest.cc ('k') | base/ios/device_util.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "base/i18n/timezone.h" 5 #include "base/i18n/timezone.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 } 600 }
601 }; 601 };
602 std::map<const char*, const char*, CompareCStrings> map_; 602 std::map<const char*, const char*, CompareCStrings> map_;
603 603
604 DISALLOW_COPY_AND_ASSIGN(TimezoneMap); 604 DISALLOW_COPY_AND_ASSIGN(TimezoneMap);
605 }; 605 };
606 606
607 } // namespace 607 } // namespace
608 608
609 std::string CountryCodeForCurrentTimezone() { 609 std::string CountryCodeForCurrentTimezone() {
610 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); 610 std::unique_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
611 icu::UnicodeString id; 611 icu::UnicodeString id;
612 zone->getID(id); 612 zone->getID(id);
613 string16 olson_code(id.getBuffer(), id.length()); 613 string16 olson_code(id.getBuffer(), id.length());
614 return TimezoneMap::GetInstance()->CountryCodeForTimezone( 614 return TimezoneMap::GetInstance()->CountryCodeForTimezone(
615 UTF16ToUTF8(olson_code)); 615 UTF16ToUTF8(olson_code));
616 } 616 }
617 617
618 } // namespace base 618 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/time_formatting_unittest.cc ('k') | base/ios/device_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698