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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_app_data.cc

Issue 1080453002: Always destroy CrxInstaller on the UI Thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOZ Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_mode/kiosk_app_data.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } // namespace 85 } // namespace
86 86
87 //////////////////////////////////////////////////////////////////////////////// 87 ////////////////////////////////////////////////////////////////////////////////
88 // KioskAppData::CrxLoader 88 // KioskAppData::CrxLoader
89 // Loads meta data from crx file. 89 // Loads meta data from crx file.
90 90
91 class KioskAppData::CrxLoader : public extensions::SandboxedUnpackerClient { 91 class KioskAppData::CrxLoader : public extensions::SandboxedUnpackerClient {
92 public: 92 public:
93 CrxLoader(const base::WeakPtr<KioskAppData>& client, 93 CrxLoader(const base::WeakPtr<KioskAppData>& client,
94 const base::FilePath& crx_file) 94 const base::FilePath& crx_file)
95 : client_(client), 95 : SandboxedUnpackerClient(
96 content::BrowserThread::GetMessageLoopProxyForThread(
97 content::BrowserThread::UI)),
98 client_(client),
96 crx_file_(crx_file), 99 crx_file_(crx_file),
97 success_(false) { 100 success_(false) {}
98 }
99 101
100 void Start() { 102 void Start() {
101 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 103 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
102 base::SequencedWorkerPool::SequenceToken token = 104 base::SequencedWorkerPool::SequenceToken token =
103 pool->GetNamedSequenceToken("KioskAppData.CrxLoaderWorker"); 105 pool->GetNamedSequenceToken("KioskAppData.CrxLoaderWorker");
104 task_runner_ = pool->GetSequencedTaskRunnerWithShutdownBehavior( 106 task_runner_ = pool->GetSequencedTaskRunnerWithShutdownBehavior(
105 token, 107 token,
106 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); 108 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
107 task_runner_->PostTask(FROM_HERE, 109 task_runner_->PostTask(FROM_HERE,
108 base::Bind(&CrxLoader::StartOnBlockingPool, this)); 110 base::Bind(&CrxLoader::StartOnBlockingPool, this));
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 656
655 SkBitmap icon = crx_loader->icon(); 657 SkBitmap icon = crx_loader->icon();
656 if (icon.empty()) 658 if (icon.empty())
657 icon = *extensions::util::GetDefaultAppIcon().bitmap(); 659 icon = *extensions::util::GetDefaultAppIcon().bitmap();
658 SetCache(crx_loader->name(), icon); 660 SetCache(crx_loader->name(), icon);
659 661
660 SetStatus(STATUS_LOADED); 662 SetStatus(STATUS_LOADED);
661 } 663 }
662 664
663 } // namespace chromeos 665 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698