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.
5 #ifndef CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_
6 #define CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_
9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/webkitplatformsupport_impl.h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebMimeRegistry.h"
13 class WebFileSystemImpl
;
16 class WebFileUtilities
;
19 class WorkerWebKitPlatformSupportImpl
20 : public content::WebKitPlatformSupportImpl
,
21 public WebKit::WebMimeRegistry
{
23 WorkerWebKitPlatformSupportImpl();
24 virtual ~WorkerWebKitPlatformSupportImpl();
26 // WebKitPlatformSupport methods:
27 virtual WebKit::WebClipboard
* clipboard();
28 virtual WebKit::WebMimeRegistry
* mimeRegistry();
29 virtual WebKit::WebFileSystem
* fileSystem();
30 virtual WebKit::WebFileUtilities
* fileUtilities();
31 virtual WebKit::WebSandboxSupport
* sandboxSupport();
32 virtual bool sandboxEnabled();
33 virtual unsigned long long visitedLinkHash(const char* canonicalURL
,
35 virtual bool isLinkVisited(unsigned long long linkHash
);
36 virtual WebKit::WebMessagePortChannel
* createMessagePortChannel();
37 virtual void setCookies(const WebKit::WebURL
& url
,
38 const WebKit::WebURL
& first_party_for_cookies
,
39 const WebKit::WebString
& value
);
40 virtual WebKit::WebString
cookies(
41 const WebKit::WebURL
& url
,
42 const WebKit::WebURL
& first_party_for_cookies
);
43 virtual void prefetchHostName(const WebKit::WebString
&);
44 virtual WebKit::WebString
defaultLocale();
45 virtual WebKit::WebStorageNamespace
* createLocalStorageNamespace(
46 const WebKit::WebString
& path
, unsigned quota
);
47 virtual void dispatchStorageEvent(
48 const WebKit::WebString
& key
, const WebKit::WebString
& old_value
,
49 const WebKit::WebString
& new_value
, const WebKit::WebString
& origin
,
50 const WebKit::WebURL
& url
, bool is_local_storage
);
51 virtual WebKit::WebSharedWorkerRepository
* sharedWorkerRepository();
53 virtual WebKit::WebKitPlatformSupport::FileHandle
databaseOpenFile(
54 const WebKit::WebString
& vfs_file_name
, int desired_flags
);
55 virtual int databaseDeleteFile(const WebKit::WebString
& vfs_file_name
,
57 virtual long databaseGetFileAttributes(
58 const WebKit::WebString
& vfs_file_name
);
59 virtual long long databaseGetFileSize(
60 const WebKit::WebString
& vfs_file_name
);
61 virtual long long databaseGetSpaceAvailableForOrigin(
62 const WebKit::WebString
& origin_identifier
);
64 virtual WebKit::WebBlobRegistry
* blobRegistry();
66 virtual WebKit::WebIDBFactory
* idbFactory() OVERRIDE
;
68 // WebMimeRegistry methods:
69 virtual WebKit::WebMimeRegistry::SupportsType
supportsMIMEType(
70 const WebKit::WebString
&);
71 virtual WebKit::WebMimeRegistry::SupportsType
supportsImageMIMEType(
72 const WebKit::WebString
&);
73 virtual WebKit::WebMimeRegistry::SupportsType
supportsJavaScriptMIMEType(
74 const WebKit::WebString
&);
75 virtual WebKit::WebMimeRegistry::SupportsType
supportsMediaMIMEType(
76 const WebKit::WebString
&, const WebKit::WebString
&);
77 virtual WebKit::WebMimeRegistry::SupportsType
supportsNonImageMIMEType(
78 const WebKit::WebString
&);
79 virtual WebKit::WebString
mimeTypeForExtension(const WebKit::WebString
&);
80 virtual WebKit::WebString
wellKnownMimeTypeForExtension(
81 const WebKit::WebString
&);
82 virtual WebKit::WebString
mimeTypeFromFile(const WebKit::WebString
&);
83 virtual WebKit::WebString
preferredExtensionForMIMEType(
84 const WebKit::WebString
&);
89 scoped_ptr
<FileUtilities
> file_utilities_
;
91 scoped_ptr
<WebKit::WebBlobRegistry
> blob_registry_
;
93 scoped_ptr
<WebFileSystemImpl
> web_file_system_
;
94 scoped_ptr
<WebKit::WebIDBFactory
> web_idb_factory_
;
97 #endif // CONTENT_WORKER_WORKER_WEBKITPLATFORMSUPPORT_IMPL_H_