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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 *installed_file = 105 *installed_file =
106 installer_traits_->GetBaseDirectory() 106 installer_traits_->GetBaseDirectory()
107 .AppendASCII(current_version_.GetString()).AppendASCII(file); 107 .AppendASCII(current_version_.GetString()).AppendASCII(file);
108 return true; 108 return true;
109 } 109 }
110 110
111 void DefaultComponentInstaller::StartRegistration( 111 void DefaultComponentInstaller::StartRegistration(
112 ComponentUpdateService* cus) { 112 ComponentUpdateService* cus) {
113 base::FilePath base_dir = installer_traits_->GetBaseDirectory(); 113 base::FilePath base_dir = installer_traits_->GetBaseDirectory();
114 if (!base::PathExists(base_dir) && 114 if (!base::PathExists(base_dir) &&
115 !file_util::CreateDirectory(base_dir)) { 115 !base::CreateDirectory(base_dir)) {
116 NOTREACHED() << "Could not create the base directory for " 116 NOTREACHED() << "Could not create the base directory for "
117 << installer_traits_->GetName() << " (" 117 << installer_traits_->GetName() << " ("
118 << base_dir.MaybeAsASCII() << ")."; 118 << base_dir.MaybeAsASCII() << ").";
119 return; 119 return;
120 } 120 }
121 121
122 base::FilePath latest_dir; 122 base::FilePath latest_dir;
123 base::Version latest_version(kNullVersion); 123 base::Version latest_version(kNullVersion);
124 std::vector<base::FilePath> older_dirs; 124 std::vector<base::FilePath> older_dirs;
125 bool found = false; 125 bool found = false;
(...skipping 75 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