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

Side by Side Diff: chrome/browser/component_updater/pnacl/pnacl_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/component_updater/pnacl/pnacl_component_installer.h" 5 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 NOTREACHED() << "Pnacl component registration failed."; 318 NOTREACHED() << "Pnacl component registration failed.";
319 } 319 }
320 } 320 }
321 321
322 // Check if there is an existing version on disk first to know when 322 // Check if there is an existing version on disk first to know when
323 // a hosted version is actually newer. 323 // a hosted version is actually newer.
324 void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) { 324 void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) {
325 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 325 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
326 base::FilePath path = pci->GetPnaclBaseDirectory(); 326 base::FilePath path = pci->GetPnaclBaseDirectory();
327 if (!base::PathExists(path)) { 327 if (!base::PathExists(path)) {
328 if (!file_util::CreateDirectory(path)) { 328 if (!base::CreateDirectory(path)) {
329 NOTREACHED() << "Could not create base Pnacl directory."; 329 NOTREACHED() << "Could not create base Pnacl directory.";
330 return; 330 return;
331 } 331 }
332 } 332 }
333 333
334 Version current_version(kNullVersion); 334 Version current_version(kNullVersion);
335 std::string current_fingerprint; 335 std::string current_fingerprint;
336 std::vector<base::FilePath> older_dirs; 336 std::vector<base::FilePath> older_dirs;
337 if (GetLatestPnaclDirectory(pci, &path, &current_version, &older_dirs)) { 337 if (GetLatestPnaclDirectory(pci, &path, &current_version, &older_dirs)) {
338 scoped_ptr<base::DictionaryValue> manifest( 338 scoped_ptr<base::DictionaryValue> manifest(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 } 432 }
433 433
434 void PnaclComponentInstaller::ReRegisterPnacl() { 434 void PnaclComponentInstaller::ReRegisterPnacl() {
435 DCHECK(per_user_); 435 DCHECK(per_user_);
436 // Figure out profile information, before proceeding to look for files. 436 // Figure out profile information, before proceeding to look for files.
437 BrowserThread::PostTask( 437 BrowserThread::PostTask(
438 BrowserThread::UI, FROM_HERE, 438 BrowserThread::UI, FROM_HERE,
439 base::Bind(&GetProfileInformation, this)); 439 base::Bind(&GetProfileInformation, this));
440 } 440 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698