OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 #endif | 139 #endif |
140 // Cancel all pending and sent requests. | 140 // Cancel all pending and sent requests. |
141 CancelRequests(); | 141 CancelRequests(); |
142 } | 142 } |
143 | 143 |
144 bool PluginProcessHost::Send(IPC::Message* message) { | 144 bool PluginProcessHost::Send(IPC::Message* message) { |
145 return process_->Send(message); | 145 return process_->Send(message); |
146 } | 146 } |
147 | 147 |
148 bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { | 148 bool PluginProcessHost::Init(const WebPluginInfo& info) { |
149 info_ = info; | 149 info_ = info; |
150 process_->SetName(info_.name); | 150 process_->SetName(info_.name); |
151 | 151 |
152 std::string channel_id = process_->GetHost()->CreateChannel(); | 152 std::string channel_id = process_->GetHost()->CreateChannel(); |
153 if (channel_id.empty()) | 153 if (channel_id.empty()) |
154 return false; | 154 return false; |
155 | 155 |
156 // Build command line for plugin. When we have a plugin launcher, we can't | 156 // Build command line for plugin. When we have a plugin launcher, we can't |
157 // allow "self" on linux and we need the real file path. | 157 // allow "self" on linux and we need the real file path. |
158 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 158 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 void PluginProcessHost::OnChannelCreated( | 408 void PluginProcessHost::OnChannelCreated( |
409 const IPC::ChannelHandle& channel_handle) { | 409 const IPC::ChannelHandle& channel_handle) { |
410 Client* client = sent_requests_.front(); | 410 Client* client = sent_requests_.front(); |
411 | 411 |
412 if (client) | 412 if (client) |
413 client->OnChannelOpened(channel_handle); | 413 client->OnChannelOpened(channel_handle); |
414 sent_requests_.pop_front(); | 414 sent_requests_.pop_front(); |
415 } | 415 } |
416 | 416 |
417 } // namespace content | 417 } // namespace content |
OLD | NEW |