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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_sync_client.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, 5 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
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_sync_client.h" 5 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h"
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 } 320 }
321 321
322 void GDataSyncClient::OnGetEntryInfoByResourceId( 322 void GDataSyncClient::OnGetEntryInfoByResourceId(
323 const std::string& resource_id, 323 const std::string& resource_id,
324 GDataFileError error, 324 GDataFileError error,
325 const FilePath& /* gdata_file_path */, 325 const FilePath& /* gdata_file_path */,
326 scoped_ptr<GDataEntryProto> entry_proto) { 326 scoped_ptr<GDataEntryProto> entry_proto) {
327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 327 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
328 328
329 if (!entry_proto->has_file_specific_info()) 329 if (entry_proto.get() && !entry_proto->has_file_specific_info())
330 error = GDATA_FILE_ERROR_NOT_FOUND; 330 error = GDATA_FILE_ERROR_NOT_FOUND;
331 331
332 if (error != GDATA_FILE_OK) { 332 if (error != GDATA_FILE_OK) {
333 LOG(WARNING) << "Entry not found: " << resource_id; 333 LOG(WARNING) << "Entry not found: " << resource_id;
334 return; 334 return;
335 } 335 }
336 336
337 cache_->GetCacheEntryOnUIThread( 337 cache_->GetCacheEntryOnUIThread(
338 resource_id, 338 resource_id,
339 "" /* don't check MD5 */, 339 "" /* don't check MD5 */,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 const content::NotificationDetails& details) { 457 const content::NotificationDetails& details) {
458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
459 459
460 // Resume the sync loop if gdata preferences are changed. Note that we 460 // Resume the sync loop if gdata preferences are changed. Note that we
461 // don't need to check the new values here as these will be checked in 461 // don't need to check the new values here as these will be checked in
462 // ShouldStopSyncLoop() as soon as the loop is resumed. 462 // ShouldStopSyncLoop() as soon as the loop is resumed.
463 StartSyncLoop(); 463 StartSyncLoop();
464 } 464 }
465 465
466 } // namespace gdata 466 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_protocol_handler.cc ('k') | chrome/browser/chromeos/gdata/gdata_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698