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

Side by Side Diff: chrome/browser/component_updater/default_component_installer.cc

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: Threading model changes. Created 7 years, 1 month 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 found = true; 145 found = true;
146 } 146 }
147 } 147 }
148 148
149 if (found) { 149 if (found) {
150 current_version_ = latest_version; 150 current_version_ = latest_version;
151 // TODO(ddorwin): Remove these members and pass them directly to 151 // TODO(ddorwin): Remove these members and pass them directly to
152 // FinishRegistration(). 152 // FinishRegistration().
153 base::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"), 153 base::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"),
154 &current_fingerprint_); 154 &current_fingerprint_);
155 current_manifest_= ReadManifest(latest_dir); 155 current_manifest_= component_updater::ReadManifest(latest_dir);
156 if (!current_manifest_) { 156 if (!current_manifest_) {
157 DLOG(ERROR) << "Failed to read manifest for " 157 DLOG(ERROR) << "Failed to read manifest for "
158 << installer_traits_->GetName() << " (" 158 << installer_traits_->GetName() << " ("
159 << base_dir.MaybeAsASCII() << ")."; 159 << base_dir.MaybeAsASCII() << ").";
160 return; 160 return;
161 } 161 }
162 } 162 }
163 163
164 // Remove older versions of the component. None should be in use during 164 // Remove older versions of the component. None should be in use during
165 // browser startup. 165 // browser startup.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { 202 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) {
203 scoped_ptr<base::DictionaryValue> manifest_copy( 203 scoped_ptr<base::DictionaryValue> manifest_copy(
204 current_manifest_->DeepCopy()); 204 current_manifest_->DeepCopy());
205 installer_traits_->ComponentReady( 205 installer_traits_->ComponentReady(
206 current_version_, 206 current_version_,
207 GetInstallDirectory(), 207 GetInstallDirectory(),
208 manifest_copy.Pass()); 208 manifest_copy.Pass());
209 } 209 }
210 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698