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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_files.cc

Issue 10384204: gdata: Fix a bug that caused google drive not to load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | chrome/browser/chromeos/gdata/gdata_files_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 "chrome/browser/chromeos/gdata/gdata_files.h" 5 #include "chrome/browser/chromeos/gdata/gdata_files.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 ToProto(proto.get()); 859 ToProto(proto.get());
860 const bool ok = proto->SerializeToString(serialized_proto); 860 const bool ok = proto->SerializeToString(serialized_proto);
861 DCHECK(ok); 861 DCHECK(ok);
862 } 862 }
863 863
864 bool GDataRootDirectory::ParseFromString(const std::string& serialized_proto) { 864 bool GDataRootDirectory::ParseFromString(const std::string& serialized_proto) {
865 scoped_ptr<GDataRootDirectoryProto> proto( 865 scoped_ptr<GDataRootDirectoryProto> proto(
866 new GDataRootDirectoryProto()); 866 new GDataRootDirectoryProto());
867 bool ok = proto->ParseFromString(serialized_proto); 867 bool ok = proto->ParseFromString(serialized_proto);
868 if (ok) { 868 if (ok) {
869 // The title field for the root directory was originally empty, then
achuithb 2012/05/16 18:25:17 Do you think we should we plan to delete this code
satorux1 2012/05/16 18:28:15 I think the code here will be deleted anyway once
870 // changed to "gdata", then changed to "drive". Discard the proto data if
871 // the older formats are detected. See crbug.com/128133 for details.
872 const std::string& title = proto->gdata_directory().gdata_entry().title();
873 if (title != "drive") {
874 LOG(ERROR) << "Incompatible proto detected: " << title;
875 return false;
876 }
877
869 FromProto(*proto.get()); 878 FromProto(*proto.get());
870 set_origin(FROM_CACHE); 879 set_origin(FROM_CACHE);
871 set_refresh_time(base::Time::Now()); 880 set_refresh_time(base::Time::Now());
872 } 881 }
873 return ok; 882 return ok;
874 } 883 }
875 884
876 } // namespace gdata 885 } // namespace gdata
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698