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

Side by Side Diff: webkit/glue/plugins/mozilla_extensions.cc

Issue 181014: Eliminate remaining WebCore dependencies from webplugin_impl.cc... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/glue/plugins/mozilla_extensions.h" 5 #include "webkit/glue/plugins/mozilla_extensions.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const char* url, 266 const char* url,
267 void* cookie_buffer, 267 void* cookie_buffer,
268 PRUint32& buffer_size) { 268 PRUint32& buffer_size) {
269 if ((!url) || (!cookie_buffer)) { 269 if ((!url) || (!cookie_buffer)) {
270 return NS_ERROR_INVALID_ARG; 270 return NS_ERROR_INVALID_ARG;
271 } 271 }
272 272
273 if (!plugin_instance_) 273 if (!plugin_instance_)
274 return NS_ERROR_FAILURE; 274 return NS_ERROR_FAILURE;
275 275
276 WebPlugin* webplugin = plugin_instance_->webplugin(); 276 webkit_glue::WebPlugin* webplugin = plugin_instance_->webplugin();
277 if (!webplugin) 277 if (!webplugin)
278 return NS_ERROR_FAILURE; 278 return NS_ERROR_FAILURE;
279 279
280 // Bypass third-party cookie blocking by using the url as the policy_url. 280 // Bypass third-party cookie blocking by using the url as the policy_url.
281 GURL cookies_url((std::string(url))); 281 GURL cookies_url((std::string(url)));
282 std::string cookies = webplugin->GetCookies(cookies_url, cookies_url); 282 std::string cookies = webplugin->GetCookies(cookies_url, cookies_url);
283 283
284 if (cookies.empty()) 284 if (cookies.empty())
285 return NS_ERROR_FAILURE; 285 return NS_ERROR_FAILURE;
286 286
(...skipping 12 matching lines...) Expand all
299 const char* url, 299 const char* url,
300 const void* cookie_buffer, 300 const void* cookie_buffer,
301 PRUint32 buffer_size){ 301 PRUint32 buffer_size){
302 if ((!url) || (!cookie_buffer) || (!buffer_size)) { 302 if ((!url) || (!cookie_buffer) || (!buffer_size)) {
303 return NS_ERROR_INVALID_ARG; 303 return NS_ERROR_INVALID_ARG;
304 } 304 }
305 305
306 if (!plugin_instance_) 306 if (!plugin_instance_)
307 return NS_ERROR_FAILURE; 307 return NS_ERROR_FAILURE;
308 308
309 WebPlugin* webplugin = plugin_instance_->webplugin(); 309 webkit_glue::WebPlugin* webplugin = plugin_instance_->webplugin();
310 if (!webplugin) 310 if (!webplugin)
311 return NS_ERROR_FAILURE; 311 return NS_ERROR_FAILURE;
312 312
313 std::string cookie(static_cast<const char*>(cookie_buffer), 313 std::string cookie(static_cast<const char*>(cookie_buffer),
314 buffer_size); 314 buffer_size);
315 GURL cookies_url((std::string(url))); 315 GURL cookies_url((std::string(url)));
316 webplugin->SetCookie(cookies_url, 316 webplugin->SetCookie(cookies_url,
317 cookies_url, 317 cookies_url,
318 cookie); 318 cookie);
319 return NS_OK; 319 return NS_OK;
320 } 320 }
321 321
322 322
323 } // namespace NPAPI 323 } // namespace NPAPI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698