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

Unified Diff: chrome/browser/google_apis/gdata_wapi_parser.cc

Issue 11635035: Stop using reinterpret_cast in gdata_wapi_parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cosmetic changes. Created 8 years 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 | « chrome/browser/google_apis/gdata_wapi_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/gdata_wapi_parser.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_parser.cc b/chrome/browser/google_apis/gdata_wapi_parser.cc
index 30d47f86499bc2f134d5792bb20d24b31d2f04b2..d3fac421358dffdfeb37e7d4549de272692b95ac 100644
--- a/chrome/browser/google_apis/gdata_wapi_parser.cc
+++ b/chrome/browser/google_apis/gdata_wapi_parser.cc
@@ -475,16 +475,18 @@ FeedEntry::~FeedEntry() {
}
// static
+template<typename FeedEntryDescendant>
void FeedEntry::RegisterJSONConverter(
- base::JSONValueConverter<FeedEntry>* converter) {
+ base::JSONValueConverter<FeedEntryDescendant>* converter) {
converter->RegisterStringField(kETagField, &FeedEntry::etag_);
- converter->RegisterRepeatedMessage(kAuthorField, &FeedEntry::authors_);
- converter->RegisterRepeatedMessage(kLinkField, &FeedEntry::links_);
- converter->RegisterRepeatedMessage(kCategoryField, &FeedEntry::categories_);
- converter->RegisterCustomField<base::Time>(
- kUpdatedField,
- &FeedEntry::updated_time_,
- &util::GetTimeFromString);
+ converter->template RegisterRepeatedMessage<Author>(
+ kAuthorField, &FeedEntry::authors_);
+ converter->template RegisterRepeatedMessage<Link>(
+ kLinkField, &FeedEntry::links_);
+ converter->template RegisterRepeatedMessage<Category>(
+ kCategoryField, &FeedEntry::categories_);
+ converter->template RegisterCustomField<base::Time>(
+ kUpdatedField, &FeedEntry::updated_time_, &util::GetTimeFromString);
}
////////////////////////////////////////////////////////////////////////////////
@@ -527,8 +529,7 @@ bool ResourceEntry::ParseChangestamp(const base::Value* value,
void ResourceEntry::RegisterJSONConverter(
base::JSONValueConverter<ResourceEntry>* converter) {
// Inherit the parent registrations.
- FeedEntry::RegisterJSONConverter(
- reinterpret_cast<base::JSONValueConverter<FeedEntry>*>(converter));
+ FeedEntry::RegisterJSONConverter(converter);
converter->RegisterStringField(
kResourceIdField, &ResourceEntry::resource_id_);
converter->RegisterStringField(kIDField, &ResourceEntry::id_);
@@ -793,8 +794,7 @@ ResourceList::~ResourceList() {
void ResourceList::RegisterJSONConverter(
base::JSONValueConverter<ResourceList>* converter) {
// inheritance
- FeedEntry::RegisterJSONConverter(
- reinterpret_cast<base::JSONValueConverter<FeedEntry>*>(converter));
+ FeedEntry::RegisterJSONConverter(converter);
// TODO(zelidrag): Once we figure out where these will be used, we should
// check for valid start_index_ and items_per_page_ values.
converter->RegisterCustomField<int>(
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698