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

Side by Side Diff: chrome/browser/sync/internal_api/sync_manager.cc

Issue 8568041: [Sync] Add type conversion constructor for WeakHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up tests a bit Created 9 years, 1 month 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 | chrome/browser/sync/js/js_test_util.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sync/internal_api/sync_manager.h" 5 #include "chrome/browser/sync/internal_api/sync_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 trans.GetCryptographer()->AddObserver(this); 819 trans.GetCryptographer()->AddObserver(this);
820 } 820 }
821 821
822 // Notify that initialization is complete. Note: This should be the last to 822 // Notify that initialization is complete. Note: This should be the last to
823 // execute if |signed_in| is false. Reason being in that case we would 823 // execute if |signed_in| is false. Reason being in that case we would
824 // post a task to shutdown sync. But if this function posts any other tasks 824 // post a task to shutdown sync. But if this function posts any other tasks
825 // on the UI thread and if shutdown wins then that tasks would execute on 825 // on the UI thread and if shutdown wins then that tasks would execute on
826 // a freed pointer. This is because UI thread is not shut down. 826 // a freed pointer. This is because UI thread is not shut down.
827 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, 827 FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
828 OnInitializationComplete( 828 OnInitializationComplete(
829 WeakHandle<JsBackend>(weak_ptr_factory_.GetWeakPtr()), 829 MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()),
830 signed_in)); 830 signed_in));
831 831
832 if (!signed_in && !setup_for_test_mode_) 832 if (!signed_in && !setup_for_test_mode_)
833 return false; 833 return false;
834 834
835 sync_notifier_->AddObserver(this); 835 sync_notifier_->AddObserver(this);
836 836
837 return signed_in; 837 return signed_in;
838 } 838 }
839 839
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 lookup->GetDownloadProgress(*i, &marker); 2109 lookup->GetDownloadProgress(*i, &marker);
2110 2110
2111 if (marker.token().empty()) 2111 if (marker.token().empty())
2112 result.insert(*i); 2112 result.insert(*i);
2113 2113
2114 } 2114 }
2115 return result; 2115 return result;
2116 } 2116 }
2117 2117
2118 } // namespace sync_api 2118 } // namespace sync_api
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/js/js_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698