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

Unified Diff: components/nacl/loader/sfi_listener_delegate.h

Issue 439713002: Refactoring: Split NaClListener into two delegated classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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: components/nacl/loader/sfi_listener_delegate.h
diff --git a/components/nacl/loader/sfi_listener_delegate.h b/components/nacl/loader/sfi_listener_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f7d5b75b7991aa20cf17070b30668d55bd273cd
--- /dev/null
+++ b/components/nacl/loader/sfi_listener_delegate.h
@@ -0,0 +1,55 @@
+// Copyright 2014 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.
+
+#ifndef COMPONENTS_NACL_LOADER_SFI_LISTENER_DELEGATE_H_
+#define COMPONENTS_NACL_LOADER_SFI_LISTENER_DELEGATE_H_
+
+#include "base/macros.h"
+#include "components/nacl/loader/listener_delegate.h"
+
+namespace nacl {
+
+class SfiListenerDelegate : public ListenerDelegate {
+ public:
+ SfiListenerDelegate();
+ virtual ~SfiListenerDelegate();
+
+ virtual void Start(
+ const NaClStartParams& params,
+ scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy,
+ IPC::ChannelHandle trusted_channel_handle,
+ IPC::Sender* sender) OVERRIDE;
+
+#if defined(OS_LINUX)
+ void set_prereserved_sandbox_size(size_t prereserved_sandbox_size) {
+ prereserved_sandbox_size_ = prereserved_sandbox_size;
+ }
+#endif // OS_LINUX
+
+#if defined(OS_POSIX)
+ void set_number_of_cores(int number_of_cores) {
+ number_of_cores_ = number_of_cores;
+ }
+#endif // OS_POSIX
+
+ private:
+#if defined(OS_LINUX)
+ size_t prereserved_sandbox_size_;
+#endif // OS_LINUX
+
+#if defined(OS_POSIX)
+ // The outer sandbox on Linux and OSX prevents
+ // sysconf(_SC_NPROCESSORS) from working; in Windows, there are no
+ // problems with invoking GetSystemInfo. Therefore, only in
+ // OS_POSIX do we need to supply the number of cores into the
+ // NaClChromeMainArgs object.
+ int number_of_cores_;
+#endif // OS_POSIX
+
+ DISALLOW_COPY_AND_ASSIGN(SfiListenerDelegate);
+};
+
+} // namespace nacl
+
+#endif // COMPONENTS_NACL_LOADER_SFI_LISTENER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698