summaryrefslogtreecommitdiffstats
path: root/content/ppapi_plugin
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 16:32:53 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 16:32:53 +0000
commit36254f7371c1f78a19442b4ae6fcab5f7cbcb330 (patch)
tree791a15f4881aa4d1105dd148f9ae5bb0e9a7dfdf /content/ppapi_plugin
parent52205c2324522017ee596cfdf97615baa4bd2b89 (diff)
downloadchromium_src-36254f7371c1f78a19442b4ae6fcab5f7cbcb330.zip
chromium_src-36254f7371c1f78a19442b4ae6fcab5f7cbcb330.tar.gz
chromium_src-36254f7371c1f78a19442b4ae6fcab5f7cbcb330.tar.bz2
Basic support for ppapi trusted broker process: --type=ppapi-broker.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6803016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r--content/ppapi_plugin/ppapi_broker_main.cc29
-rw-r--r--content/ppapi_plugin/ppapi_process.cc11
-rw-r--r--content/ppapi_plugin/ppapi_process.h20
3 files changed, 29 insertions, 31 deletions
diff --git a/content/ppapi_plugin/ppapi_broker_main.cc b/content/ppapi_plugin/ppapi_broker_main.cc
new file mode 100644
index 0000000..edaaa10
--- /dev/null
+++ b/content/ppapi_plugin/ppapi_broker_main.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 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 "base/message_loop.h"
+#include "base/threading/platform_thread.h"
+#include "build/build_config.h"
+#include "chrome/common/chrome_switches.h"
+#include "content/common/child_process.h"
+#include "content/common/main_function_params.h"
+#include "content/ppapi_plugin/ppapi_thread.h"
+
+// Main function for starting the PPAPI broker process.
+int PpapiBrokerMain(const MainFunctionParams& parameters) {
+ const CommandLine& command_line = parameters.command_line_;
+ if (command_line.HasSwitch(switches::kPpapiStartupDialog)) {
+ ChildProcess::WaitForDebugger("Ppapi");
+ }
+
+ MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT);
+ base::PlatformThread::SetName("CrPPAPIBrokerMain");
+
+ ChildProcess ppapi_broker_process;
+ //TODO:(ddorwin): Parameterize PpapiThread so the broker can reuse it.
+ ppapi_broker_process.set_main_thread(new PpapiThread());
+
+ main_message_loop.Run();
+ return 0;
+}
diff --git a/content/ppapi_plugin/ppapi_process.cc b/content/ppapi_plugin/ppapi_process.cc
deleted file mode 100644
index fdf1a19..0000000
--- a/content/ppapi_plugin/ppapi_process.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2010 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 "content/ppapi_plugin/ppapi_process.h"
-
-PpapiProcess::PpapiProcess() {
-}
-
-PpapiProcess::~PpapiProcess() {
-}
diff --git a/content/ppapi_plugin/ppapi_process.h b/content/ppapi_plugin/ppapi_process.h
deleted file mode 100644
index ed0dec9..0000000
--- a/content/ppapi_plugin/ppapi_process.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2011 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 CONTENT_PPAPI_PLUGIN_PPAPI_PROCESS_H_
-#define CONTENT_PPAPI_PLUGIN_PPAPI_PROCESS_H_
-#pragma once
-
-#include "content/common/child_process.h"
-
-class PpapiProcess : public ChildProcess {
- public:
- PpapiProcess();
- ~PpapiProcess();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PpapiProcess);
-};
-
-#endif // CONTENT_PPAPI_PLUGIN_PPAPI_PROCESS_H_