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

Unified Diff: webkit/glue/plugins/test/plugin_get_javascript_url_test.cc

Issue 1661: port some parts of webkit/glue/plugins/test to Linux... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/plugins/test/plugin_client.cc ('k') | webkit/glue/plugins/test/plugin_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/test/plugin_get_javascript_url_test.cc
===================================================================
--- webkit/glue/plugins/test/plugin_get_javascript_url_test.cc (revision 2299)
+++ webkit/glue/plugins/test/plugin_get_javascript_url_test.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h"
+#include "base/basictypes.h"
// url for "self".
#define SELF_URL "javascript:window.location+\"\""
@@ -38,7 +39,9 @@
if (stream == NULL)
SetError("NewStream got null stream");
- unsigned long stream_id = PtrToUlong(stream->notifyData);
+ COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(stream->notifyData),
+ cast_validity_check);
+ unsigned long stream_id = reinterpret_cast<unsigned long>(stream->notifyData);
switch (stream_id) {
case SELF_URL_STREAM_ID:
break;
@@ -60,7 +63,9 @@
if (len < 0 || len > STREAM_CHUNK)
SetError("Write got bogus stream chunk size");
- unsigned long stream_id = PtrToUlong(stream->notifyData);
+ COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(stream->notifyData),
+ cast_validity_check);
+ unsigned long stream_id = reinterpret_cast<unsigned long>(stream->notifyData);
switch (stream_id) {
case SELF_URL_STREAM_ID:
self_url_.append(static_cast<char*>(buffer), len);
@@ -78,7 +83,9 @@
if (stream == NULL)
SetError("NewStream got null stream");
- unsigned long stream_id = PtrToUlong(stream->notifyData);
+ COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(stream->notifyData),
+ cast_validity_check);
+ unsigned long stream_id = reinterpret_cast<unsigned long>(stream->notifyData);
switch (stream_id) {
case SELF_URL_STREAM_ID:
// don't care
@@ -91,7 +98,9 @@
}
void ExecuteGetJavascriptUrlTest::URLNotify(const char* url, NPReason reason, void* data) {
- unsigned long stream_id = PtrToUlong(data);
+ COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(data),
+ cast_validity_check);
+ unsigned long stream_id = reinterpret_cast<unsigned long>(data);
switch (stream_id) {
case SELF_URL_STREAM_ID:
if (strcmp(url, SELF_URL) != 0)
« no previous file with comments | « webkit/glue/plugins/test/plugin_client.cc ('k') | webkit/glue/plugins/test/plugin_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698