| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/webkitclient_impl.h" | 5 #include "webkit/glue/webkitclient_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <malloc.h> | 8 #include <malloc.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include <math.h> | 11 #include <math.h> |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 16 #include "base/lock.h" | 16 #include "base/lock.h" |
| 17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
| 18 #include "base/metrics/stats_counters.h" | 18 #include "base/metrics/stats_counters.h" |
| 19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 20 #include "base/process_util.h" | 20 #include "base/process_util.h" |
| 21 #include "base/platform_file.h" | 21 #include "base/platform_file.h" |
| 22 #include "base/singleton.h" | 22 #include "base/singleton.h" |
| 23 #include "base/string_number_conversions.h" | 23 #include "base/string_number_conversions.h" |
| 24 #include "base/string_util.h" | 24 #include "base/string_util.h" |
| 25 #include "base/time.h" | 25 #include "base/time.h" |
| 26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
| 27 #include "chrome/common/render_messages.h" |
| 28 #include "chrome/renderer/render_thread.h" |
| 27 #include "grit/webkit_resources.h" | 29 #include "grit/webkit_resources.h" |
| 28 #include "grit/webkit_strings.h" | 30 #include "grit/webkit_strings.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCookie.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCookie.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginListBuilder.
h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginListBuilder.
h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 435 } |
| 434 | 436 |
| 435 void WebKitClientImpl::stopSharedTimer() { | 437 void WebKitClientImpl::stopSharedTimer() { |
| 436 shared_timer_.Stop(); | 438 shared_timer_.Stop(); |
| 437 } | 439 } |
| 438 | 440 |
| 439 void WebKitClientImpl::callOnMainThread(void (*func)(void*), void* context) { | 441 void WebKitClientImpl::callOnMainThread(void (*func)(void*), void* context) { |
| 440 main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func, context)); | 442 main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func, context)); |
| 441 } | 443 } |
| 442 | 444 |
| 445 void WebKitClientImpl::notifyJSOutOfMemory() { |
| 446 RenderThread::current()->Send(new ViewHostMsg_RenderProcessOutOfJSMemory()); |
| 447 } |
| 448 |
| 443 base::PlatformFile WebKitClientImpl::databaseOpenFile( | 449 base::PlatformFile WebKitClientImpl::databaseOpenFile( |
| 444 const WebKit::WebString& vfs_file_name, int desired_flags) { | 450 const WebKit::WebString& vfs_file_name, int desired_flags) { |
| 445 return base::kInvalidPlatformFileValue; | 451 return base::kInvalidPlatformFileValue; |
| 446 } | 452 } |
| 447 | 453 |
| 448 int WebKitClientImpl::databaseDeleteFile( | 454 int WebKitClientImpl::databaseDeleteFile( |
| 449 const WebKit::WebString& vfs_file_name, bool sync_dir) { | 455 const WebKit::WebString& vfs_file_name, bool sync_dir) { |
| 450 return -1; | 456 return -1; |
| 451 } | 457 } |
| 452 | 458 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 ++shared_timer_suspended_; | 545 ++shared_timer_suspended_; |
| 540 } | 546 } |
| 541 | 547 |
| 542 void WebKitClientImpl::ResumeSharedTimer() { | 548 void WebKitClientImpl::ResumeSharedTimer() { |
| 543 // The shared timer may have fired or been adjusted while we were suspended. | 549 // The shared timer may have fired or been adjusted while we were suspended. |
| 544 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) | 550 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) |
| 545 setSharedTimerFireTime(shared_timer_fire_time_); | 551 setSharedTimerFireTime(shared_timer_fire_time_); |
| 546 } | 552 } |
| 547 | 553 |
| 548 } // namespace webkit_glue | 554 } // namespace webkit_glue |
| OLD | NEW |