Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: webkit/plugins/ppapi/plugin_delegate.h

Issue 13726024: Refactor FileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
14 #include "base/platform_file.h" 14 #include "base/platform_file.h"
15 #include "base/process.h" 15 #include "base/process.h"
16 #include "base/shared_memory.h" 16 #include "base/shared_memory.h"
17 #include "base/sync_socket.h" 17 #include "base/sync_socket.h"
18 #include "base/time.h" 18 #include "base/time.h"
19 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
20 #include "ipc/ipc_platform_file.h" 20 #include "ipc/ipc_platform_file.h"
21 #include "media/video/capture/video_capture.h" 21 #include "media/video/capture/video_capture.h"
22 #include "media/video/video_decode_accelerator.h" 22 #include "media/video/video_decode_accelerator.h"
23 #include "ppapi/c/dev/pp_video_dev.h" 23 #include "ppapi/c/dev/pp_video_dev.h"
24 #include "ppapi/c/dev/ppb_device_ref_dev.h" 24 #include "ppapi/c/dev/ppb_device_ref_dev.h"
25 #include "ppapi/c/pp_completion_callback.h" 25 #include "ppapi/c/pp_completion_callback.h"
26 #include "ppapi/c/pp_errors.h" 26 #include "ppapi/c/pp_errors.h"
27 #include "ppapi/c/pp_file_info.h"
27 #include "ppapi/c/pp_instance.h" 28 #include "ppapi/c/pp_instance.h"
28 #include "ppapi/c/pp_resource.h" 29 #include "ppapi/c/pp_resource.h"
29 #include "ppapi/c/pp_stdint.h" 30 #include "ppapi/c/pp_stdint.h"
30 #include "ppapi/c/private/ppb_flash.h" 31 #include "ppapi/c/private/ppb_flash.h"
31 #include "ppapi/c/private/ppb_tcp_socket_private.h" 32 #include "ppapi/c/private/ppb_tcp_socket_private.h"
32 #include "ppapi/c/private/ppb_udp_socket_private.h" 33 #include "ppapi/c/private/ppb_udp_socket_private.h"
33 #include "ppapi/shared_impl/dir_contents.h" 34 #include "ppapi/shared_impl/dir_contents.h"
34 #include "ui/gfx/size.h" 35 #include "ui/gfx/size.h"
35 #include "webkit/fileapi/file_system_types.h" 36 #include "webkit/fileapi/file_system_types.h"
36 #include "webkit/glue/clipboard_client.h" 37 #include "webkit/glue/clipboard_client.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // Notifies that the index of the currently selected item has been updated. 458 // Notifies that the index of the currently selected item has been updated.
458 virtual void SelectedFindResultChanged(int identifier, int index) = 0; 459 virtual void SelectedFindResultChanged(int identifier, int index) = 0;
459 460
460 // Sends an async IPC to open a local file. 461 // Sends an async IPC to open a local file.
461 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> 462 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)>
462 AsyncOpenFileCallback; 463 AsyncOpenFileCallback;
463 virtual bool AsyncOpenFile(const base::FilePath& path, 464 virtual bool AsyncOpenFile(const base::FilePath& path,
464 int flags, 465 int flags,
465 const AsyncOpenFileCallback& callback) = 0; 466 const AsyncOpenFileCallback& callback) = 0;
466 467
468 // These functions expose some of PepperFileSystemHost methods for
469 // PPB_FileRef_Impl (which is in webkit) to access. Once we migrate FileRef
470 // to the new design in content/, we won't need this delegation.
471 // TODO(victorhsieh): remove these delegation.
472 virtual bool IsFileSystemOpened(PP_Instance instance,
473 PP_Resource resource) const = 0;
474 virtual PP_FileSystemType GetFileSystemType(PP_Instance instance,
475 PP_Resource resource) const = 0;
476 virtual std::string GetFileSystemRootUrl(PP_Instance instance,
477 PP_Resource resource) const = 0;
478
467 // Sends an async IPC to open a file through filesystem API. 479 // Sends an async IPC to open a file through filesystem API.
468 // When a file is successfully opened, |callback| is invoked with 480 // When a file is successfully opened, |callback| is invoked with
469 // PLATFORM_FILE_OK, the opened file handle, and a callback function for 481 // PLATFORM_FILE_OK, the opened file handle, and a callback function for
470 // notifying that the file is closed. When the users of this function 482 // notifying that the file is closed. When the users of this function
471 // finished using the file, they must close the file handle and then must call 483 // finished using the file, they must close the file handle and then must call
472 // the supplied callback function. 484 // the supplied callback function.
473 typedef base::Callback<void (base::PlatformFileError)> 485 typedef base::Callback<void (base::PlatformFileError)>
474 NotifyCloseFileCallback; 486 NotifyCloseFileCallback;
475 typedef base::Callback< 487 typedef base::Callback<
476 void (base::PlatformFileError, 488 void (base::PlatformFileError,
477 base::PassPlatformFile, 489 base::PassPlatformFile,
478 const NotifyCloseFileCallback&)> AsyncOpenFileSystemURLCallback; 490 const NotifyCloseFileCallback&)> AsyncOpenFileSystemURLCallback;
479 virtual bool AsyncOpenFileSystemURL( 491 virtual bool AsyncOpenFileSystemURL(
480 const GURL& path, 492 const GURL& path,
481 int flags, 493 int flags,
482 const AsyncOpenFileSystemURLCallback& callback) = 0; 494 const AsyncOpenFileSystemURLCallback& callback) = 0;
483 495
484 virtual bool OpenFileSystem(
485 const GURL& origin_url,
486 fileapi::FileSystemType type,
487 long long size,
488 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0;
489 virtual bool MakeDirectory( 496 virtual bool MakeDirectory(
490 const GURL& path, 497 const GURL& path,
491 bool recursive, 498 bool recursive,
492 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0; 499 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0;
493 virtual bool Query(const GURL& path, 500 virtual bool Query(const GURL& path,
494 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0; 501 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0;
495 virtual bool Touch(const GURL& path, 502 virtual bool Touch(const GURL& path,
496 const base::Time& last_access_time, 503 const base::Time& last_access_time,
497 const base::Time& last_modified_time, 504 const base::Time& last_modified_time,
498 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0; 505 fileapi::FileSystemCallbackDispatcher* dispatcher) = 0;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( 663 virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
657 base::PlatformFile handle, 664 base::PlatformFile handle,
658 base::ProcessId target_process_id, 665 base::ProcessId target_process_id,
659 bool should_close_source) const = 0; 666 bool should_close_source) const = 0;
660 }; 667 };
661 668
662 } // namespace ppapi 669 } // namespace ppapi
663 } // namespace webkit 670 } // namespace webkit
664 671
665 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 672 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698