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

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

Issue 14914008: Fix 64 bit compile errors flagged by conversions from size_t to uint32. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 base::PlatformFileInfo post_file_info; 476 base::PlatformFileInfo post_file_info;
477 if (!file_util::GetFileInfo(file_path, &post_file_info) || 477 if (!file_util::GetFileInfo(file_path, &post_file_info) ||
478 post_file_info.is_directory) 478 post_file_info.is_directory)
479 return NPERR_FILE_NOT_FOUND; 479 return NPERR_FILE_NOT_FOUND;
480 480
481 if (!file_util::ReadFileToString(file_path, &post_file_contents)) 481 if (!file_util::ReadFileToString(file_path, &post_file_contents))
482 return NPERR_FILE_NOT_FOUND; 482 return NPERR_FILE_NOT_FOUND;
483 483
484 buf = post_file_contents.c_str(); 484 buf = post_file_contents.c_str();
485 len = post_file_contents.size(); 485 len = static_cast<uint32_t>(post_file_contents.size());
486 } 486 }
487 487
488 // The post data sent by a plugin contains both headers 488 // The post data sent by a plugin contains both headers
489 // and post data. Example: 489 // and post data. Example:
490 // Content-type: text/html 490 // Content-type: text/html
491 // Content-length: 200 491 // Content-length: 200
492 // 492 //
493 // <200 bytes of content here> 493 // <200 bytes of content here>
494 // 494 //
495 // Unfortunately, our stream needs these broken apart, 495 // Unfortunately, our stream needs these broken apart,
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 GURL cookies_url((std::string(url))); 981 GURL cookies_url((std::string(url)));
982 result = webplugin->GetCookies(cookies_url, cookies_url); 982 result = webplugin->GetCookies(cookies_url, cookies_url);
983 break; 983 break;
984 } 984 }
985 default: 985 default:
986 return NPERR_GENERIC_ERROR; 986 return NPERR_GENERIC_ERROR;
987 } 987 }
988 988
989 // Allocate this using the NPAPI allocator. The plugin will call 989 // Allocate this using the NPAPI allocator. The plugin will call
990 // NPN_Free to free this. 990 // NPN_Free to free this.
991 *value = static_cast<char*>(NPN_MemAlloc(result.length() + 1)); 991 *value = static_cast<char*>(
992 NPN_MemAlloc(static_cast<uint32_t>(result.length()) + 1));
992 base::strlcpy(*value, result.c_str(), result.length() + 1); 993 base::strlcpy(*value, result.c_str(), result.length() + 1);
993 *len = result.length(); 994 *len = static_cast<uint32_t>(result.length());
994 995
995 return NPERR_NO_ERROR; 996 return NPERR_NO_ERROR;
996 } 997 }
997 998
998 NPError NPN_SetValueForURL(NPP id, 999 NPError NPN_SetValueForURL(NPP id,
999 NPNURLVariable variable, 1000 NPNURLVariable variable,
1000 const char* url, 1001 const char* url,
1001 const char* value, 1002 const char* value,
1002 uint32_t len) { 1003 uint32_t len) {
1003 if (!id) 1004 if (!id)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 } 1106 }
1106 1107
1107 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { 1108 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) {
1108 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); 1109 scoped_refptr<PluginInstance> plugin(FindInstance(instance));
1109 if (plugin) { 1110 if (plugin) {
1110 plugin->URLRedirectResponse(!!allow, notify_data); 1111 plugin->URLRedirectResponse(!!allow, notify_data);
1111 } 1112 }
1112 } 1113 }
1113 1114
1114 } // extern "C" 1115 } // extern "C"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698