Changeset 51345 in webkit


Ignore:
Timestamp:
Nov 24, 2009 11:38:52 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2009-11-24 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Darin Fisher.

Chromium: Expose method for reporting user stats
to the host. Also includes drive-by default implementation.

https://bugs.webkit.org/show_bug.cgi?id=31830

  • public/WebKitClient.h:
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r51338 r51345  
     12009-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
    1122009-11-24  Adam Barth  <abarth@webkit.org>
    213
  • trunk/WebKit/chromium/public/WebKitClient.h

    r50928 r51345  
    3333
    3434#include "WebCommon.h"
     35#include "WebData.h"
    3536#include "WebLocalizedString.h"
     37#include "WebString.h"
     38#include "WebURL.h"
    3639#include "WebVector.h"
    3740
     
    4750class WebApplicationCacheHostClient;
    4851class WebClipboard;
    49 class WebData;
    5052class WebMessagePortChannel;
    5153class WebMimeRegistry;
     
    5557class WebSocketStreamHandle;
    5658class WebStorageNamespace;
    57 class WebString;
    5859class WebThemeEngine;
    59 class WebURL;
    6060class WebURLLoader;
    6161struct WebCookie;
     
    6666public:
    6767    // Must return non-null.
    68     virtual WebClipboard* clipboard() = 0;
     68    virtual WebClipboard* clipboard() { return 0; }
    6969
    7070    // Must return non-null.
    71     virtual WebMimeRegistry* mimeRegistry() = 0;
     71    virtual WebMimeRegistry* mimeRegistry() { return 0; }
    7272
    7373    // May return null if sandbox support is not necessary
    74     virtual WebSandboxSupport* sandboxSupport() = 0;
     74    virtual WebSandboxSupport* sandboxSupport() { return 0; }
    7575
    7676    // May return null on some platforms.
    77     virtual WebThemeEngine* themeEngine() = 0;
     77    virtual WebThemeEngine* themeEngine() { return 0; }
    7878
    7979
     
    8181
    8282    // May return null if the process type doesn't involve appcaching.
    83     virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) = 0;
     83    virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; }
    8484
    8585
     
    8787
    8888    // 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; }
    9090
    9191    // Return a new SessionStorage namespace.
    92     virtual WebStorageNamespace* createSessionStorageNamespace() = 0;
     92    virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; }
    9393
    9494    // Called when storage events fire.
    9595    virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue,
    9696                                      const WebString& newValue, const WebString& origin,
    97                                       const WebURL& url, bool isLocalStorage) = 0;
     97                                      const WebURL& url, bool isLocalStorage) { }
    9898
    9999
     
    102102    // Various file/directory related functions.  These map 1:1 with
    103103    // 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(); }
    115115
    116116
     
    120120    // link coloring.
    121121    virtual unsigned long long visitedLinkHash(
    122         const char* canonicalURL, size_t length) = 0;
     122        const char* canonicalURL, size_t length) { return 0; }
    123123
    124124    // Returns whether the given link hash is in the user's history.  The
    125125    // 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; }
    127127
    128128
     
    138138    // a handle to the directory containing this file
    139139    virtual FileHandle databaseOpenFile(
    140         const WebString& vfsFileName, int desiredFlags, FileHandle* dirHandle) = 0;
     140        const WebString& vfsFileName, int desiredFlags, FileHandle* dirHandle) { return FileHandle(); }
    141141
    142142    // 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; }
    144144
    145145    // 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; }
    147147
    148148    // 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; }
    150150
    151151
     
    158158    virtual WebString signedPublicKeyAndChallengeString(unsigned keySizeIndex,
    159159                                                        const WebKit::WebString& challenge,
    160                                                         const WebKit::WebURL& url) = 0;
     160                                                        const WebKit::WebURL& url) { return WebString(); }
    161161
    162162
     
    166166    // Returns the current space allocated for the pagefile, in MB.
    167167    // 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; }
    169169
    170170
     
    173173    // Creates a Message Port Channel.  This can be called on any thread.
    174174    // 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; }
    176176
    177177
     
    179179
    180180    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) { }
    185185
    186186    // A suggestion to prefetch IP information for the given hostname.
    187     virtual void prefetchHostName(const WebString&) = 0;
     187    virtual void prefetchHostName(const WebString&) { }
    188188
    189189    // Returns a new WebURLLoader instance.
    190     virtual WebURLLoader* createURLLoader() = 0;
     190    virtual WebURLLoader* createURLLoader() { return 0; }
    191191
    192192    // Returns a new WebSocketStreamHandle instance.
    193     virtual WebSocketStreamHandle* createSocketStreamHandle() = 0;
     193    virtual WebSocketStreamHandle* createSocketStreamHandle() { return 0; }
    194194
    195195    // 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(); }
    197197
    198198
     
    201201    // If refresh is true, then cached information should not be used to
    202202    // satisfy this call.
    203     virtual void getPluginList(bool refresh, WebPluginListBuilder*) = 0;
     203    virtual void getPluginList(bool refresh, WebPluginListBuilder*) { };
    204204
    205205
    206206    // Profiling -----------------------------------------------------------
    207207
    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) { };
    210210
    211211    // An event is identified by the pair (name, id).  The extra parameter
    212212    // 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) { };
    215220
    216221
     
    218223
    219224    // 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(); }
    221226
    222227    // Returns a localized string resource (with an optional numeric
    223228    // 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(); }
    226231
    227232
     
    235240    // It's OK for this value to be conservitive (i.e. true even if the
    236241    // sandbox isn't active).
    237     virtual bool sandboxEnabled() = 0;
     242    virtual bool sandboxEnabled() { return false; }
    238243
    239244
    240245    // Shared Workers ------------------------------------------------------
    241246
    242     virtual WebSharedWorkerRepository* sharedWorkerRepository() = 0;
     247    virtual WebSharedWorkerRepository* sharedWorkerRepository() { return 0; }
    243248
    244249    // Sudden Termination --------------------------------------------------
    245250
    246251    // Disable/Enable sudden termination.
    247     virtual void suddenTerminationChanged(bool enabled) = 0;
     252    virtual void suddenTerminationChanged(bool enabled) { }
    248253
    249254
     
    251256
    252257    // Returns a value such as "en-US".
    253     virtual WebString defaultLocale() = 0;
     258    virtual WebString defaultLocale() { return WebString(); }
    254259
    255260    // Wall clock time in seconds since the epoch.
    256     virtual double currentTime() = 0;
     261    virtual double currentTime() { return 0; }
    257262
    258263    // 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() { }
    262267
    263268    // Callable from a background WebKit thread.
    264     virtual void callOnMainThread(void (*func)()) = 0;
     269    virtual void callOnMainThread(void (*func)()) { }
    265270
    266271protected:
Note: See TracChangeset for help on using the changeset viewer.