OLD | NEW |
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_util.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void OnGetEntryInfoForInsertGDataCachePathsPermissions( | 126 void OnGetEntryInfoForInsertGDataCachePathsPermissions( |
127 Profile* profile, | 127 Profile* profile, |
128 std::vector<std::pair<FilePath, int> >* cache_paths, | 128 std::vector<std::pair<FilePath, int> >* cache_paths, |
129 const base::Closure& callback, | 129 const base::Closure& callback, |
130 GDataFileError error, | 130 GDataFileError error, |
131 scoped_ptr<GDataEntryProto> entry_proto) { | 131 scoped_ptr<GDataEntryProto> entry_proto) { |
132 DCHECK(profile); | 132 DCHECK(profile); |
133 DCHECK(cache_paths); | 133 DCHECK(cache_paths); |
134 DCHECK(!callback.is_null()); | 134 DCHECK(!callback.is_null()); |
135 | 135 |
136 if (!entry_proto->has_file_specific_info()) | 136 if (entry_proto.get() && !entry_proto->has_file_specific_info()) |
137 error = GDATA_FILE_ERROR_NOT_FOUND; | 137 error = GDATA_FILE_ERROR_NOT_FOUND; |
138 | 138 |
139 GDataCache* cache = GetGDataCache(profile); | 139 GDataCache* cache = GetGDataCache(profile); |
140 if (!cache || error != GDATA_FILE_OK) { | 140 if (!cache || error != GDATA_FILE_OK) { |
141 callback.Run(); | 141 callback.Run(); |
142 return; | 142 return; |
143 } | 143 } |
144 | 144 |
145 DCHECK(entry_proto.get()); | 145 DCHECK(entry_proto.get()); |
146 const std::string& resource_id = entry_proto->resource_id(); | 146 const std::string& resource_id = entry_proto->resource_id(); |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 *parsed_time -= base::TimeDelta::FromMinutes(offset_to_utc_in_minutes); | 565 *parsed_time -= base::TimeDelta::FromMinutes(offset_to_utc_in_minutes); |
566 } else { | 566 } else { |
567 *parsed_time = base::Time::FromLocalExploded(exploded); | 567 *parsed_time = base::Time::FromLocalExploded(exploded); |
568 } | 568 } |
569 | 569 |
570 return true; | 570 return true; |
571 } | 571 } |
572 | 572 |
573 } // namespace util | 573 } // namespace util |
574 } // namespace gdata | 574 } // namespace gdata |
OLD | NEW |