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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/nacl_delegate.cc
diff --git a/chrome/common/nacl_delegate.cc b/chrome/common/nacl_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e77efe92dafadb64316b8642515880c81be4e2fb
--- /dev/null
+++ b/chrome/common/nacl_delegate.cc
@@ -0,0 +1,73 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/nacl/common/nacl_delegate.h"
+
+#include "base/logging.h"
+#include "base/path_service.h"
+#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
+
+const char* NaClDelegate::GetSwitch(NaClSwitch switch_name) {
+ switch (switch_name) {
+ case kDisableBreakpad:
+ return switches::kDisableBreakpad;
+ case kDisableLogging:
+ return switches::kDisableLogging;
+ case kEnableDCHECK:
+ return switches::kEnableDCHECK;
+ case kEnableLogging:
+ return switches::kEnableLogging;
+ case kFullMemoryCrashReport:
+ return switches::kFullMemoryCrashReport;
+ case kLoggingLevel:
+ return switches::kLoggingLevel;
+ case kMemoryProfiling:
+ return switches::kMemoryProfiling;
+ case kNaClBrokerProcess:
+ return switches::kNaClBrokerProcess;
+ case kNaClLoaderProcess:
+ return switches::kNaClLoaderProcess;
+ case kNoErrorDialogs:
+ return switches::kNoErrorDialogs;
+ case kNoSandbox:
+ return switches::kNoSandbox;
+ case kProcessType:
+ return switches::kProcessType;
+ case kSilentDumpOnDCHECK:
+ return switches::kSilentDumpOnDCHECK;
+ case kTestNaClSandbox:
+ return switches::kTestNaClSandbox;
+#if defined(OS_MACOSX)
+ case kEnableSandboxLogging:
+ return switches::kEnableSandboxLogging;
+#endif
+ default:
+ NOTREACHED();
+ return NULL;
+ }
+}
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+bool NaClDelegate::GetFilePath(NaClFilePath path, base::FilePath* file_path) {
+ int chrome_path = 0;
+ switch (path) {
+ case kFileNaClHelper:
+ chrome_path = chrome::FILE_NACL_HELPER;
+ break;
+ case kFileNaClHelperBootstrap:
+ chrome_path = chrome::FILE_NACL_HELPER_BOOTSTRAP;
+ break;
+ default:
+ NOTREACHED();
+ return false;
+ }
+ return PathService::Get(chrome_path, file_path);
+}
+#endif
+
+NaClDelegate* GetNaClDelegate() {
+ static NaClDelegate* naclDelegate = new NaClDelegate;
+ return naclDelegate;
+}

Powered by Google App Engine
This is Rietveld 408576698