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

Side by Side Diff: chrome/common/nacl_delegate.cc

Issue 16881004: Move chrome/nacl to components/nacl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build fix Created 7 years, 6 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/nacl/common/nacl_delegate.h"
6
7 #include "base/logging.h"
8 #include "base/path_service.h"
9 #include "chrome/common/chrome_paths.h"
10 #include "chrome/common/chrome_switches.h"
11
12 const char* NaClDelegate::GetSwitch(NaClSwitch switch_name) {
13 switch (switch_name) {
14 case kDisableBreakpad:
15 return switches::kDisableBreakpad;
16 case kDisableLogging:
17 return switches::kDisableLogging;
18 case kEnableDCHECK:
19 return switches::kEnableDCHECK;
20 case kEnableLogging:
21 return switches::kEnableLogging;
22 case kFullMemoryCrashReport:
23 return switches::kFullMemoryCrashReport;
24 case kLoggingLevel:
25 return switches::kLoggingLevel;
26 case kMemoryProfiling:
27 return switches::kMemoryProfiling;
28 case kNaClBrokerProcess:
29 return switches::kNaClBrokerProcess;
30 case kNaClLoaderProcess:
31 return switches::kNaClLoaderProcess;
32 case kNoErrorDialogs:
33 return switches::kNoErrorDialogs;
34 case kNoSandbox:
35 return switches::kNoSandbox;
36 case kProcessType:
37 return switches::kProcessType;
38 case kSilentDumpOnDCHECK:
39 return switches::kSilentDumpOnDCHECK;
40 case kTestNaClSandbox:
41 return switches::kTestNaClSandbox;
42 #if defined(OS_MACOSX)
43 case kEnableSandboxLogging:
44 return switches::kEnableSandboxLogging;
45 #endif
46 default:
47 NOTREACHED();
48 return NULL;
49 }
50 }
51
52 #if defined(OS_POSIX) && !defined(OS_MACOSX)
53 bool NaClDelegate::GetFilePath(NaClFilePath path, base::FilePath* file_path) {
54 int chrome_path = 0;
55 switch (path) {
56 case kFileNaClHelper:
57 chrome_path = chrome::FILE_NACL_HELPER;
58 break;
59 case kFileNaClHelperBootstrap:
60 chrome_path = chrome::FILE_NACL_HELPER_BOOTSTRAP;
61 break;
62 default:
63 NOTREACHED();
64 return false;
65 }
66 return PathService::Get(chrome_path, file_path);
67 }
68 #endif
69
70 NaClDelegate* GetNaClDelegate() {
71 static NaClDelegate* naclDelegate = new NaClDelegate;
72 return naclDelegate;
73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698