| 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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "grit/webkit_resources.h" | 27 #include "grit/webkit_resources.h" |
| 28 #include "grit/webkit_strings.h" | 28 #include "grit/webkit_strings.h" |
| 29 #include "third_party/WebKit/WebKit/chromium/public/WebCookie.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebCookie.h" |
| 30 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
| 31 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" |
| 32 #include "third_party/WebKit/WebKit/chromium/public/WebPluginListBuilder.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebPluginListBuilder.h" |
| 33 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
| 34 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 35 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
| 36 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 37 #include "webkit/glue/media/audio_decoder.h" |
| 37 #include "webkit/glue/plugins/plugin_instance.h" | 38 #include "webkit/glue/plugins/plugin_instance.h" |
| 38 #include "webkit/glue/plugins/webplugininfo.h" | 39 #include "webkit/glue/plugins/webplugininfo.h" |
| 39 #include "webkit/glue/webkit_glue.h" | 40 #include "webkit/glue/webkit_glue.h" |
| 40 #include "webkit/glue/websocketstreamhandle_impl.h" | 41 #include "webkit/glue/websocketstreamhandle_impl.h" |
| 41 #include "webkit/glue/weburlloader_impl.h" | 42 #include "webkit/glue/weburlloader_impl.h" |
| 42 | 43 |
| 43 #if defined(OS_LINUX) | 44 #if defined(OS_LINUX) |
| 44 #include "v8/include/v8.h" | 45 #include "v8/include/v8.h" |
| 45 #endif | 46 #endif |
| 46 | 47 |
| 48 using WebKit::WebAudioBus; |
| 47 using WebKit::WebCookie; | 49 using WebKit::WebCookie; |
| 48 using WebKit::WebData; | 50 using WebKit::WebData; |
| 49 using WebKit::WebLocalizedString; | 51 using WebKit::WebLocalizedString; |
| 50 using WebKit::WebPluginListBuilder; | 52 using WebKit::WebPluginListBuilder; |
| 51 using WebKit::WebString; | 53 using WebKit::WebString; |
| 52 using WebKit::WebSocketStreamHandle; | 54 using WebKit::WebSocketStreamHandle; |
| 53 using WebKit::WebThemeEngine; | 55 using WebKit::WebThemeEngine; |
| 54 using WebKit::WebURL; | 56 using WebKit::WebURL; |
| 55 using WebKit::WebURLLoader; | 57 using WebKit::WebURLLoader; |
| 56 using WebKit::WebVector; | 58 using WebKit::WebVector; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 base::StringPiece resource = GetDataResource(resources[i].id); | 347 base::StringPiece resource = GetDataResource(resources[i].id); |
| 346 return WebData(resource.data(), resource.size()); | 348 return WebData(resource.data(), resource.size()); |
| 347 } | 349 } |
| 348 } | 350 } |
| 349 // TODO(jhawkins): Restore this NOTREACHED once WK stops sending in empty | 351 // TODO(jhawkins): Restore this NOTREACHED once WK stops sending in empty |
| 350 // strings. http://crbug.com/50675. | 352 // strings. http://crbug.com/50675. |
| 351 //NOTREACHED() << "Unknown image resource " << name; | 353 //NOTREACHED() << "Unknown image resource " << name; |
| 352 return WebData(); | 354 return WebData(); |
| 353 } | 355 } |
| 354 | 356 |
| 357 bool WebKitClientImpl::loadAudioResource( |
| 358 WebKit::WebAudioBus* destination_bus, const char* audio_file_data, |
| 359 size_t data_size, double sample_rate) { |
| 360 return DecodeAudioFileData(destination_bus, |
| 361 audio_file_data, |
| 362 data_size, |
| 363 sample_rate); |
| 364 } |
| 365 |
| 355 WebString WebKitClientImpl::queryLocalizedString( | 366 WebString WebKitClientImpl::queryLocalizedString( |
| 356 WebLocalizedString::Name name) { | 367 WebLocalizedString::Name name) { |
| 357 int message_id = ToMessageID(name); | 368 int message_id = ToMessageID(name); |
| 358 if (message_id < 0) | 369 if (message_id < 0) |
| 359 return WebString(); | 370 return WebString(); |
| 360 return GetLocalizedString(message_id); | 371 return GetLocalizedString(message_id); |
| 361 } | 372 } |
| 362 | 373 |
| 363 WebString WebKitClientImpl::queryLocalizedString( | 374 WebString WebKitClientImpl::queryLocalizedString( |
| 364 WebLocalizedString::Name name, int numeric_value) { | 375 WebLocalizedString::Name name, int numeric_value) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 ++shared_timer_suspended_; | 539 ++shared_timer_suspended_; |
| 529 } | 540 } |
| 530 | 541 |
| 531 void WebKitClientImpl::ResumeSharedTimer() { | 542 void WebKitClientImpl::ResumeSharedTimer() { |
| 532 // The shared timer may have fired or been adjusted while we were suspended. | 543 // The shared timer may have fired or been adjusted while we were suspended. |
| 533 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) | 544 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) |
| 534 setSharedTimerFireTime(shared_timer_fire_time_); | 545 setSharedTimerFireTime(shared_timer_fire_time_); |
| 535 } | 546 } |
| 536 | 547 |
| 537 } // namespace webkit_glue | 548 } // namespace webkit_glue |
| OLD | NEW |