Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Side by Side Diff: webkit/plugins/npapi/plugin_host.cc

Issue 7791005: Stop using the default profile's proxy service for plugin proxy requests, and instead use the ass... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix test Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/plugins/npapi/webplugin.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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"
OLDNEW
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/plugins/npapi/webplugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698