summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-09 16:41:58 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-09 16:41:58 +0000
commit87af8aa076cc2cb064e2ac689111739211e86873 (patch)
tree27d310cca2380786e2c6268b0dd8f5dc71ffd7a0 /content
parent80210705ce0523cc7eadb126c804eafb3cacbd9c (diff)
downloadchromium_src-87af8aa076cc2cb064e2ac689111739211e86873.zip
chromium_src-87af8aa076cc2cb064e2ac689111739211e86873.tar.gz
chromium_src-87af8aa076cc2cb064e2ac689111739211e86873.tar.bz2
Add a PathService id for the child process exe. This is needed so that the remaining Chrome specific bit in ChildProcessHost can be taken out.
Review URL: http://codereview.chromium.org/6648019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/content_paths.cc28
-rw-r--r--content/common/content_paths.h28
-rw-r--r--content/common/content_switches.cc3
-rw-r--r--content/common/content_switches.h1
-rw-r--r--content/content_common.gypi2
5 files changed, 62 insertions, 0 deletions
diff --git a/content/common/content_paths.cc b/content/common/content_paths.cc
new file mode 100644
index 0000000..4e9b32b
--- /dev/null
+++ b/content/common/content_paths.cc
@@ -0,0 +1,28 @@
+// 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 "content/common/content_paths.h"
+
+#include "base/path_service.h"
+
+namespace content {
+
+bool PathProvider(int key, FilePath* result) {
+ switch (key) {
+ case CHILD_PROCESS_EXE:
+ return PathService::Get(base::FILE_EXE, result);
+ default:
+ break;
+ }
+
+ return false;
+}
+
+// This cannot be done as a static initializer sadly since Visual Studio will
+// eliminate this object file if there is no direct entry point into it.
+void RegisterPathProvider() {
+ PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
+}
+
+} // namespace content
diff --git a/content/common/content_paths.h b/content/common/content_paths.h
new file mode 100644
index 0000000..49720a0
--- /dev/null
+++ b/content/common/content_paths.h
@@ -0,0 +1,28 @@
+// 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_COMMON_CONTENT_PATHS_H_
+#define CONTENT_COMMON_CONTENT_PATHS_H_
+#pragma once
+
+// This file declares path keys for the content module. These can be used with
+// the PathService to access various special directories and files.
+
+namespace content {
+
+enum {
+ PATH_START = 4000,
+
+ // Path and filename to the executable to use for child processes.
+ CHILD_PROCESS_EXE = PATH_START,
+
+ PATH_END
+};
+
+// Call once to register the provider for the path keys defined above.
+void RegisterPathProvider();
+
+} // namespace content
+
+#endif // CONTENT_COMMON_CONTENT_PATHS_H_
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index b70bc80..f23f42c 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -13,6 +13,9 @@ const char kAllowFileAccessFromFiles[] = "allow-file-access-from-files";
// Allows debugging of sandboxed processes (see zygote_main_linux.cc).
const char kAllowSandboxDebugging[] = "allow-sandbox-debugging";
+// Path to the exe to run for the renderer and plugin subprocesses.
+const char kBrowserSubprocessPath[] = "browser-subprocess-path";
+
// Disable limits on the number of backing stores. Can prevent blinking for
// users with many windows/tabs and lots of memory.
const char kDisableBackingStoreLimit[] = "disable-backing-store-limit";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index 6208fdc..5bf44bc 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -12,6 +12,7 @@ namespace switches {
extern const char kAllowFileAccessFromFiles[];
extern const char kAllowSandboxDebugging[];
+extern const char kBrowserSubprocessPath[];
extern const char kDisableBackingStoreLimit[];
extern const char kDisableFileSystem[];
extern const char kDisableGpuSandbox[];
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 42af15e..0925ebb 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -26,6 +26,8 @@
'common/content_message_generator.h',
'common/content_constants.cc',
'common/content_constants.h',
+ 'common/content_paths.cc',
+ 'common/content_paths.h',
'common/content_switches.cc',
'common/content_switches.h',
'common/file_system/file_system_dispatcher.cc',