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

Side by Side Diff: chrome/browser/chromeos/drive/change_list_processor.cc

Issue 14189022: chromeos: Fix wrong error handling of SetLargestChangestamp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « no previous file | 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/drive/change_list_processor.h" 5 #include "chrome/browser/chromeos/drive/change_list_processor.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/chromeos/drive/drive.pb.h" 10 #include "chrome/browser/chromeos/drive/drive.pb.h"
11 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" 11 #include "chrome/browser/chromeos/drive/drive_file_system_util.h"
12 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" 12 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
13 #include "chrome/browser/chromeos/drive/resource_entry_conversion.h" 13 #include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
14 #include "chrome/browser/google_apis/gdata_wapi_parser.h" 14 #include "chrome/browser/google_apis/gdata_wapi_parser.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 16
17 using content::BrowserThread; 17 using content::BrowserThread;
18 18
19 namespace drive { 19 namespace drive {
20 20
21 namespace { 21 namespace {
22 22
23 // Callback for DriveResourceMetadata::SetLargestChangestamp. 23 // Callback for DriveResourceMetadata::SetLargestChangestamp.
24 // Runs |on_complete_callback|. |on_complete_callback| must not be null. 24 // Runs |on_complete_callback|. |on_complete_callback| must not be null.
25 void RunOnCompleteCallback(const base::Closure& on_complete_callback, 25 void RunOnCompleteCallback(const base::Closure& on_complete_callback,
26 DriveFileError error) { 26 DriveFileError error) {
27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
28 DCHECK(!on_complete_callback.is_null()); 28 DCHECK(!on_complete_callback.is_null());
29 DCHECK_EQ(DRIVE_FILE_OK, error); 29 DLOG_IF(ERROR, error != DRIVE_FILE_OK) << "SetLargestChangeStamp failed: "
30 30 << DriveFileErrorToString(error);
31 on_complete_callback.Run(); 31 on_complete_callback.Run();
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 35
36 ChangeList::ChangeList(const google_apis::ResourceList& resource_list) 36 ChangeList::ChangeList(const google_apis::ResourceList& resource_list)
37 : largest_changestamp_(resource_list.largest_changestamp()) { 37 : largest_changestamp_(resource_list.largest_changestamp()) {
38 resource_list.GetNextFeedURL(&next_url_); 38 resource_list.GetNextFeedURL(&next_url_);
39 39
40 entries_.resize(resource_list.entries().size()); 40 entries_.resize(resource_list.entries().size());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 void ChangeListProcessor::Clear() { 468 void ChangeListProcessor::Clear() {
469 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 469 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
470 470
471 entry_proto_map_.clear(); 471 entry_proto_map_.clear();
472 changed_dirs_.clear(); 472 changed_dirs_.clear();
473 largest_changestamp_ = 0; 473 largest_changestamp_ = 0;
474 on_complete_callback_.Reset(); 474 on_complete_callback_.Reset();
475 } 475 }
476 476
477 } // namespace drive 477 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698