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

Side by Side Diff: chrome/browser/component_updater/pnacl/pnacl_component_installer.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize 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 24 matching lines...) Expand all
35 namespace { 35 namespace {
36 36
37 // Name of the Pnacl component specified in the manifest. 37 // Name of the Pnacl component specified in the manifest.
38 const char kPnaclManifestName[] = "PNaCl Translator"; 38 const char kPnaclManifestName[] = "PNaCl Translator";
39 39
40 // Sanitize characters from Pnacl Arch value so that they can be used 40 // Sanitize characters from Pnacl Arch value so that they can be used
41 // in path names. This should only be characters in the set: [a-z0-9_]. 41 // in path names. This should only be characters in the set: [a-z0-9_].
42 // Keep in sync with chrome/browser/nacl_host/nacl_file_host. 42 // Keep in sync with chrome/browser/nacl_host/nacl_file_host.
43 std::string SanitizeForPath(const std::string& input) { 43 std::string SanitizeForPath(const std::string& input) {
44 std::string result; 44 std::string result;
45 ReplaceChars(input, "-", "_", &result); 45 base::ReplaceChars(input, "-", "_", &result);
46 return result; 46 return result;
47 } 47 }
48 48
49 // Set the component's hash to the multi-CRX PNaCl package. 49 // Set the component's hash to the multi-CRX PNaCl package.
50 void SetPnaclHash(CrxComponent* component) { 50 void SetPnaclHash(CrxComponent* component) {
51 static const uint8 sha256_hash[32] = 51 static const uint8 sha256_hash[32] =
52 { // This corresponds to AppID: hnimpnehoodheedghdeeijklkeaacbdc 52 { // This corresponds to AppID: hnimpnehoodheedghdeeijklkeaacbdc
53 0x7d, 0x8c, 0xfd, 0x47, 0xee, 0x37, 0x44, 0x36, 0x73, 0x44, 53 0x7d, 0x8c, 0xfd, 0x47, 0xee, 0x37, 0x44, 0x36, 0x73, 0x44,
54 0x89, 0xab, 0xa4, 0x00, 0x21, 0x32, 0x4a, 0x06, 0x06, 0xf1, 0x51, 54 0x89, 0xab, 0xa4, 0x00, 0x21, 0x32, 0x4a, 0x06, 0x06, 0xf1, 0x51,
55 0x3c, 0x51, 0xba, 0x31, 0x2f, 0xbc, 0xb3, 0x99, 0x07, 0xdc, 0x9c}; 55 0x3c, 0x51, 0xba, 0x31, 0x2f, 0xbc, 0xb3, 0x99, 0x07, 0xdc, 0x9c};
(...skipping 375 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