| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/command_line.h" | |
| 6 #include "content/common/child_thread.h" | |
| 7 #include "content/common/socket_stream_dispatcher.h" | |
| 8 #include "content/common/webkitplatformsupport_impl.h" | |
| 9 #include "content/public/common/content_client.h" | |
| 10 #include "googleurl/src/gurl.h" | |
| 11 | |
| 12 #if defined(OS_ANDROID) | |
| 13 #include "base/file_descriptor_posix.h" | |
| 14 #include "base/shared_memory.h" | |
| 15 #include "content/common/view_messages.h" | |
| 16 | |
| 17 namespace { | |
| 18 void RunWebAudioMediaCodec( | |
| 19 base::SharedMemoryHandle encoded_data_handle, | |
| 20 base::FileDescriptor pcm_output, | |
| 21 uint32_t data_size) { | |
| 22 content::ChildThread::current()->Send( | |
| 23 new ViewHostMsg_RunWebAudioMediaCodec(encoded_data_handle, | |
| 24 pcm_output, | |
| 25 data_size)); | |
| 26 } | |
| 27 | |
| 28 } // anonymous namespace | |
| 29 #endif | |
| 30 | |
| 31 namespace content { | |
| 32 | |
| 33 WebKitPlatformSupportImpl::WebKitPlatformSupportImpl() { | |
| 34 } | |
| 35 | |
| 36 WebKitPlatformSupportImpl::~WebKitPlatformSupportImpl() { | |
| 37 } | |
| 38 | |
| 39 string16 WebKitPlatformSupportImpl::GetLocalizedString(int message_id) { | |
| 40 return GetContentClient()->GetLocalizedString(message_id); | |
| 41 } | |
| 42 | |
| 43 base::StringPiece WebKitPlatformSupportImpl::GetDataResource( | |
| 44 int resource_id, | |
| 45 ui::ScaleFactor scale_factor) { | |
| 46 return GetContentClient()->GetDataResource(resource_id, scale_factor); | |
| 47 } | |
| 48 | |
| 49 void WebKitPlatformSupportImpl::GetPlugins( | |
| 50 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { | |
| 51 // This should not be called except in the renderer. | |
| 52 // RendererWebKitPlatformSupportImpl overrides this. | |
| 53 NOTREACHED(); | |
| 54 } | |
| 55 | |
| 56 webkit_glue::ResourceLoaderBridge* | |
| 57 WebKitPlatformSupportImpl::CreateResourceLoader( | |
| 58 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | |
| 59 return ChildThread::current()->CreateBridge(request_info); | |
| 60 } | |
| 61 | |
| 62 webkit_glue::WebSocketStreamHandleBridge* | |
| 63 WebKitPlatformSupportImpl::CreateWebSocketBridge( | |
| 64 WebKit::WebSocketStreamHandle* handle, | |
| 65 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | |
| 66 SocketStreamDispatcher* dispatcher = | |
| 67 ChildThread::current()->socket_stream_dispatcher(); | |
| 68 return dispatcher->CreateBridge(handle, delegate); | |
| 69 } | |
| 70 | |
| 71 #if defined(OS_ANDROID) | |
| 72 webkit_media::WebAudioMediaCodecRunner | |
| 73 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() { | |
| 74 return base::Bind(&RunWebAudioMediaCodec); | |
| 75 } | |
| 76 #endif | |
| 77 | |
| 78 } // namespace content | |
| OLD | NEW |