mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-24 07:58:11 +01:00
Merge revision 1361 changes:
- Windows: Fix 64-bit compile errors (issue #394). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1453@1363 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
e53e604831
commit
185e56cc2c
@ -54,7 +54,7 @@ bool CefStreamResourceHandler::ReadResponse(void* data_out,
|
|||||||
int bytes_to_read,
|
int bytes_to_read,
|
||||||
int& bytes_read,
|
int& bytes_read,
|
||||||
CefRefPtr<CefCallback> callback) {
|
CefRefPtr<CefCallback> callback) {
|
||||||
bytes_read = stream_->Read(data_out, 1, bytes_to_read);
|
bytes_read = static_cast<int>(stream_->Read(data_out, 1, bytes_to_read));
|
||||||
return (bytes_read > 0);
|
return (bytes_read > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Change the plugin window's cursor.
|
// Change the plugin window's cursor.
|
||||||
SetClassLong(hWnd_, GCL_HCURSOR,
|
SetClassLongPtr(hWnd_, GCLP_HCURSOR,
|
||||||
static_cast<LONG>(reinterpret_cast<LONG_PTR>(cursor)));
|
static_cast<LONG>(reinterpret_cast<LONG_PTR>(cursor)));
|
||||||
SetCursor(cursor);
|
SetCursor(cursor);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void SetListValue(CefRefPtr<CefV8Value> list, int index,
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case VTYPE_LIST: {
|
case VTYPE_LIST: {
|
||||||
CefRefPtr<CefListValue> list = value->GetList(index);
|
CefRefPtr<CefListValue> list = value->GetList(index);
|
||||||
new_value = CefV8Value::CreateArray(list->GetSize());
|
new_value = CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
|
||||||
SetList(list, new_value);
|
SetList(list, new_value);
|
||||||
} break;
|
} break;
|
||||||
case VTYPE_BOOL:
|
case VTYPE_BOOL:
|
||||||
@ -92,7 +92,7 @@ void SetListValue(CefRefPtr<CefV8Value> list, int index,
|
|||||||
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
|
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
|
||||||
ASSERT(target->IsArray());
|
ASSERT(target->IsArray());
|
||||||
|
|
||||||
int arg_length = source->GetSize();
|
int arg_length = static_cast<int>(source->GetSize());
|
||||||
if (arg_length == 0)
|
if (arg_length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -382,7 +382,8 @@ bool ClientApp::OnProcessMessageReceived(
|
|||||||
|
|
||||||
// Second argument is the list of message arguments.
|
// Second argument is the list of message arguments.
|
||||||
CefRefPtr<CefListValue> list = message->GetArgumentList();
|
CefRefPtr<CefListValue> list = message->GetArgumentList();
|
||||||
CefRefPtr<CefV8Value> args = CefV8Value::CreateArray(list->GetSize());
|
CefRefPtr<CefV8Value> args =
|
||||||
|
CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
|
||||||
SetList(list, args);
|
SetList(list, args);
|
||||||
arguments.push_back(args);
|
arguments.push_back(args);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class RunFileDialogCallback : public CefRunFileDialogCallback {
|
|||||||
CefProcessMessage::Create(message_name_);
|
CefProcessMessage::Create(message_name_);
|
||||||
CefRefPtr<CefListValue> args = message->GetArgumentList();
|
CefRefPtr<CefListValue> args = message->GetArgumentList();
|
||||||
CefRefPtr<CefListValue> val = CefListValue::Create();
|
CefRefPtr<CefListValue> val = CefListValue::Create();
|
||||||
for (size_t i = 0; i < file_paths.size(); ++i)
|
for (int i = 0; i < static_cast<int>(file_paths.size()); ++i)
|
||||||
val->SetString(i, file_paths[i]);
|
val->SetString(i, file_paths[i]);
|
||||||
args->SetList(0, val);
|
args->SetList(0, val);
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ namespace performance_test {
|
|||||||
|
|
||||||
// Use more interations for a Release build.
|
// Use more interations for a Release build.
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
const size_t kDefaultIterations = 100000;
|
const int kDefaultIterations = 100000;
|
||||||
#else
|
#else
|
||||||
const size_t kDefaultIterations = 10000;
|
const int kDefaultIterations = 10000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -40,7 +40,7 @@ class V8Handler : public CefV8Handler {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
std::string test = arguments[0]->GetStringValue();
|
std::string test = arguments[0]->GetStringValue();
|
||||||
for (size_t i = 0; i < kPerfTestsCount; ++i) {
|
for (int i = 0; i < kPerfTestsCount; ++i) {
|
||||||
if (test == kPerfTests[i].name) {
|
if (test == kPerfTests[i].name) {
|
||||||
// Execute the test.
|
// Execute the test.
|
||||||
int64 delta = kPerfTests[i].test(kPerfTests[i].iterations);
|
int64 delta = kPerfTests[i].test(kPerfTests[i].iterations);
|
||||||
@ -62,7 +62,7 @@ class V8Handler : public CefV8Handler {
|
|||||||
} else if (name == kGetPerfTests) {
|
} else if (name == kGetPerfTests) {
|
||||||
// Retrieve the list of perf tests.
|
// Retrieve the list of perf tests.
|
||||||
retval = CefV8Value::CreateArray(kPerfTestsCount);
|
retval = CefV8Value::CreateArray(kPerfTestsCount);
|
||||||
for (size_t i = 0; i < kPerfTestsCount; ++i) {
|
for (int i = 0; i < kPerfTestsCount; ++i) {
|
||||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateArray(2);
|
CefRefPtr<CefV8Value> val = CefV8Value::CreateArray(2);
|
||||||
val->SetValue(0, CefV8Value::CreateString(kPerfTests[i].name));
|
val->SetValue(0, CefV8Value::CreateString(kPerfTests[i].name));
|
||||||
val->SetValue(1, CefV8Value::CreateUInt(kPerfTests[i].iterations));
|
val->SetValue(1, CefV8Value::CreateUInt(kPerfTests[i].iterations));
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
namespace performance_test {
|
namespace performance_test {
|
||||||
|
|
||||||
// Default number of iterations.
|
// Default number of iterations.
|
||||||
extern const size_t kDefaultIterations;
|
extern const int kDefaultIterations;
|
||||||
|
|
||||||
// Test name.
|
// Test name.
|
||||||
#define PERF_TEST_NAME(name) PerfTest##name
|
#define PERF_TEST_NAME(name) PerfTest##name
|
||||||
@ -24,7 +24,7 @@ extern const size_t kDefaultIterations;
|
|||||||
// Test function declaration.
|
// Test function declaration.
|
||||||
#define PERF_TEST_RESULT int64
|
#define PERF_TEST_RESULT int64
|
||||||
#define PERF_TEST_PARAM_ITERATIONS iterations
|
#define PERF_TEST_PARAM_ITERATIONS iterations
|
||||||
#define PERF_TEST_PARAMS size_t PERF_TEST_PARAM_ITERATIONS
|
#define PERF_TEST_PARAMS int PERF_TEST_PARAM_ITERATIONS
|
||||||
#define PERF_TEST_FUNC(name) \
|
#define PERF_TEST_FUNC(name) \
|
||||||
PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS)
|
PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS)
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class CefTimer {
|
|||||||
{ \
|
{ \
|
||||||
CefTimer _timer; \
|
CefTimer _timer; \
|
||||||
_timer.Start(); \
|
_timer.Start(); \
|
||||||
for (size_t _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
|
for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
|
||||||
|
|
||||||
#define PERF_ITERATIONS_END_EX(result) \
|
#define PERF_ITERATIONS_END_EX(result) \
|
||||||
} \
|
} \
|
||||||
@ -87,12 +87,12 @@ class CefTimer {
|
|||||||
struct PerfTestEntry {
|
struct PerfTestEntry {
|
||||||
const char* name;
|
const char* name;
|
||||||
PerfTest* test;
|
PerfTest* test;
|
||||||
size_t iterations;
|
int iterations;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Array of perf tests.
|
// Array of perf tests.
|
||||||
extern const PerfTestEntry kPerfTests[];
|
extern const PerfTestEntry kPerfTests[];
|
||||||
extern const size_t kPerfTestsCount;
|
extern const int kPerfTestsCount;
|
||||||
|
|
||||||
} // namespace performance_test
|
} // namespace performance_test
|
||||||
|
|
||||||
|
@ -323,6 +323,6 @@ const PerfTestEntry kPerfTests[] = {
|
|||||||
PERF_TEST_ENTRY(V8ContextEval),
|
PERF_TEST_ENTRY(V8ContextEval),
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0]));
|
const int kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0]));
|
||||||
|
|
||||||
} // namespace performance_test
|
} // namespace performance_test
|
||||||
|
@ -275,7 +275,7 @@ class NetNotifyRendererTest : public ClientApp::RenderDelegate {
|
|||||||
NetNotifyTestType test_type = NNTT_NONE;
|
NetNotifyTestType test_type = NNTT_NONE;
|
||||||
|
|
||||||
// Extract the test type.
|
// Extract the test type.
|
||||||
int pos = url.find("t=");
|
size_t pos = url.find("t=");
|
||||||
int intval = 0;
|
int intval = 0;
|
||||||
if (pos > 0 && base::StringToInt(url.substr(pos + 2, 1), &intval))
|
if (pos > 0 && base::StringToInt(url.substr(pos + 2, 1), &intval))
|
||||||
test_type = static_cast<NetNotifyTestType>(intval);
|
test_type = static_cast<NetNotifyTestType>(intval);
|
||||||
|
@ -27,7 +27,7 @@ static void VerifyStreamReadBehavior(CefRefPtr<CefStreamReader> stream,
|
|||||||
int res, read, offset = 0;
|
int res, read, offset = 0;
|
||||||
do {
|
do {
|
||||||
read = std::min(static_cast<int>(sizeof(buff)), contentSize-offset);
|
read = std::min(static_cast<int>(sizeof(buff)), contentSize-offset);
|
||||||
res = stream->Read(buff, 1, read);
|
res = static_cast<int>(stream->Read(buff, 1, read));
|
||||||
ASSERT_EQ(read, res);
|
ASSERT_EQ(read, res);
|
||||||
ASSERT_TRUE(!memcmp(contentStr+offset, buff, res));
|
ASSERT_TRUE(!memcmp(contentStr+offset, buff, res));
|
||||||
offset += res;
|
offset += res;
|
||||||
@ -47,7 +47,7 @@ static void VerifyStreamWriteBehavior(CefRefPtr<CefStreamWriter> stream,
|
|||||||
int res, write, offset = 0;
|
int res, write, offset = 0;
|
||||||
do {
|
do {
|
||||||
write = std::min(10, contentSize-offset);
|
write = std::min(10, contentSize-offset);
|
||||||
res = stream->Write(contentStr+offset, 1, write);
|
res = static_cast<int>(stream->Write(contentStr+offset, 1, write));
|
||||||
ASSERT_EQ(write, res);
|
ASSERT_EQ(write, res);
|
||||||
offset += res;
|
offset += res;
|
||||||
ASSERT_EQ(offset, stream->Tell());
|
ASSERT_EQ(offset, stream->Tell());
|
||||||
|
@ -132,7 +132,7 @@ CefRefPtr<CefResourceHandler> TestHandler::GetResourceHandler(
|
|||||||
|
|
||||||
// Ignore the query component, if any.
|
// Ignore the query component, if any.
|
||||||
std::string urlStr = url;
|
std::string urlStr = url;
|
||||||
int idx = urlStr.find('?');
|
size_t idx = urlStr.find('?');
|
||||||
if (idx > 0)
|
if (idx > 0)
|
||||||
urlStr = urlStr.substr(0, idx);
|
urlStr = urlStr.substr(0, idx);
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ void TestHandler::AddResource(const std::string& url,
|
|||||||
const std::string& mimeType) {
|
const std::string& mimeType) {
|
||||||
// Ignore the query component, if any.
|
// Ignore the query component, if any.
|
||||||
std::string urlStr = url;
|
std::string urlStr = url;
|
||||||
int idx = urlStr.find('?');
|
size_t idx = urlStr.find('?');
|
||||||
if (idx > 0)
|
if (idx > 0)
|
||||||
urlStr = urlStr.substr(0, idx);
|
urlStr = urlStr.substr(0, idx);
|
||||||
|
|
||||||
|
@ -182,10 +182,10 @@ void TestListEqual(CefRefPtr<CefListValue> val1,
|
|||||||
EXPECT_TRUE(val1.get());
|
EXPECT_TRUE(val1.get());
|
||||||
EXPECT_TRUE(val2.get());
|
EXPECT_TRUE(val2.get());
|
||||||
|
|
||||||
size_t size = val1->GetSize();
|
int size = static_cast<int>(val1->GetSize());
|
||||||
EXPECT_EQ(size, val2->GetSize());
|
EXPECT_EQ(size, static_cast<int>(val2->GetSize()));
|
||||||
|
|
||||||
for (size_t i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
CefValueType type = val1->GetType(i);
|
CefValueType type = val1->GetType(i);
|
||||||
EXPECT_EQ(type, val2->GetType(i));
|
EXPECT_EQ(type, val2->GetType(i));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user