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

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

Issue 10830181: Implement initialization for GDataCache to use in-memory metadata for tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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_cache_metadata.h" 5 #include "chrome/browser/chromeos/gdata/gdata_cache_metadata.h"
6 6
7 #include <leveldb/db.h> 7 #include <leveldb/db.h>
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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 base::SequencedTaskRunner* blocking_task_runner) 583 base::SequencedTaskRunner* blocking_task_runner)
584 : blocking_task_runner_(blocking_task_runner) { 584 : blocking_task_runner_(blocking_task_runner) {
585 AssertOnSequencedWorkerPool(); 585 AssertOnSequencedWorkerPool();
586 } 586 }
587 587
588 GDataCacheMetadata::~GDataCacheMetadata() { 588 GDataCacheMetadata::~GDataCacheMetadata() {
589 AssertOnSequencedWorkerPool(); 589 AssertOnSequencedWorkerPool();
590 } 590 }
591 591
592 // static 592 // static
593 scoped_ptr<GDataCacheMetadata> GDataCacheMetadata::CreateGDataCacheMetadata( 593 scoped_ptr<GDataCacheMetadata> GDataCacheMetadata::CreateGDataCacheMetadata(
achuithb 2012/08/06 23:22:20 It may be better to write a separate function like
satorux1 2012/08/07 10:50:08 agreed!
Haruki Sato 2012/08/08 05:00:42 Done!
594 base::SequencedTaskRunner* blocking_task_runner) { 594 base::SequencedTaskRunner* blocking_task_runner, bool use_map) {
595 return scoped_ptr<GDataCacheMetadata>( 595 return use_map ?
596 new GDataCacheMetadataDB(blocking_task_runner)); 596 scoped_ptr<GDataCacheMetadata>(
597 new GDataCacheMetadataMap(blocking_task_runner)) :
598 scoped_ptr<GDataCacheMetadata>(
599 new GDataCacheMetadataDB(blocking_task_runner));
597 } 600 }
598 601
599 void GDataCacheMetadata::AssertOnSequencedWorkerPool() { 602 void GDataCacheMetadata::AssertOnSequencedWorkerPool() {
600 DCHECK(!blocking_task_runner_ || 603 DCHECK(!blocking_task_runner_ ||
601 blocking_task_runner_->RunsTasksOnCurrentThread()); 604 blocking_task_runner_->RunsTasksOnCurrentThread());
602 } 605 }
603 606
604 } // namespace gdata 607 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698