2 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #include "WebAudioDevice.h"
39 #include "WebBatteryStatusListener.h"
40 #include "WebCommon.h"
42 #include "WebDeviceLightListener.h"
43 #include "WebDeviceMotionListener.h"
44 #include "WebDeviceOrientationListener.h"
45 #include "WebGamepadListener.h"
46 #include "WebGamepads.h"
47 #include "WebGestureDevice.h"
48 #include "WebGraphicsContext3D.h"
49 #include "WebLocalizedString.h"
50 #include "WebPlatformEventType.h"
51 #include "WebSpeechSynthesizer.h"
52 #include "WebStorageQuotaCallbacks.h"
53 #include "WebStorageQuotaType.h"
54 #include "WebString.h"
55 #include "WebURLError.h"
56 #include "WebVector.h"
63 class WebBlobRegistry;
65 class WebContentDecryptionModule;
67 class WebCompositorSupport;
68 class WebConvertableToTraceFormat;
71 class WebDatabaseObserver;
72 class WebDiscardableMemory;
73 class WebPlatformEventListener;
74 class WebFallbackThemeEngine;
76 class WebFileUtilities;
77 class WebFlingAnimator;
78 class WebGeofencingProvider;
79 class WebGestureCurveTarget;
80 class WebGestureCurve;
81 class WebGraphicsContext3DProvider;
83 class WebMIDIAccessor;
84 class WebMIDIAccessorClient;
85 class WebMediaStreamCenter;
86 class WebMediaStreamCenterClient;
87 class WebMessagePortChannel;
88 class WebMimeRegistry;
89 class WebNotificationManager;
90 class WebPluginListBuilder;
91 class WebPrescientNetworking;
92 class WebPublicSuffixList;
93 class WebRTCPeerConnectionHandler;
94 class WebRTCPeerConnectionHandlerClient;
95 class WebSandboxSupport;
97 class WebSecurityOrigin;
98 class WebScrollbarBehavior;
99 class WebSocketHandle;
100 class WebSpeechSynthesizer;
101 class WebSpeechSynthesizerClient;
102 class WebStorageNamespace;
103 struct WebFloatPoint;
104 class WebThemeEngine;
108 class WebUnitTestSupport;
109 class WebWaitableEvent;
110 class WebWorkerRunLoop;
111 struct WebLocalizedString;
116 // HTML5 Database ------------------------------------------------------
119 typedef HANDLE FileHandle;
121 typedef int FileHandle;
124 BLINK_PLATFORM_EXPORT static void initialize(Platform*);
125 BLINK_PLATFORM_EXPORT static void shutdown();
126 BLINK_PLATFORM_EXPORT static Platform* current();
129 virtual WebCookieJar* cookieJar() { return 0; }
131 // Must return non-null.
132 virtual WebClipboard* clipboard() { return 0; }
134 // Must return non-null.
135 virtual WebFileUtilities* fileUtilities() { return 0; }
137 // Must return non-null.
138 virtual WebMimeRegistry* mimeRegistry() { return 0; }
140 // May return null if sandbox support is not necessary
141 virtual WebSandboxSupport* sandboxSupport() { return 0; }
143 // May return null on some platforms.
144 virtual WebThemeEngine* themeEngine() { return 0; }
146 virtual WebFallbackThemeEngine* fallbackThemeEngine() { return 0; }
149 virtual WebSpeechSynthesizer* createSpeechSynthesizer(WebSpeechSynthesizerClient*) { return 0; }
152 // Audio --------------------------------------------------------------
154 virtual double audioHardwareSampleRate() { return 0; }
155 virtual size_t audioHardwareBufferSize() { return 0; }
156 virtual unsigned audioHardwareOutputChannels() { return 0; }
158 // Creates a device for audio I/O.
159 // Pass in (numberOfInputChannels > 0) if live/local audio input is desired.
160 virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*, const WebString& deviceId) { return 0; }
163 // MIDI ----------------------------------------------------------------
165 // Creates a platform dependent WebMIDIAccessor. MIDIAccessor under platform
166 // creates and owns it.
167 virtual WebMIDIAccessor* createMIDIAccessor(WebMIDIAccessorClient*) { return 0; }
170 // Blob ----------------------------------------------------------------
172 // Must return non-null.
173 virtual WebBlobRegistry* blobRegistry() { return 0; }
175 // Database ------------------------------------------------------------
177 // Opens a database file; dirHandle should be 0 if the caller does not need
178 // a handle to the directory containing this file
179 virtual FileHandle databaseOpenFile(const WebString& vfsFileName, int desiredFlags) { return FileHandle(); }
181 // Deletes a database file and returns the error code
182 virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) { return 0; }
184 // Returns the attributes of the given database file
185 virtual long databaseGetFileAttributes(const WebString& vfsFileName) { return 0; }
187 // Returns the size of the given database file
188 virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; }
190 // Returns the space available for the given origin
191 virtual long long databaseGetSpaceAvailableForOrigin(const WebString& originIdentifier) { return 0; }
194 // DOM Storage --------------------------------------------------
196 // Return a LocalStorage namespace
197 virtual WebStorageNamespace* createLocalStorageNamespace() { return 0; }
200 // FileSystem ----------------------------------------------------------
202 // Must return non-null.
203 virtual WebFileSystem* fileSystem() { return 0; }
206 // IDN conversion ------------------------------------------------------
208 virtual WebString convertIDNToUnicode(const WebString& host, const WebString& languages) { return host; }
211 // IndexedDB ----------------------------------------------------------
213 // Must return non-null.
214 virtual WebIDBFactory* idbFactory() { return 0; }
217 // Gamepad -------------------------------------------------------------
219 virtual void sampleGamepads(WebGamepads& into) { into.length = 0; }
222 // History -------------------------------------------------------------
224 // Returns the hash for the given canonicalized URL for use in visited
226 virtual unsigned long long visitedLinkHash(
227 const char* canonicalURL, size_t length) { return 0; }
229 // Returns whether the given link hash is in the user's history. The
230 // hash must have been generated by calling VisitedLinkHash().
231 virtual bool isLinkVisited(unsigned long long linkHash) { return false; }
234 // Keygen --------------------------------------------------------------
236 // Handle the <keygen> tag for generating client certificates
237 // Returns a base64 encoded signed copy of a public key from a newly
238 // generated key pair and the supplied challenge string. keySizeindex
239 // specifies the strength of the key.
240 virtual WebString signedPublicKeyAndChallengeString(unsigned keySizeIndex,
241 const WebString& challenge,
242 const WebURL& url) { return WebString(); }
245 // Memory --------------------------------------------------------------
247 // Returns the current space allocated for the pagefile, in MB.
248 // That is committed size for Windows and virtual memory size for POSIX
249 virtual size_t memoryUsageMB() { return 0; }
251 // Same as above, but always returns actual value, without any caches.
252 virtual size_t actualMemoryUsageMB() { return 0; }
254 // Return the physical memory of the current machine, in MB.
255 virtual size_t physicalMemoryMB() { return 0; }
257 // Return the available virtual memory of the current machine, in MB. Or
258 // zero, if there is no limit.
259 virtual size_t virtualMemoryLimitMB() { return 0; }
261 // Return the number of of processors of the current machine.
262 virtual size_t numberOfProcessors() { return 0; }
264 // Returns private and shared usage, in bytes. Private bytes is the amount of
265 // memory currently allocated to this process that cannot be shared. Returns
266 // false on platform specific error conditions.
267 virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes) { return false; }
269 // Reports number of bytes used by memory allocator for internal needs.
270 // Returns true if the size has been reported, or false otherwise.
271 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; }
273 // Allocates discardable memory. May return 0, even if the platform supports
274 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is
275 // returned in an locked state. You may use its underlying data() member
276 // directly, taking care to unlock it when you are ready to let it become
278 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) { return 0; }
280 // A wrapper for tcmalloc's HeapProfilerStart();
281 virtual void startHeapProfiling(const WebString& /*prefix*/) { }
282 // A wrapper for tcmalloc's HeapProfilerStop();
283 virtual void stopHeapProfiling() { }
284 // A wrapper for tcmalloc's HeapProfilerDump()
285 virtual void dumpHeapProfiling(const WebString& /*reason*/) { }
286 // A wrapper for tcmalloc's GetHeapProfile()
287 virtual WebString getHeapProfile() { return WebString(); }
289 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1);
291 // Returns the maximum amount of memory a decoded image should be allowed.
292 // See comments on ImageDecoder::m_maxDecodedBytes.
293 virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; }
296 // Message Ports -------------------------------------------------------
298 // Creates a Message Port Channel pair. This can be called on any thread.
299 // The returned objects should only be used on the thread they were created on.
300 virtual void createMessageChannel(WebMessagePortChannel** channel1, WebMessagePortChannel** channel2) { *channel1 = 0; *channel2 = 0; }
303 // Network -------------------------------------------------------------
305 // Returns a new WebURLLoader instance.
306 virtual WebURLLoader* createURLLoader() { return 0; }
309 virtual WebPrescientNetworking* prescientNetworking() { return 0; }
311 // Returns a new WebSocketHandle instance.
312 virtual WebSocketHandle* createWebSocketHandle() { return 0; }
314 // Returns the User-Agent string.
315 virtual WebString userAgent() { return WebString(); }
317 // A suggestion to cache this metadata in association with this URL.
318 virtual void cacheMetadata(const WebURL&, double responseTime, const char* data, size_t dataSize) { }
320 // Returns the decoded data url if url had a supported mimetype and parsing was successful.
321 virtual WebData parseDataURL(const WebURL&, WebString& mimetype, WebString& charset) { return WebData(); }
323 virtual WebURLError cancelledError(const WebURL&) const { return WebURLError(); }
325 virtual bool isReservedIPAddress(const WebURL&) const { return false; }
326 virtual bool isReservedIPAddress(const WebSecurityOrigin&) const { return false; }
328 // Plugins -------------------------------------------------------------
330 // If refresh is true, then cached information should not be used to
331 // satisfy this call.
332 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { }
335 // Public Suffix List --------------------------------------------------
337 // May return null on some platforms.
338 virtual WebPublicSuffixList* publicSuffixList() { return 0; }
341 // Resources -----------------------------------------------------------
343 // Returns a localized string resource (with substitution parameters).
344 virtual WebString queryLocalizedString(WebLocalizedString::Name) { return WebString(); }
345 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter) { return WebString(); }
346 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter1, const WebString& parameter2) { return WebString(); }
349 // Threads -------------------------------------------------------
351 // Creates an embedder-defined thread.
352 virtual WebThread* createThread(const char* name) { return 0; }
354 // Returns an interface to the current thread. This is owned by the
356 virtual WebThread* currentThread() { return 0; }
358 // Yield the current thread so another thread can be scheduled.
359 virtual void yieldCurrentThread() { }
362 virtual WebScheduler* scheduler() { return 0; }
364 // WaitableEvent -------------------------------------------------------
366 // Creates an embedder-defined waitable event object.
367 virtual WebWaitableEvent* createWaitableEvent() { return 0; }
369 // Waits on multiple events and returns the event object that has been
370 // signaled. This may return 0 if it fails to wait events.
371 // Any event objects given to this method must not deleted while this
372 // wait is happening.
373 virtual WebWaitableEvent* waitMultipleEvents(const WebVector<WebWaitableEvent*>& events) { return 0; }
376 // Profiling -----------------------------------------------------------
378 virtual void decrementStatsCounter(const char* name) { }
379 virtual void incrementStatsCounter(const char* name) { }
382 // Resources -----------------------------------------------------------
384 // Returns a blob of data corresponding to the named resource.
385 virtual WebData loadResource(const char* name) { return WebData(); }
387 // Decodes the in-memory audio file data and returns the linear PCM audio data in the destinationBus.
388 // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate.
389 // Returns true on success.
390 virtual bool loadAudioResource(WebAudioBus* destinationBus, const char* audioFileData, size_t dataSize) { return false; }
392 // Screen -------------------------------------------------------------
394 // Supplies the system monitor color profile.
395 virtual void screenColorProfile(WebVector<char>* profile) { }
398 // Scrollbar ----------------------------------------------------------
400 // Must return non-null.
401 virtual WebScrollbarBehavior* scrollbarBehavior() { return 0; }
404 // Sudden Termination --------------------------------------------------
406 // Disable/Enable sudden termination.
407 virtual void suddenTerminationChanged(bool enabled) { }
410 // System --------------------------------------------------------------
412 // Returns a value such as "en-US".
413 virtual WebString defaultLocale() { return WebString(); }
415 // Wall clock time in seconds since the epoch.
416 virtual double currentTime() { return 0; }
418 // Monotonically increasing time in seconds from an arbitrary fixed point in the past.
419 // This function is expected to return at least millisecond-precision values. For this reason,
420 // it is recommended that the fixed point be no further in the past than the epoch.
421 virtual double monotonicallyIncreasingTime() { return 0; }
423 // WebKit clients must implement this funcion if they use cryptographic randomness.
424 virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) = 0;
426 // Delayed work is driven by a shared timer.
427 typedef void (*SharedTimerFunction)();
428 virtual void setSharedTimerFiredFunction(SharedTimerFunction timerFunction) { }
429 virtual void setSharedTimerFireInterval(double) { }
430 virtual void stopSharedTimer() { }
432 // Callable from a background WebKit thread.
433 virtual void callOnMainThread(void (*func)(void*), void* context) { }
436 // Vibration -----------------------------------------------------------
438 // Starts a vibration for the given duration in milliseconds. If there is currently an active
439 // vibration it will be cancelled before the new one is started.
440 virtual void vibrate(unsigned time) { }
442 // Cancels the current vibration, if there is one.
443 virtual void cancelVibration() { }
446 // Testing -------------------------------------------------------------
448 // Get a pointer to testing support interfaces. Will not be available in production builds.
449 virtual WebUnitTestSupport* unitTestSupport() { return 0; }
452 // Tracing -------------------------------------------------------------
454 // Get a pointer to the enabled state of the given trace category. The
455 // embedder can dynamically change the enabled state as trace event
456 // recording is started and stopped by the application. Only long-lived
457 // literal strings should be given as the category name. The implementation
458 // expects the returned pointer to be held permanently in a local static. If
459 // the unsigned char is non-zero, tracing is enabled. If tracing is enabled,
460 // addTraceEvent is expected to be called by the trace event macros.
461 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) { return 0; }
463 typedef long int TraceEventAPIAtomicWord;
465 // Get a pointer to a global state of the given thread. An embedder is
466 // expected to update the global state as the state of the embedder changes.
467 // A sampling thread in the Chromium side reads the global state periodically
468 // and reflects the sampling profiled results into about:tracing.
469 virtual TraceEventAPIAtomicWord* getTraceSamplingState(const unsigned bucketName) { return 0; }
471 typedef uint64_t TraceEventHandle;
473 // Add a trace event to the platform tracing system. Depending on the actual
474 // enabled state, this event may be recorded or dropped.
475 // - phase specifies the type of event:
476 // - BEGIN ('B'): Marks the beginning of a scoped event.
477 // - END ('E'): Marks the end of a scoped event.
478 // - COMPLETE ('X'): Marks the beginning of a scoped event, but doesn't
479 // need a matching END event. Instead, at the end of the scope,
480 // updateTraceEventDuration() must be called with the TraceEventHandle
481 // returned from addTraceEvent().
482 // - INSTANT ('I'): Standalone, instantaneous event.
483 // - START ('S'): Marks the beginning of an asynchronous event (the end
484 // event can occur in a different scope or thread). The id parameter is
485 // used to match START/FINISH pairs.
486 // - FINISH ('F'): Marks the end of an asynchronous event.
487 // - COUNTER ('C'): Used to trace integer quantities that change over
488 // time. The argument values are expected to be of type int.
489 // - METADATA ('M'): Reserved for internal use.
490 // - categoryEnabled is the pointer returned by getTraceCategoryEnabledFlag.
491 // - name is the name of the event. Also used to match BEGIN/END and
492 // START/FINISH pairs.
493 // - id optionally allows events of the same name to be distinguished from
494 // each other. For example, to trace the consutruction and destruction of
495 // objects, specify the pointer as the id parameter.
496 // - numArgs specifies the number of elements in argNames, argTypes, and
498 // - argNames is the array of argument names. Use long-lived literal strings
499 // or specify the COPY flag.
500 // - argTypes is the array of argument types:
502 // - UINT (2): unsigned long long
503 // - INT (3): long long
504 // - DOUBLE (4): double
505 // - POINTER (5): void*
506 // - STRING (6): char* (long-lived null-terminated char* string)
507 // - COPY_STRING (7): char* (temporary null-terminated char* string)
508 // - CONVERTABLE (8): WebConvertableToTraceFormat
509 // - argValues is the array of argument values. Each value is the unsigned
510 // long long member of a union of all supported types.
511 // - convertableValues is the array of WebConvertableToTraceFormat classes
512 // that may be converted to trace format by calling asTraceFormat method.
513 // ConvertableToTraceFormat interface.
514 // - thresholdBeginId optionally specifies the value returned by a previous
515 // call to addTraceEvent with a BEGIN phase.
516 // - threshold is used on an END phase event in conjunction with the
517 // thresholdBeginId of a prior BEGIN event. The threshold is the minimum
518 // number of microseconds that must have passed since the BEGIN event. If
519 // less than threshold microseconds has passed, the BEGIN/END pair is
521 // - flags can be 0 or one or more of the following, ORed together:
522 // - COPY (0x1): treat all strings (name, argNames and argValues of type
523 // string) as temporary so that they will be copied by addTraceEvent.
524 // - HAS_ID (0x2): use the id argument to uniquely identify the event for
525 // matching with other events of the same name.
526 // - MANGLE_ID (0x4): specify this flag if the id parameter is the value
528 virtual TraceEventHandle addTraceEvent(
530 const unsigned char* categoryEnabledFlag,
532 unsigned long long id,
534 const char** argNames,
535 const unsigned char* argTypes,
536 const unsigned long long* argValues,
537 const WebConvertableToTraceFormat* convertableValues,
543 // Set the duration field of a COMPLETE trace event.
544 virtual void updateTraceEventDuration(const unsigned char* categoryEnabledFlag, const char* name, TraceEventHandle) { }
546 // Callbacks for reporting histogram data.
547 // CustomCounts histogram has exponential bucket sizes, so that min=1, max=1000000, bucketCount=50 would do.
548 virtual void histogramCustomCounts(const char* name, int sample, int min, int max, int bucketCount) { }
549 // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value.
550 virtual void histogramEnumeration(const char* name, int sample, int boundaryValue) { }
551 // Unlike enumeration histograms, sparse histograms only allocate memory for non-empty buckets.
552 virtual void histogramSparse(const char* name, int sample) { }
555 // GPU ----------------------------------------------------------------
557 // May return null if GPU is not supported.
558 // Returns newly allocated and initialized offscreen WebGraphicsContext3D instance.
559 // Passing an existing context to shareContext will create the new context in the same share group as the passed context.
560 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3D* shareContext) { return 0; }
561 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3D* shareContext, WebGLInfo* glInfo) { return 0; }
562 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&) { return 0; }
564 // Returns a newly allocated and initialized offscreen context provider. The provider may return a null
565 // graphics context if GPU is not supported.
566 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3DProvider() { return 0; }
568 // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas.
569 // This will return false if the platform cannot promise that contexts will be preserved across operations like
570 // locking the screen or if the platform cannot provide a context with suitable performance characteristics.
572 // This value must be checked again after a context loss event as the platform's capabilities may have changed.
573 virtual bool canAccelerate2dCanvas() { return false; }
575 virtual bool isThreadedCompositingEnabled() { return false; }
577 virtual WebCompositorSupport* compositorSupport() { return 0; }
579 virtual WebFlingAnimator* createFlingAnimator() { return 0; }
581 // Creates a new fling animation curve instance for device |deviceSource|
582 // with |velocity| and already scrolled |cumulativeScroll| pixels.
583 virtual WebGestureCurve* createFlingAnimationCurve(WebGestureDevice deviceSource, const WebFloatPoint& velocity, const WebSize& cumulativeScroll) { return 0; }
585 // WebRTC ----------------------------------------------------------
587 // Creates an WebRTCPeerConnectionHandler for RTCPeerConnection.
588 // May return null if WebRTC functionality is not avaliable or out of resources.
589 virtual WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient*) { return 0; }
591 // May return null if WebRTC functionality is not avaliable or out of resources.
592 virtual WebMediaStreamCenter* createMediaStreamCenter(WebMediaStreamCenterClient*) { return 0; }
595 // WebWorker ----------------------------------------------------------
597 virtual void didStartWorkerRunLoop(const WebWorkerRunLoop&) { }
598 virtual void didStopWorkerRunLoop(const WebWorkerRunLoop&) { }
600 // WebCrypto ----------------------------------------------------------
602 virtual WebCrypto* crypto() { return 0; }
605 // Platform events -----------------------------------------------------
606 // Device Orientation, Device Motion, Device Light, Battery, Gamepad.
608 // Request the platform to start listening to the events of the specified
609 // type and notify the given listener (if not null) when there is an update.
610 virtual void startListening(WebPlatformEventType type, WebPlatformEventListener* listener) { }
612 // Request the platform to stop listening to the specified event and no
613 // longer notify the listener, if any.
614 virtual void stopListening(WebPlatformEventType type) { }
616 // Quota -----------------------------------------------------------
618 // Queries the storage partition's storage usage and quota information.
619 // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called
620 // with the current usage and quota information for the partition. When
621 // an error occurs WebStorageQuotaCallbacks::didFail is called with an
623 virtual void queryStorageUsageAndQuota(
624 const WebURL& storagePartition,
626 WebStorageQuotaCallbacks) { }
629 // WebDatabase --------------------------------------------------------
631 virtual WebDatabaseObserver* databaseObserver() { return 0; }
634 // Web Notifications --------------------------------------------------
636 virtual WebNotificationManager* notificationManager() { return 0; }
639 // Geofencing ---------------------------------------------------------
641 virtual WebGeofencingProvider* geofencingProvider() { return 0; }
643 // Bluetooth ----------------------------------------------------------
645 // Returns pointer to client owned WebBluetooth implementation.
646 virtual WebBluetooth* bluetooth() { return 0; }
649 virtual ~Platform() { }