OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 fileapi::FileSystemType type, | 619 fileapi::FileSystemType type, |
620 long long size, | 620 long long size, |
621 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 621 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
622 FileSystemDispatcher* file_system_dispatcher = | 622 FileSystemDispatcher* file_system_dispatcher = |
623 ChildThread::current()->file_system_dispatcher(); | 623 ChildThread::current()->file_system_dispatcher(); |
624 return file_system_dispatcher->OpenFileSystem( | 624 return file_system_dispatcher->OpenFileSystem( |
625 url, type, size, true /* create */, dispatcher); | 625 url, type, size, true /* create */, dispatcher); |
626 } | 626 } |
627 | 627 |
628 bool PepperPluginDelegateImpl::MakeDirectory( | 628 bool PepperPluginDelegateImpl::MakeDirectory( |
629 const FilePath& path, | 629 const GURL& path, |
630 bool recursive, | 630 bool recursive, |
631 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 631 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
632 FileSystemDispatcher* file_system_dispatcher = | 632 FileSystemDispatcher* file_system_dispatcher = |
633 ChildThread::current()->file_system_dispatcher(); | 633 ChildThread::current()->file_system_dispatcher(); |
634 return file_system_dispatcher->Create( | 634 return file_system_dispatcher->Create( |
635 path, false, true, recursive, dispatcher); | 635 path, false, true, recursive, dispatcher); |
636 } | 636 } |
637 | 637 |
638 bool PepperPluginDelegateImpl::Query( | 638 bool PepperPluginDelegateImpl::Query( |
639 const FilePath& path, | 639 const GURL& path, |
640 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 640 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
641 FileSystemDispatcher* file_system_dispatcher = | 641 FileSystemDispatcher* file_system_dispatcher = |
642 ChildThread::current()->file_system_dispatcher(); | 642 ChildThread::current()->file_system_dispatcher(); |
643 return file_system_dispatcher->ReadMetadata(path, dispatcher); | 643 return file_system_dispatcher->ReadMetadata(path, dispatcher); |
644 } | 644 } |
645 | 645 |
646 bool PepperPluginDelegateImpl::Touch( | 646 bool PepperPluginDelegateImpl::Touch( |
647 const FilePath& path, | 647 const GURL& path, |
648 const base::Time& last_access_time, | 648 const base::Time& last_access_time, |
649 const base::Time& last_modified_time, | 649 const base::Time& last_modified_time, |
650 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 650 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
651 FileSystemDispatcher* file_system_dispatcher = | 651 FileSystemDispatcher* file_system_dispatcher = |
652 ChildThread::current()->file_system_dispatcher(); | 652 ChildThread::current()->file_system_dispatcher(); |
653 return file_system_dispatcher->TouchFile(path, last_access_time, | 653 return file_system_dispatcher->TouchFile(path, last_access_time, |
654 last_modified_time, dispatcher); | 654 last_modified_time, dispatcher); |
655 } | 655 } |
656 | 656 |
657 bool PepperPluginDelegateImpl::Delete( | 657 bool PepperPluginDelegateImpl::Delete( |
658 const FilePath& path, | 658 const GURL& path, |
659 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 659 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
660 FileSystemDispatcher* file_system_dispatcher = | 660 FileSystemDispatcher* file_system_dispatcher = |
661 ChildThread::current()->file_system_dispatcher(); | 661 ChildThread::current()->file_system_dispatcher(); |
662 return file_system_dispatcher->Remove(path, false /* recursive */, | 662 return file_system_dispatcher->Remove(path, false /* recursive */, |
663 dispatcher); | 663 dispatcher); |
664 } | 664 } |
665 | 665 |
666 bool PepperPluginDelegateImpl::Rename( | 666 bool PepperPluginDelegateImpl::Rename( |
667 const FilePath& file_path, | 667 const GURL& file_path, |
668 const FilePath& new_file_path, | 668 const GURL& new_file_path, |
669 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 669 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
670 FileSystemDispatcher* file_system_dispatcher = | 670 FileSystemDispatcher* file_system_dispatcher = |
671 ChildThread::current()->file_system_dispatcher(); | 671 ChildThread::current()->file_system_dispatcher(); |
672 return file_system_dispatcher->Move(file_path, new_file_path, dispatcher); | 672 return file_system_dispatcher->Move(file_path, new_file_path, dispatcher); |
673 } | 673 } |
674 | 674 |
675 bool PepperPluginDelegateImpl::ReadDirectory( | 675 bool PepperPluginDelegateImpl::ReadDirectory( |
676 const FilePath& directory_path, | 676 const GURL& directory_path, |
677 fileapi::FileSystemCallbackDispatcher* dispatcher) { | 677 fileapi::FileSystemCallbackDispatcher* dispatcher) { |
678 FileSystemDispatcher* file_system_dispatcher = | 678 FileSystemDispatcher* file_system_dispatcher = |
679 ChildThread::current()->file_system_dispatcher(); | 679 ChildThread::current()->file_system_dispatcher(); |
680 return file_system_dispatcher->ReadDirectory(directory_path, dispatcher); | 680 return file_system_dispatcher->ReadDirectory(directory_path, dispatcher); |
681 } | 681 } |
682 | 682 |
683 base::PlatformFileError PepperPluginDelegateImpl::OpenFile( | 683 base::PlatformFileError PepperPluginDelegateImpl::OpenFile( |
684 const webkit::ppapi::PepperFilePath& path, | 684 const webkit::ppapi::PepperFilePath& path, |
685 int flags, | 685 int flags, |
686 base::PlatformFile* file) { | 686 base::PlatformFile* file) { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 render_view_->routing_id())); | 922 render_view_->routing_id())); |
923 } | 923 } |
924 | 924 |
925 P2PSocketDispatcher* PepperPluginDelegateImpl::GetP2PSocketDispatcher() { | 925 P2PSocketDispatcher* PepperPluginDelegateImpl::GetP2PSocketDispatcher() { |
926 return render_view_->p2p_socket_dispatcher(); | 926 return render_view_->p2p_socket_dispatcher(); |
927 } | 927 } |
928 | 928 |
929 webkit_glue::P2PTransport* PepperPluginDelegateImpl::CreateP2PTransport() { | 929 webkit_glue::P2PTransport* PepperPluginDelegateImpl::CreateP2PTransport() { |
930 return new P2PTransportImpl(render_view_->p2p_socket_dispatcher()); | 930 return new P2PTransportImpl(render_view_->p2p_socket_dispatcher()); |
931 } | 931 } |
OLD | NEW |