| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 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 #ifndef CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ | |
| 6 #define CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/platform_file.h" | |
| 10 #include "base/scoped_ptr.h" | |
| 11 #include "webkit/glue/webkitclient_impl.h" | |
| 12 | |
| 13 class WebSharedWorkerRepositoryImpl; | |
| 14 class WebFileSystemImpl; | |
| 15 | |
| 16 namespace IPC { | |
| 17 class SyncMessage; | |
| 18 } | |
| 19 | |
| 20 namespace webkit_glue { | |
| 21 class WebClipboardImpl; | |
| 22 } | |
| 23 | |
| 24 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { | |
| 25 public: | |
| 26 RendererWebKitClientImpl(); | |
| 27 virtual ~RendererWebKitClientImpl(); | |
| 28 | |
| 29 // WebKitClient methods: | |
| 30 virtual WebKit::WebClipboard* clipboard(); | |
| 31 virtual WebKit::WebMimeRegistry* mimeRegistry(); | |
| 32 virtual WebKit::WebFileUtilities* fileUtilities(); | |
| 33 virtual WebKit::WebSandboxSupport* sandboxSupport(); | |
| 34 virtual WebKit::WebCookieJar* cookieJar(); | |
| 35 virtual bool sandboxEnabled(); | |
| 36 virtual unsigned long long visitedLinkHash( | |
| 37 const char* canonicalURL, size_t length); | |
| 38 virtual bool isLinkVisited(unsigned long long linkHash); | |
| 39 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); | |
| 40 virtual void prefetchHostName(const WebKit::WebString&); | |
| 41 virtual void cacheMetadata( | |
| 42 const WebKit::WebURL&, double, const char*, size_t); | |
| 43 virtual WebKit::WebString defaultLocale(); | |
| 44 virtual void suddenTerminationChanged(bool enabled); | |
| 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 | |
| 52 virtual WebKit::WebKitClient::FileHandle databaseOpenFile( | |
| 53 const WebKit::WebString& vfs_file_name, int desired_flags); | |
| 54 virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, | |
| 55 bool sync_dir); | |
| 56 virtual long databaseGetFileAttributes( | |
| 57 const WebKit::WebString& vfs_file_name); | |
| 58 virtual long long databaseGetFileSize( | |
| 59 const WebKit::WebString& vfs_file_name); | |
| 60 virtual WebKit::WebString signedPublicKeyAndChallengeString( | |
| 61 unsigned key_size_index, | |
| 62 const WebKit::WebString& challenge, | |
| 63 const WebKit::WebURL& url); | |
| 64 virtual WebKit::WebIDBFactory* idbFactory(); | |
| 65 virtual void createIDBKeysFromSerializedValuesAndKeyPath( | |
| 66 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | |
| 67 const WebKit::WebString& keyPath, | |
| 68 WebKit::WebVector<WebKit::WebIDBKey>& keys); | |
| 69 virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue( | |
| 70 const WebKit::WebIDBKey& key, | |
| 71 const WebKit::WebSerializedScriptValue& value, | |
| 72 const WebKit::WebString& keyPath); | |
| 73 virtual WebKit::WebFileSystem* fileSystem(); | |
| 74 | |
| 75 virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository(); | |
| 76 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(); | |
| 77 virtual WebKit::WebAudioDevice* createAudioDevice( | |
| 78 size_t buffer_size, unsigned channels, double sample_rate, | |
| 79 WebKit::WebAudioDevice::RenderCallback* callback); | |
| 80 | |
| 81 virtual WebKit::WebBlobRegistry* blobRegistry(); | |
| 82 | |
| 83 private: | |
| 84 bool CheckPreparsedJsCachingEnabled() const; | |
| 85 | |
| 86 // Helper function to send synchronous message from any thread. | |
| 87 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg); | |
| 88 | |
| 89 scoped_ptr<webkit_glue::WebClipboardImpl> clipboard_; | |
| 90 | |
| 91 class FileUtilities; | |
| 92 scoped_ptr<FileUtilities> file_utilities_; | |
| 93 | |
| 94 class MimeRegistry; | |
| 95 scoped_ptr<MimeRegistry> mime_registry_; | |
| 96 | |
| 97 class SandboxSupport; | |
| 98 scoped_ptr<SandboxSupport> sandbox_support_; | |
| 99 | |
| 100 // This counter keeps track of the number of times sudden termination is | |
| 101 // enabled or disabled. It starts at 0 (enabled) and for every disable | |
| 102 // increments by 1, for every enable decrements by 1. When it reaches 0, | |
| 103 // we tell the browser to enable fast termination. | |
| 104 int sudden_termination_disables_; | |
| 105 | |
| 106 // Implementation of the WebSharedWorkerRepository APIs (provides an interface | |
| 107 // to WorkerService on the browser thread. | |
| 108 scoped_ptr<WebSharedWorkerRepositoryImpl> shared_worker_repository_; | |
| 109 | |
| 110 scoped_ptr<WebKit::WebIDBFactory> web_idb_factory_; | |
| 111 | |
| 112 scoped_ptr<WebFileSystemImpl> web_file_system_; | |
| 113 | |
| 114 scoped_ptr<WebKit::WebBlobRegistry> blob_registry_; | |
| 115 }; | |
| 116 | |
| 117 #endif // CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ | |
| OLD | NEW |