| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "ChromiumBridge.h" | 6 #include "ChromiumBridge.h" |
| 7 | 7 |
| 8 #include "BitmapImage.h" | 8 #include "BitmapImage.h" |
| 9 #include "ClipboardUtilitiesChromium.h" | 9 #include "ClipboardUtilitiesChromium.h" |
| 10 #include "Cursor.h" | 10 #include "Cursor.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 void ChromiumBridge::stopSharedTimer() { | 468 void ChromiumBridge::stopSharedTimer() { |
| 469 if (!shared_timer_task) | 469 if (!shared_timer_task) |
| 470 return; | 470 return; |
| 471 shared_timer_task->Cancel(); | 471 shared_timer_task->Cancel(); |
| 472 shared_timer_task = NULL; | 472 shared_timer_task = NULL; |
| 473 } | 473 } |
| 474 | 474 |
| 475 // StatsCounters -------------------------------------------------------------- | 475 // StatsCounters -------------------------------------------------------------- |
| 476 | 476 |
| 477 void ChromiumBridge::decrementStatsCounter(const wchar_t* name) { | 477 void ChromiumBridge::decrementStatsCounter(const char* name) { |
| 478 StatsCounter(name).Decrement(); | 478 StatsCounter(name).Decrement(); |
| 479 } | 479 } |
| 480 | 480 |
| 481 void ChromiumBridge::incrementStatsCounter(const wchar_t* name) { | 481 void ChromiumBridge::incrementStatsCounter(const char* name) { |
| 482 StatsCounter(name).Increment(); | 482 StatsCounter(name).Increment(); |
| 483 } | 483 } |
| 484 | 484 |
| 485 #if USE(V8) | 485 #if USE(V8) |
| 486 // TODO(evanm): remove this conversion thunk once v8 supports plain char* |
| 487 // counter functions. |
| 488 static int* CounterFunction(const wchar_t* name) { |
| 489 return StatsTable::FindLocation(WideToASCII(name).c_str()); |
| 490 } |
| 486 void ChromiumBridge::initV8CounterFunction() { | 491 void ChromiumBridge::initV8CounterFunction() { |
| 487 v8::V8::SetCounterFunction(StatsTable::FindLocation); | 492 v8::V8::SetCounterFunction(CounterFunction); |
| 488 } | 493 } |
| 489 #endif | 494 #endif |
| 490 | 495 |
| 491 // SystemTime ------------------------------------------------------------------ | 496 // SystemTime ------------------------------------------------------------------ |
| 492 // Called by SystemTimeChromium.cpp | 497 // Called by SystemTimeChromium.cpp |
| 493 | 498 |
| 494 double ChromiumBridge::currentTime() { | 499 double ChromiumBridge::currentTime() { |
| 495 // Get the current time in seconds since epoch. | 500 // Get the current time in seconds since epoch. |
| 496 return base::Time::Now().ToDoubleT(); | 501 return base::Time::Now().ToDoubleT(); |
| 497 } | 502 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 524 chrome_client->SetCursor(WebCursor(cursor.impl())); | 529 chrome_client->SetCursor(WebCursor(cursor.impl())); |
| 525 } | 530 } |
| 526 | 531 |
| 527 void ChromiumBridge::widgetSetFocus(Widget* widget) { | 532 void ChromiumBridge::widgetSetFocus(Widget* widget) { |
| 528 ChromeClientImpl* chrome_client = ToChromeClient(widget); | 533 ChromeClientImpl* chrome_client = ToChromeClient(widget); |
| 529 if (chrome_client) | 534 if (chrome_client) |
| 530 chrome_client->focus(); | 535 chrome_client->focus(); |
| 531 } | 536 } |
| 532 | 537 |
| 533 } // namespace WebCore | 538 } // namespace WebCore |
| OLD | NEW |