Changeset 51345 in webkit
- Timestamp:
- Nov 24, 2009 11:38:52 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r51338 r51345 1 2009-11-24 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Chromium: Expose method for reporting user stats 6 to the host. Also includes drive-by default implementation. 7 8 https://bugs.webkit.org/show_bug.cgi?id=31830 9 10 * public/WebKitClient.h: 11 1 12 2009-11-24 Adam Barth <abarth@webkit.org> 2 13 -
trunk/WebKit/chromium/public/WebKitClient.h
r50928 r51345 33 33 34 34 #include "WebCommon.h" 35 #include "WebData.h" 35 36 #include "WebLocalizedString.h" 37 #include "WebString.h" 38 #include "WebURL.h" 36 39 #include "WebVector.h" 37 40 … … 47 50 class WebApplicationCacheHostClient; 48 51 class WebClipboard; 49 class WebData;50 52 class WebMessagePortChannel; 51 53 class WebMimeRegistry; … … 55 57 class WebSocketStreamHandle; 56 58 class WebStorageNamespace; 57 class WebString;58 59 class WebThemeEngine; 59 class WebURL;60 60 class WebURLLoader; 61 61 struct WebCookie; … … 66 66 public: 67 67 // Must return non-null. 68 virtual WebClipboard* clipboard() = 0;68 virtual WebClipboard* clipboard() { return 0; } 69 69 70 70 // Must return non-null. 71 virtual WebMimeRegistry* mimeRegistry() = 0;71 virtual WebMimeRegistry* mimeRegistry() { return 0; } 72 72 73 73 // May return null if sandbox support is not necessary 74 virtual WebSandboxSupport* sandboxSupport() = 0;74 virtual WebSandboxSupport* sandboxSupport() { return 0; } 75 75 76 76 // May return null on some platforms. 77 virtual WebThemeEngine* themeEngine() = 0;77 virtual WebThemeEngine* themeEngine() { return 0; } 78 78 79 79 … … 81 81 82 82 // May return null if the process type doesn't involve appcaching. 83 virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) = 0;83 virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; } 84 84 85 85 … … 87 87 88 88 // Return a LocalStorage namespace that corresponds to the following path. 89 virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) = 0;89 virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) { return 0; } 90 90 91 91 // Return a new SessionStorage namespace. 92 virtual WebStorageNamespace* createSessionStorageNamespace() = 0;92 virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; } 93 93 94 94 // Called when storage events fire. 95 95 virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue, 96 96 const WebString& newValue, const WebString& origin, 97 const WebURL& url, bool isLocalStorage) = 0;97 const WebURL& url, bool isLocalStorage) { } 98 98 99 99 … … 102 102 // Various file/directory related functions. These map 1:1 with 103 103 // functions in WebCore's FileSystem.h. 104 virtual bool fileExists(const WebString& path) = 0;105 virtual bool deleteFile(const WebString& path) = 0;106 virtual bool deleteEmptyDirectory(const WebString& path) = 0;107 virtual bool getFileSize(const WebString& path, long long& result) = 0;108 virtual bool getFileModificationTime(const WebString& path, time_t& result) = 0;109 virtual WebString directoryName(const WebString& path) = 0;110 virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) = 0;111 virtual bool makeAllDirectories(const WebString& path) = 0;112 virtual WebString getAbsolutePath(const WebString& path) = 0;113 virtual bool isDirectory(const WebString& path) = 0;114 virtual WebURL filePathToURL(const WebString& path) = 0;104 virtual bool fileExists(const WebString& path) { return false; } 105 virtual bool deleteFile(const WebString& path) { return false; } 106 virtual bool deleteEmptyDirectory(const WebString& path) { return false; } 107 virtual bool getFileSize(const WebString& path, long long& result) { return false; } 108 virtual bool getFileModificationTime(const WebString& path, time_t& result) { return false; } 109 virtual WebString directoryName(const WebString& path) { return WebString(); } 110 virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } 111 virtual bool makeAllDirectories(const WebString& path) { return false; } 112 virtual WebString getAbsolutePath(const WebString& path) { return WebString(); } 113 virtual bool isDirectory(const WebString& path) { return false; } 114 virtual WebURL filePathToURL(const WebString& path) { return WebURL(); } 115 115 116 116 … … 120 120 // link coloring. 121 121 virtual unsigned long long visitedLinkHash( 122 const char* canonicalURL, size_t length) = 0;122 const char* canonicalURL, size_t length) { return 0; } 123 123 124 124 // Returns whether the given link hash is in the user's history. The 125 125 // hash must have been generated by calling VisitedLinkHash(). 126 virtual bool isLinkVisited(unsigned long long linkHash) = 0;126 virtual bool isLinkVisited(unsigned long long linkHash) { return false; } 127 127 128 128 … … 138 138 // a handle to the directory containing this file 139 139 virtual FileHandle databaseOpenFile( 140 const WebString& vfsFileName, int desiredFlags, FileHandle* dirHandle) = 0;140 const WebString& vfsFileName, int desiredFlags, FileHandle* dirHandle) { return FileHandle(); } 141 141 142 142 // Deletes a database file and returns the error code 143 virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) = 0;143 virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) { return 0; } 144 144 145 145 // Returns the attributes of the given database file 146 virtual long databaseGetFileAttributes(const WebString& vfsFileName) = 0;146 virtual long databaseGetFileAttributes(const WebString& vfsFileName) { return 0; } 147 147 148 148 // Returns the size of the given database file 149 virtual long long databaseGetFileSize(const WebString& vfsFileName) = 0;149 virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; } 150 150 151 151 … … 158 158 virtual WebString signedPublicKeyAndChallengeString(unsigned keySizeIndex, 159 159 const WebKit::WebString& challenge, 160 const WebKit::WebURL& url) = 0;160 const WebKit::WebURL& url) { return WebString(); } 161 161 162 162 … … 166 166 // Returns the current space allocated for the pagefile, in MB. 167 167 // That is committed size for Windows and virtual memory size for POSIX 168 virtual size_t memoryUsageMB() = 0;168 virtual size_t memoryUsageMB() { return 0; } 169 169 170 170 … … 173 173 // Creates a Message Port Channel. This can be called on any thread. 174 174 // The returned object should only be used on the thread it was created on. 175 virtual WebMessagePortChannel* createMessagePortChannel() = 0;175 virtual WebMessagePortChannel* createMessagePortChannel() { return 0; } 176 176 177 177 … … 179 179 180 180 virtual void setCookies( 181 const WebURL& url, const WebURL& policyURL, const WebString& cookies) = 0;182 virtual WebString cookies(const WebURL& url, const WebURL& policyURL) = 0;183 virtual bool rawCookies(const WebURL& url, const WebURL& policyURL, WebVector<WebCookie>*) = 0;184 virtual void deleteCookie(const WebURL& url, const WebString& cookieName) = 0;181 const WebURL& url, const WebURL& policyURL, const WebString& cookies) { } 182 virtual WebString cookies(const WebURL& url, const WebURL& policyURL) { return WebString(); } 183 virtual bool rawCookies(const WebURL& url, const WebURL& policyURL, WebVector<WebCookie>*) { return false; } 184 virtual void deleteCookie(const WebURL& url, const WebString& cookieName) { } 185 185 186 186 // A suggestion to prefetch IP information for the given hostname. 187 virtual void prefetchHostName(const WebString&) = 0;187 virtual void prefetchHostName(const WebString&) { } 188 188 189 189 // Returns a new WebURLLoader instance. 190 virtual WebURLLoader* createURLLoader() = 0;190 virtual WebURLLoader* createURLLoader() { return 0; } 191 191 192 192 // Returns a new WebSocketStreamHandle instance. 193 virtual WebSocketStreamHandle* createSocketStreamHandle() = 0;193 virtual WebSocketStreamHandle* createSocketStreamHandle() { return 0; } 194 194 195 195 // Returns the User-Agent string that should be used for the given URL. 196 virtual WebString userAgent(const WebURL&) = 0;196 virtual WebString userAgent(const WebURL&) { return WebString(); } 197 197 198 198 … … 201 201 // If refresh is true, then cached information should not be used to 202 202 // satisfy this call. 203 virtual void getPluginList(bool refresh, WebPluginListBuilder*) = 0;203 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { }; 204 204 205 205 206 206 // Profiling ----------------------------------------------------------- 207 207 208 virtual void decrementStatsCounter(const char* name) = 0;209 virtual void incrementStatsCounter(const char* name) = 0;208 virtual void decrementStatsCounter(const char* name) { }; 209 virtual void incrementStatsCounter(const char* name) { }; 210 210 211 211 // An event is identified by the pair (name, id). The extra parameter 212 212 // specifies additional data to log with the event. 213 virtual void traceEventBegin(const char* name, void* id, const char* extra) = 0; 214 virtual void traceEventEnd(const char* name, void* id, const char* extra) = 0; 213 virtual void traceEventBegin(const char* name, void* id, const char* extra) { }; 214 virtual void traceEventEnd(const char* name, void* id, const char* extra) { }; 215 216 // Generic callback for reporting histogram data. Range is identified by the min, max pair. 217 // By default, histogram is exponential, so that min=1, max=1000000, bucketCount=50 would do. Setting 218 // linear to true would require bucket count to cover whole min-max range. 219 virtual void histogramCounts(const WebString& name, int sample, int min, int max, int bucketCount, bool linear) { }; 215 220 216 221 … … 218 223 219 224 // Returns a blob of data corresponding to the named resource. 220 virtual WebData loadResource(const char* name) = 0;225 virtual WebData loadResource(const char* name) { return WebData(); } 221 226 222 227 // Returns a localized string resource (with an optional numeric 223 228 // parameter value). 224 virtual WebString queryLocalizedString(WebLocalizedString::Name) = 0;225 virtual WebString queryLocalizedString(WebLocalizedString::Name, int numericValue) = 0;229 virtual WebString queryLocalizedString(WebLocalizedString::Name) { return WebString(); } 230 virtual WebString queryLocalizedString(WebLocalizedString::Name, int numericValue) { return WebString(); } 226 231 227 232 … … 235 240 // It's OK for this value to be conservitive (i.e. true even if the 236 241 // sandbox isn't active). 237 virtual bool sandboxEnabled() = 0;242 virtual bool sandboxEnabled() { return false; } 238 243 239 244 240 245 // Shared Workers ------------------------------------------------------ 241 246 242 virtual WebSharedWorkerRepository* sharedWorkerRepository() = 0;247 virtual WebSharedWorkerRepository* sharedWorkerRepository() { return 0; } 243 248 244 249 // Sudden Termination -------------------------------------------------- 245 250 246 251 // Disable/Enable sudden termination. 247 virtual void suddenTerminationChanged(bool enabled) = 0;252 virtual void suddenTerminationChanged(bool enabled) { } 248 253 249 254 … … 251 256 252 257 // Returns a value such as "en-US". 253 virtual WebString defaultLocale() = 0;258 virtual WebString defaultLocale() { return WebString(); } 254 259 255 260 // Wall clock time in seconds since the epoch. 256 virtual double currentTime() = 0;261 virtual double currentTime() { return 0; } 257 262 258 263 // Delayed work is driven by a shared timer. 259 virtual void setSharedTimerFiredFunction(void (*func)()) = 0;260 virtual void setSharedTimerFireTime(double fireTime) = 0;261 virtual void stopSharedTimer() = 0;264 virtual void setSharedTimerFiredFunction(void (*func)()) { } 265 virtual void setSharedTimerFireTime(double fireTime) { } 266 virtual void stopSharedTimer() { } 262 267 263 268 // Callable from a background WebKit thread. 264 virtual void callOnMainThread(void (*func)()) = 0;269 virtual void callOnMainThread(void (*func)()) { } 265 270 266 271 protected:
Note: See TracChangeset
for help on using the changeset viewer.