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

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

Issue 9853022: gdata: Fix a bug that caused a deadlock when "Google Docs" is clicked (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/gdata/gdata_file_system.h" 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 LoadRootFeedFromCache(search_file_path, 517 LoadRootFeedFromCache(search_file_path,
518 true, // should_load_from_server 518 true, // should_load_from_server
519 callback); 519 callback);
520 return; 520 return;
521 } else if (root_->NeedsRefresh()) { 521 } else if (root_->NeedsRefresh()) {
522 // If content is stale or from disk from cache, fetch content from 522 // If content is stale or from disk from cache, fetch content from
523 // the server. 523 // the server.
524 LoadFeedFromServer(search_file_path, callback); 524 LoadFeedFromServer(search_file_path, callback);
525 return; 525 return;
526 } 526 }
527 GDataFileSystem::FindFileByPathOnCallingThread( 527
528 search_file_path, 528 // Post a task to the same thread, rather than calling it here, as
529 callback); 529 // FindFileByPathAsync() is asynchronous.
530 base::MessageLoopProxy::current()->PostTask(
Ben Chan 2012/03/26 16:28:42 Let's look into a better way to handle the lock bu
531 FROM_HERE,
532 base::Bind(&GDataFileSystem::FindFileByPathOnCallingThread,
533 GetWeakPtrForCurrentThread(),
534 search_file_path,
535 callback));
530 } 536 }
531 537
532 void GDataFileSystem::FindFileByPathOnCallingThread( 538 void GDataFileSystem::FindFileByPathOnCallingThread(
533 const FilePath& search_file_path, 539 const FilePath& search_file_path,
534 const FindFileCallback& callback) { 540 const FindFileCallback& callback) {
535 FindFileCallbackRelayDelegate delegate(callback); 541 FindFileCallbackRelayDelegate delegate(callback);
536 FindFileByPathSync(search_file_path, &delegate); 542 FindFileByPathSync(search_file_path, &delegate);
537 } 543 }
538 544
539 void GDataFileSystem::LoadFeedFromServer( 545 void GDataFileSystem::LoadFeedFromServer(
(...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after
3562 const bool posted = BrowserThread::PostTask( 3568 const bool posted = BrowserThread::PostTask(
3563 BrowserThread::FILE, 3569 BrowserThread::FILE,
3564 from_here, 3570 from_here,
3565 base::Bind(&GDataFileSystem::RunTaskOnIOThreadPool, 3571 base::Bind(&GDataFileSystem::RunTaskOnIOThreadPool,
3566 base::Unretained(this), 3572 base::Unretained(this),
3567 task)); 3573 task));
3568 DCHECK(posted); 3574 DCHECK(posted);
3569 } 3575 }
3570 3576
3571 } // namespace gdata 3577 } // namespace gdata
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