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

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

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest build for windows. Created 5 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 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void StartOnBlockingPool() { 139 void StartOnBlockingPool() {
140 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 140 DCHECK(task_runner_->RunsTasksOnCurrentThread());
141 141
142 if (!temp_dir_.CreateUniqueTempDir()) { 142 if (!temp_dir_.CreateUniqueTempDir()) {
143 success_ = false; 143 success_ = false;
144 NotifyFinishedOnBlockingPool(); 144 NotifyFinishedOnBlockingPool();
145 return; 145 return;
146 } 146 }
147 147
148 scoped_refptr<extensions::SandboxedUnpacker> unpacker( 148 scoped_refptr<extensions::SandboxedUnpacker> unpacker(
149 new extensions::SandboxedUnpacker(crx_file_, 149 new extensions::SandboxedUnpacker(
150 extensions::Manifest::INTERNAL, 150 extensions::CRXFileInfo(crx_file_), extensions::Manifest::INTERNAL,
151 extensions::Extension::NO_FLAGS, 151 extensions::Extension::NO_FLAGS, temp_dir_.path(),
152 temp_dir_.path(), 152 task_runner_.get(), this));
153 task_runner_.get(),
154 this));
155 unpacker->Start(); 153 unpacker->Start();
156 } 154 }
157 155
158 void NotifyFinishedOnBlockingPool() { 156 void NotifyFinishedOnBlockingPool() {
159 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 157 DCHECK(task_runner_->RunsTasksOnCurrentThread());
160 158
161 if (!temp_dir_.Delete()) { 159 if (!temp_dir_.Delete()) {
162 LOG(WARNING) << "Can not delete temp directory at " 160 LOG(WARNING) << "Can not delete temp directory at "
163 << temp_dir_.path().value(); 161 << temp_dir_.path().value();
164 } 162 }
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 644
647 SkBitmap icon = crx_loader->icon(); 645 SkBitmap icon = crx_loader->icon();
648 if (icon.empty()) 646 if (icon.empty())
649 icon = *extensions::util::GetDefaultAppIcon().bitmap(); 647 icon = *extensions::util::GetDefaultAppIcon().bitmap();
650 SetCache(crx_loader->name(), icon); 648 SetCache(crx_loader->name(), icon);
651 649
652 SetStatus(STATUS_LOADED); 650 SetStatus(STATUS_LOADED);
653 } 651 }
654 652
655 } // namespace chromeos 653 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_browsertest.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_external_update_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698