OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 return GetContentClient()->renderer()->VisitedLinkHash(canonical_url, length); | 299 return GetContentClient()->renderer()->VisitedLinkHash(canonical_url, length); |
300 } | 300 } |
301 | 301 |
302 bool RendererWebKitPlatformSupportImpl::isLinkVisited( | 302 bool RendererWebKitPlatformSupportImpl::isLinkVisited( |
303 unsigned long long link_hash) { | 303 unsigned long long link_hash) { |
304 return GetContentClient()->renderer()->IsLinkVisited(link_hash); | 304 return GetContentClient()->renderer()->IsLinkVisited(link_hash); |
305 } | 305 } |
306 | 306 |
307 WebKit::WebMessagePortChannel* | 307 WebKit::WebMessagePortChannel* |
308 RendererWebKitPlatformSupportImpl::createMessagePortChannel() { | 308 RendererWebKitPlatformSupportImpl::createMessagePortChannel() { |
309 return new WebMessagePortChannelImpl(child_thread_loop_); | 309 return new WebMessagePortChannelImpl(child_thread_loop_.get()); |
310 } | 310 } |
311 | 311 |
312 void RendererWebKitPlatformSupportImpl::prefetchHostName( | 312 void RendererWebKitPlatformSupportImpl::prefetchHostName( |
313 const WebString& hostname) { | 313 const WebString& hostname) { |
314 if (hostname.isEmpty()) | 314 if (hostname.isEmpty()) |
315 return; | 315 return; |
316 | 316 |
317 std::string hostname_utf8 = UTF16ToUTF8(hostname); | 317 std::string hostname_utf8 = UTF16ToUTF8(hostname); |
318 GetContentClient()->renderer()->PrefetchHostName( | 318 GetContentClient()->renderer()->PrefetchHostName( |
319 hostname_utf8.data(), hostname_utf8.length()); | 319 hostname_utf8.data(), hostname_utf8.length()); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 } | 672 } |
673 | 673 |
674 #endif | 674 #endif |
675 | 675 |
676 //------------------------------------------------------------------------------ | 676 //------------------------------------------------------------------------------ |
677 | 677 |
678 Platform::FileHandle | 678 Platform::FileHandle |
679 RendererWebKitPlatformSupportImpl::databaseOpenFile( | 679 RendererWebKitPlatformSupportImpl::databaseOpenFile( |
680 const WebString& vfs_file_name, int desired_flags) { | 680 const WebString& vfs_file_name, int desired_flags) { |
681 return DatabaseUtil::DatabaseOpenFile( | 681 return DatabaseUtil::DatabaseOpenFile( |
682 vfs_file_name, desired_flags, sync_message_filter_); | 682 vfs_file_name, desired_flags, sync_message_filter_.get()); |
683 } | 683 } |
684 | 684 |
685 int RendererWebKitPlatformSupportImpl::databaseDeleteFile( | 685 int RendererWebKitPlatformSupportImpl::databaseDeleteFile( |
686 const WebString& vfs_file_name, bool sync_dir) { | 686 const WebString& vfs_file_name, bool sync_dir) { |
687 return DatabaseUtil::DatabaseDeleteFile( | 687 return DatabaseUtil::DatabaseDeleteFile( |
688 vfs_file_name, sync_dir, sync_message_filter_); | 688 vfs_file_name, sync_dir, sync_message_filter_.get()); |
689 } | 689 } |
690 | 690 |
691 long RendererWebKitPlatformSupportImpl::databaseGetFileAttributes( | 691 long RendererWebKitPlatformSupportImpl::databaseGetFileAttributes( |
692 const WebString& vfs_file_name) { | 692 const WebString& vfs_file_name) { |
693 return DatabaseUtil::DatabaseGetFileAttributes( | 693 return DatabaseUtil::DatabaseGetFileAttributes(vfs_file_name, |
694 vfs_file_name, sync_message_filter_); | 694 sync_message_filter_.get()); |
695 } | 695 } |
696 | 696 |
697 long long RendererWebKitPlatformSupportImpl::databaseGetFileSize( | 697 long long RendererWebKitPlatformSupportImpl::databaseGetFileSize( |
698 const WebString& vfs_file_name) { | 698 const WebString& vfs_file_name) { |
699 return DatabaseUtil::DatabaseGetFileSize( | 699 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, |
700 vfs_file_name, sync_message_filter_); | 700 sync_message_filter_.get()); |
701 } | 701 } |
702 | 702 |
703 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( | 703 long long RendererWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( |
704 const WebString& origin_identifier) { | 704 const WebString& origin_identifier) { |
705 return DatabaseUtil::DatabaseGetSpaceAvailable( | 705 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, |
706 origin_identifier, sync_message_filter_); | 706 sync_message_filter_.get()); |
707 } | 707 } |
708 | 708 |
709 WebKit::WebSharedWorkerRepository* | 709 WebKit::WebSharedWorkerRepository* |
710 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | 710 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { |
711 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 711 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
712 switches::kDisableSharedWorkers)) { | 712 switches::kDisableSharedWorkers)) { |
713 return shared_worker_repository_.get(); | 713 return shared_worker_repository_.get(); |
714 } else { | 714 } else { |
715 return NULL; | 715 return NULL; |
716 } | 716 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 | 1050 |
1051 //------------------------------------------------------------------------------ | 1051 //------------------------------------------------------------------------------ |
1052 | 1052 |
1053 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode( | 1053 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode( |
1054 const WebKit::WebString& host, | 1054 const WebKit::WebString& host, |
1055 const WebKit::WebString& languages) { | 1055 const WebKit::WebString& languages) { |
1056 return net::IDNToUnicode(host.utf8(), languages.utf8()); | 1056 return net::IDNToUnicode(host.utf8(), languages.utf8()); |
1057 } | 1057 } |
1058 | 1058 |
1059 } // namespace content | 1059 } // namespace content |
OLD | NEW |