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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc

Issue 2704123007: mediaview: Fix ARC file system operation deferring. (Closed)
Patch Set: Addressed hidehiko's comments. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
index 46687431e3afcac62eb91ef5618c173a7eeede4a..9e914c16f9b9ebc06ccca3ee45277ad827f8a7a1 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
+++ b/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc
@@ -29,17 +29,22 @@ ArcFileSystemOperationRunner::CreateForTesting(
// We can't use base::MakeUnique() here because we are calling a private
// constructor.
return base::WrapUnique<ArcFileSystemOperationRunner>(
- new ArcFileSystemOperationRunner(bridge_service, false));
+ new ArcFileSystemOperationRunner(bridge_service, nullptr, false));
}
ArcFileSystemOperationRunner::ArcFileSystemOperationRunner(
- ArcBridgeService* bridge_service)
- : ArcFileSystemOperationRunner(bridge_service, true) {}
+ ArcBridgeService* bridge_service,
+ const Profile* profile)
+ : ArcFileSystemOperationRunner(bridge_service, profile, true) {
+ DCHECK(profile);
+}
ArcFileSystemOperationRunner::ArcFileSystemOperationRunner(
ArcBridgeService* bridge_service,
+ const Profile* profile,
bool observe_events)
: ArcService(bridge_service),
+ profile_(profile),
observe_events_(observe_events),
weak_ptr_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -162,11 +167,8 @@ void ArcFileSystemOperationRunner::OnInstanceClosed() {
void ArcFileSystemOperationRunner::OnStateChanged() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // TODO(hidehiko): Revisit the condition, when ARC is running without
- // profile.
- SetShouldDefer(
- IsArcPlayStoreEnabledForProfile(ArcSessionManager::Get()->profile()) &&
- !arc_bridge_service()->file_system()->has_instance());
+ SetShouldDefer(IsArcPlayStoreEnabledForProfile(profile_) &&
+ !arc_bridge_service()->file_system()->has_instance());
}
void ArcFileSystemOperationRunner::SetShouldDefer(bool should_defer) {

Powered by Google App Engine
This is Rietveld 408576698