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

Side by Side Diff: sync/syncable/model_type.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sync/syncable/directory_backing_store.cc ('k') | sync/syncable/syncable_unittest.cc » ('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 (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 "sync/internal_api/public/base/model_type.h" 5 #include "sync/internal_api/public/base/model_type.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "sync/protocol/app_notification_specifics.pb.h" 9 #include "sync/protocol/app_notification_specifics.pb.h"
10 #include "sync/protocol/app_setting_specifics.pb.h" 10 #include "sync/protocol/app_setting_specifics.pb.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 base::StringValue* ModelTypeToValue(ModelType model_type) { 517 base::StringValue* ModelTypeToValue(ModelType model_type) {
518 if (model_type >= FIRST_REAL_MODEL_TYPE) { 518 if (model_type >= FIRST_REAL_MODEL_TYPE) {
519 return new base::StringValue(ModelTypeToString(model_type)); 519 return new base::StringValue(ModelTypeToString(model_type));
520 } else if (model_type == TOP_LEVEL_FOLDER) { 520 } else if (model_type == TOP_LEVEL_FOLDER) {
521 return new base::StringValue("Top-level folder"); 521 return new base::StringValue("Top-level folder");
522 } else if (model_type == UNSPECIFIED) { 522 } else if (model_type == UNSPECIFIED) {
523 return new base::StringValue("Unspecified"); 523 return new base::StringValue("Unspecified");
524 } 524 }
525 NOTREACHED(); 525 NOTREACHED();
526 return new base::StringValue(""); 526 return new base::StringValue(std::string());
527 } 527 }
528 528
529 ModelType ModelTypeFromValue(const base::Value& value) { 529 ModelType ModelTypeFromValue(const base::Value& value) {
530 if (value.IsType(base::Value::TYPE_STRING)) { 530 if (value.IsType(base::Value::TYPE_STRING)) {
531 std::string result; 531 std::string result;
532 CHECK(value.GetAsString(&result)); 532 CHECK(value.GetAsString(&result));
533 return ModelTypeFromString(result); 533 return ModelTypeFromString(result);
534 } else if (value.IsType(base::Value::TYPE_INTEGER)) { 534 } else if (value.IsType(base::Value::TYPE_INTEGER)) {
535 int result; 535 int result;
536 CHECK(value.GetAsInteger(&result)); 536 CHECK(value.GetAsInteger(&result));
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 872
873 bool IsRealDataType(ModelType model_type) { 873 bool IsRealDataType(ModelType model_type) {
874 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; 874 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT;
875 } 875 }
876 876
877 bool IsActOnceDataType(ModelType model_type) { 877 bool IsActOnceDataType(ModelType model_type) {
878 return model_type == HISTORY_DELETE_DIRECTIVES; 878 return model_type == HISTORY_DELETE_DIRECTIVES;
879 } 879 }
880 880
881 } // namespace syncer 881 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/directory_backing_store.cc ('k') | sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698