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

Side by Side Diff: chrome/browser/chromeos/contacts/contact_database.cc

Issue 10829144: contacts: Add GoogleContactStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix leaked contacts in GoogleContactStore::MergeContacts() 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 | « no previous file | chrome/browser/chromeos/contacts/contact_store.h » ('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) 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/contacts/contact_database.h" 5 #include "chrome/browser/chromeos/contacts/contact_database.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace contacts { 23 namespace contacts {
24 24
25 namespace { 25 namespace {
26 26
27 // LevelDB key used for storing UpdateMetadata messages. 27 // LevelDB key used for storing UpdateMetadata messages.
28 const char kUpdateMetadataKey[] = "__chrome_update_metadata__"; 28 const char kUpdateMetadataKey[] = "__chrome_update_metadata__";
29 29
30 } // namespace 30 } // namespace
31 31
32 ContactDatabase::ContactDatabase() : weak_ptr_factory_(this) { 32 ContactDatabase::ContactDatabase()
33 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
34 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 35 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
35 task_runner_ = pool->GetSequencedTaskRunner(pool->GetSequenceToken()); 36 task_runner_ = pool->GetSequencedTaskRunner(pool->GetSequenceToken());
36 } 37 }
37 38
38 void ContactDatabase::DestroyOnUIThread() { 39 void ContactDatabase::DestroyOnUIThread() {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
40 weak_ptr_factory_.InvalidateWeakPtrs(); 41 weak_ptr_factory_.InvalidateWeakPtrs();
41 task_runner_->PostNonNestableTask( 42 task_runner_->PostNonNestableTask(
42 FROM_HERE, 43 FROM_HERE,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 275 }
275 contacts->push_back(contact.release()); 276 contacts->push_back(contact.release());
276 } 277 }
277 db_iterator->Next(); 278 db_iterator->Next();
278 } 279 }
279 280
280 *success = true; 281 *success = true;
281 } 282 }
282 283
283 } // namespace contacts 284 } // namespace contacts
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/contacts/contact_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698