| OLD | NEW |
| 1 // Copyright (c) 2009 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<> |
| 11 #endif | 11 #endif |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // TODO(mpcomplete): remove fallback case when Gears support is prevalent. | 542 // TODO(mpcomplete): remove fallback case when Gears support is prevalent. |
| 543 if (!context) | 543 if (!context) |
| 544 context = Profile::GetDefaultRequestContext()->GetURLRequestContext(); | 544 context = Profile::GetDefaultRequestContext()->GetURLRequestContext(); |
| 545 | 545 |
| 546 // Note: We don't have a first_party_for_cookies check because plugins bypass | 546 // Note: We don't have a first_party_for_cookies check because plugins bypass |
| 547 // third-party cookie blocking. | 547 // third-party cookie blocking. |
| 548 if (context && context->cookie_store()) { | 548 if (context && context->cookie_store()) { |
| 549 *cookies = context->cookie_store()->GetCookies(url); | 549 *cookies = context->cookie_store()->GetCookies(url); |
| 550 } else { | 550 } else { |
| 551 DLOG(ERROR) << "Could not serve plugin cookies request."; | 551 DLOG(ERROR) << "Could not serve plugin cookies request."; |
| 552 *cookies = EmptyString(); | 552 cookies->clear(); |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 void PluginProcessHost::OnAccessFiles(int renderer_id, | 556 void PluginProcessHost::OnAccessFiles(int renderer_id, |
| 557 const std::vector<std::string>& files, | 557 const std::vector<std::string>& files, |
| 558 bool* allowed) { | 558 bool* allowed) { |
| 559 ChildProcessSecurityPolicy* policy = | 559 ChildProcessSecurityPolicy* policy = |
| 560 ChildProcessSecurityPolicy::GetInstance(); | 560 ChildProcessSecurityPolicy::GetInstance(); |
| 561 | 561 |
| 562 for (size_t i = 0; i < files.size(); ++i) { | 562 for (size_t i = 0; i < files.size(); ++i) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 const std::vector<uint8>& data) { | 648 const std::vector<uint8>& data) { |
| 649 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 649 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 650 | 650 |
| 651 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); | 651 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); |
| 652 if (chrome_plugin) { | 652 if (chrome_plugin) { |
| 653 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); | 653 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); |
| 654 uint32 data_len = static_cast<uint32>(data.size()); | 654 uint32 data_len = static_cast<uint32>(data.size()); |
| 655 chrome_plugin->functions().on_message(data_ptr, data_len); | 655 chrome_plugin->functions().on_message(data_ptr, data_len); |
| 656 } | 656 } |
| 657 } | 657 } |
| OLD | NEW |