| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/plugin_process_host.h" | 5 #include "chrome/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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 BrowserThread::UI, FROM_HERE, | 162 BrowserThread::UI, FROM_HERE, |
| 163 NewRunnableFunction(mac_util::SetCursorVisibility, | 163 NewRunnableFunction(mac_util::SetCursorVisibility, |
| 164 true)); | 164 true)); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 #endif | 167 #endif |
| 168 // Cancel all pending and sent requests. | 168 // Cancel all pending and sent requests. |
| 169 CancelRequests(); | 169 CancelRequests(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool PluginProcessHost::Init(const WebPluginInfo& info, | 172 bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, |
| 173 const std::string& locale) { | 173 const std::string& locale) { |
| 174 info_ = info; | 174 info_ = info; |
| 175 set_name(UTF16ToWideHack(info_.name)); | 175 set_name(UTF16ToWideHack(info_.name)); |
| 176 set_version(UTF16ToWideHack(info_.version)); | 176 set_version(UTF16ToWideHack(info_.version)); |
| 177 | 177 |
| 178 if (!CreateChannel()) | 178 if (!CreateChannel()) |
| 179 return false; | 179 return false; |
| 180 | 180 |
| 181 // Build command line for plugin. When we have a plugin launcher, we can't | 181 // Build command line for plugin. When we have a plugin launcher, we can't |
| 182 // allow "self" on linux and we need the real file path. | 182 // allow "self" on linux and we need the real file path. |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 const std::vector<uint8>& data) { | 460 const std::vector<uint8>& data) { |
| 461 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 461 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 462 | 462 |
| 463 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); | 463 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); |
| 464 if (chrome_plugin) { | 464 if (chrome_plugin) { |
| 465 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); | 465 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); |
| 466 uint32 data_len = static_cast<uint32>(data.size()); | 466 uint32 data_len = static_cast<uint32>(data.size()); |
| 467 chrome_plugin->functions().on_message(data_ptr, data_len); | 467 chrome_plugin->functions().on_message(data_ptr, data_len); |
| 468 } | 468 } |
| 469 } | 469 } |
| OLD | NEW |