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

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

Issue 10815058: gdata: Check entry_proto.get() before calling has_file_specific_info() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 4 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 | « chrome/browser/chromeos/gdata/gdata_sync_client.cc ('k') | no next file » | 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_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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_sync_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698