summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_main.cc5
-rw-r--r--chrome/plugin/plugin_process.cc8
-rw-r--r--chrome/plugin/plugin_process.h8
-rw-r--r--chrome/plugin/plugin_thread.cc2
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc3
5 files changed, 14 insertions, 12 deletions
diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc
index 84aa0b5..b925a01 100644
--- a/chrome/plugin/plugin_main.cc
+++ b/chrome/plugin/plugin_main.cc
@@ -50,8 +50,9 @@ int PluginMain(CommandLine &parsed_command_line,
std::wstring channel_name =
parsed_command_line.GetSwitchValue(switches::kProcessChannelID);
- std::wstring plugin_path =
- parsed_command_line.GetSwitchValue(switches::kPluginPath);
+ FilePath plugin_path =
+ FilePath::FromWStringHack(
+ parsed_command_line.GetSwitchValue(switches::kPluginPath));
if (PluginProcess::GlobalInit(channel_name, plugin_path)) {
if (!no_sandbox && target_services) {
target_services->LowerToken();
diff --git a/chrome/plugin/plugin_process.cc b/chrome/plugin/plugin_process.cc
index 23f9948..fe19b9b 100644
--- a/chrome/plugin/plugin_process.cc
+++ b/chrome/plugin/plugin_process.cc
@@ -16,7 +16,7 @@
// Custom factory to allow us to pass additional ctor arguments.
class PluginProcessFactory : public ChildProcessFactoryInterface {
public:
- explicit PluginProcessFactory(const std::wstring& plugin_path)
+ explicit PluginProcessFactory(const FilePath& plugin_path)
: plugin_path_(plugin_path) {
}
@@ -24,7 +24,7 @@ class PluginProcessFactory : public ChildProcessFactoryInterface {
return new PluginProcess(channel_name, plugin_path_);
}
- const std::wstring& plugin_path_;
+ const FilePath& plugin_path_;
};
// How long to wait after there are no more plugin instances before killing the
@@ -40,7 +40,7 @@ template <> struct RunnableMethodTraits<PluginProcess> {
};
PluginProcess::PluginProcess(const std::wstring& channel_name,
- const std::wstring& plugin_path) :
+ const FilePath& plugin_path) :
plugin_path_(plugin_path),
#pragma warning(suppress: 4355) // Okay to pass "this" here.
plugin_thread_(this, channel_name) {
@@ -50,7 +50,7 @@ PluginProcess::~PluginProcess() {
}
bool PluginProcess::GlobalInit(const std::wstring &channel_name,
- const std::wstring &plugin_path) {
+ const FilePath &plugin_path) {
PluginProcessFactory factory(plugin_path);
return ChildProcess::GlobalInit(channel_name, &factory);
}
diff --git a/chrome/plugin/plugin_process.h b/chrome/plugin/plugin_process.h
index 444d597..c7c0b78 100644
--- a/chrome/plugin/plugin_process.h
+++ b/chrome/plugin/plugin_process.h
@@ -14,7 +14,7 @@
class PluginProcess : public ChildProcess {
public:
static bool GlobalInit(const std::wstring& channel_name,
- const std::wstring& plugin_path);
+ const FilePath& plugin_path);
// Invoked with the response from the browser indicating whether it is
// ok to shutdown the plugin process.
@@ -26,19 +26,19 @@ class PluginProcess : public ChildProcess {
static void BrowserShutdown();
// File path of the plugin dll this process hosts.
- const std::wstring& plugin_path() { return plugin_path_; }
+ const FilePath& plugin_path() { return plugin_path_; }
private:
friend class PluginProcessFactory;
PluginProcess(const std::wstring& channel_name,
- const std::wstring& plugin_path);
+ const FilePath& plugin_path);
virtual ~PluginProcess();
virtual void OnFinalRelease();
void Shutdown();
void OnProcessShutdownTimeout();
- const std::wstring plugin_path_;
+ const FilePath plugin_path_;
// The thread where plugin instances live. Since NPAPI plugins weren't
// created with multi-threading in mind, running multiple instances on
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index 4fb4454..e9c1ecd 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -77,7 +77,7 @@ void PluginThread::Init() {
// Preload the dll to avoid loading, unloading then reloading
preloaded_plugin_module_ = NPAPI::PluginLib::LoadPluginHelper(
- plugin_process_->plugin_path().c_str());
+ plugin_process_->plugin_path());
ChromePluginLib::Create(plugin_process_->plugin_path(),
GetCPBrowserFuncsForPlugin());
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index daebf40..6d9cfe6 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -124,7 +124,8 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
}
CommandLine command_line;
- std::wstring path = command_line.GetSwitchValue(switches::kPluginPath);
+ FilePath path =
+ FilePath(command_line.GetSwitchValue(switches::kPluginPath));
delegate_ = WebPluginDelegateImpl::Create(
path, mime_type_, params.containing_window);
if (delegate_) {