OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/npapi/plugin_host.h" | 5 #include "webkit/plugins/npapi/plugin_host.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 999 |
1000 if (!url || !*url || !len) | 1000 if (!url || !*url || !len) |
1001 return NPERR_INVALID_URL; | 1001 return NPERR_INVALID_URL; |
1002 | 1002 |
1003 *len = 0; | 1003 *len = 0; |
1004 std::string result; | 1004 std::string result; |
1005 | 1005 |
1006 switch (variable) { | 1006 switch (variable) { |
1007 case NPNURLVProxy: { | 1007 case NPNURLVProxy: { |
1008 result = "DIRECT"; | 1008 result = "DIRECT"; |
1009 if (!webkit_glue::FindProxyForUrl(GURL((std::string(url))), &result)) | 1009 scoped_refptr<PluginInstance> plugin(FindInstance(id)); |
| 1010 if (!plugin) |
1010 return NPERR_GENERIC_ERROR; | 1011 return NPERR_GENERIC_ERROR; |
1011 | 1012 |
| 1013 WebPlugin* webplugin = plugin->webplugin(); |
| 1014 if (!webplugin) |
| 1015 return NPERR_GENERIC_ERROR; |
| 1016 |
| 1017 result = webplugin->FindProxyForUrl(GURL(std::string(url)), &result); |
1012 break; | 1018 break; |
1013 } | 1019 } |
1014 case NPNURLVCookie: { | 1020 case NPNURLVCookie: { |
1015 scoped_refptr<PluginInstance> plugin(FindInstance(id)); | 1021 scoped_refptr<PluginInstance> plugin(FindInstance(id)); |
1016 if (!plugin) | 1022 if (!plugin) |
1017 return NPERR_GENERIC_ERROR; | 1023 return NPERR_GENERIC_ERROR; |
1018 | 1024 |
1019 WebPlugin* webplugin = plugin->webplugin(); | 1025 WebPlugin* webplugin = plugin->webplugin(); |
1020 if (!webplugin) | 1026 if (!webplugin) |
1021 return NPERR_GENERIC_ERROR; | 1027 return NPERR_GENERIC_ERROR; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 } | 1155 } |
1150 | 1156 |
1151 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1157 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
1152 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1158 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
1153 if (plugin.get()) { | 1159 if (plugin.get()) { |
1154 plugin->URLRedirectResponse(!!allow, notify_data); | 1160 plugin->URLRedirectResponse(!!allow, notify_data); |
1155 } | 1161 } |
1156 } | 1162 } |
1157 | 1163 |
1158 } // extern "C" | 1164 } // extern "C" |
OLD | NEW |