OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 class WebCanvasCaptureHandler; | 87 class WebCanvasCaptureHandler; |
88 class WebClipboard; | 88 class WebClipboard; |
89 class WebCompositorSupport; | 89 class WebCompositorSupport; |
90 class WebCookieJar; | 90 class WebCookieJar; |
91 class WebCrypto; | 91 class WebCrypto; |
92 class WebDatabaseObserver; | 92 class WebDatabaseObserver; |
93 class WebPlatformEventListener; | 93 class WebPlatformEventListener; |
94 class WebFallbackThemeEngine; | 94 class WebFallbackThemeEngine; |
95 class WebFileSystem; | 95 class WebFileSystem; |
96 class WebFileUtilities; | 96 class WebFileUtilities; |
| 97 class WebFlingAnimator; |
97 class WebGestureCurve; | 98 class WebGestureCurve; |
98 class WebGraphicsContext3DProvider; | 99 class WebGraphicsContext3DProvider; |
99 class WebIDBFactory; | 100 class WebIDBFactory; |
100 class WebImageCaptureFrameGrabber; | 101 class WebImageCaptureFrameGrabber; |
101 class WebMIDIAccessor; | 102 class WebMIDIAccessor; |
102 class WebMIDIAccessorClient; | 103 class WebMIDIAccessorClient; |
103 class WebMediaCapabilitiesClient; | 104 class WebMediaCapabilitiesClient; |
104 class WebMediaPlayer; | 105 class WebMediaPlayer; |
105 class WebMediaRecorderHandler; | 106 class WebMediaRecorderHandler; |
106 class WebMediaStream; | 107 class WebMediaStream; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 163 |
163 // May return null if sandbox support is not necessary | 164 // May return null if sandbox support is not necessary |
164 virtual WebSandboxSupport* GetSandboxSupport() { return nullptr; } | 165 virtual WebSandboxSupport* GetSandboxSupport() { return nullptr; } |
165 | 166 |
166 // May return null on some platforms. | 167 // May return null on some platforms. |
167 virtual WebThemeEngine* ThemeEngine() { return nullptr; } | 168 virtual WebThemeEngine* ThemeEngine() { return nullptr; } |
168 | 169 |
169 virtual WebFallbackThemeEngine* FallbackThemeEngine() { return nullptr; } | 170 virtual WebFallbackThemeEngine* FallbackThemeEngine() { return nullptr; } |
170 | 171 |
171 // May return null. | 172 // May return null. |
172 virtual std::unique_ptr<WebSpeechSynthesizer> CreateSpeechSynthesizer( | 173 virtual WebSpeechSynthesizer* CreateSpeechSynthesizer( |
173 WebSpeechSynthesizerClient*) { | 174 WebSpeechSynthesizerClient*) { |
174 return nullptr; | 175 return nullptr; |
175 } | 176 } |
176 | 177 |
177 // Audio -------------------------------------------------------------- | 178 // Audio -------------------------------------------------------------- |
178 | 179 |
179 virtual double AudioHardwareSampleRate() { return 0; } | 180 virtual double AudioHardwareSampleRate() { return 0; } |
180 virtual size_t AudioHardwareBufferSize() { return 0; } | 181 virtual size_t AudioHardwareBufferSize() { return 0; } |
181 virtual unsigned AudioHardwareOutputChannels() { return 0; } | 182 virtual unsigned AudioHardwareOutputChannels() { return 0; } |
182 | 183 |
183 // Creates a device for audio I/O. | 184 // Creates a device for audio I/O. |
184 // Pass in (numberOfInputChannels > 0) if live/local audio input is desired. | 185 // Pass in (numberOfInputChannels > 0) if live/local audio input is desired. |
185 virtual std::unique_ptr<WebAudioDevice> CreateAudioDevice( | 186 virtual WebAudioDevice* CreateAudioDevice( |
186 unsigned number_of_input_channels, | 187 unsigned number_of_input_channels, |
187 unsigned number_of_channels, | 188 unsigned number_of_channels, |
188 const WebAudioLatencyHint& latency_hint, | 189 const WebAudioLatencyHint& latency_hint, |
189 WebAudioDevice::RenderCallback*, | 190 WebAudioDevice::RenderCallback*, |
190 const WebString& device_id, | 191 const WebString& device_id, |
191 const WebSecurityOrigin&) { | 192 const WebSecurityOrigin&) { |
192 return nullptr; | 193 return nullptr; |
193 } | 194 } |
194 | 195 |
195 // MIDI ---------------------------------------------------------------- | 196 // MIDI ---------------------------------------------------------------- |
196 | 197 |
197 // Creates a platform dependent WebMIDIAccessor. MIDIAccessor under platform | 198 // Creates a platform dependent WebMIDIAccessor. MIDIAccessor under platform |
198 // creates and owns it. | 199 // creates and owns it. |
199 virtual std::unique_ptr<WebMIDIAccessor> CreateMIDIAccessor( | 200 virtual WebMIDIAccessor* CreateMIDIAccessor(WebMIDIAccessorClient*) { |
200 WebMIDIAccessorClient*); | 201 return nullptr; |
| 202 } |
201 | 203 |
202 // Blob ---------------------------------------------------------------- | 204 // Blob ---------------------------------------------------------------- |
203 | 205 |
204 // Must return non-null. | 206 // Must return non-null. |
205 virtual WebBlobRegistry* GetBlobRegistry() { return nullptr; } | 207 virtual WebBlobRegistry* GetBlobRegistry() { return nullptr; } |
206 | 208 |
207 // Database ------------------------------------------------------------ | 209 // Database ------------------------------------------------------------ |
208 | 210 |
209 // Opens a database file; dirHandle should be 0 if the caller does not need | 211 // Opens a database file; dirHandle should be 0 if the caller does not need |
210 // a handle to the directory containing this file | 212 // a handle to the directory containing this file |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 245 |
244 // Return a filename-friendly identifier for an origin. | 246 // Return a filename-friendly identifier for an origin. |
245 virtual WebString DatabaseCreateOriginIdentifier( | 247 virtual WebString DatabaseCreateOriginIdentifier( |
246 const WebSecurityOrigin& origin) { | 248 const WebSecurityOrigin& origin) { |
247 return WebString(); | 249 return WebString(); |
248 } | 250 } |
249 | 251 |
250 // DOM Storage -------------------------------------------------- | 252 // DOM Storage -------------------------------------------------- |
251 | 253 |
252 // Return a LocalStorage namespace | 254 // Return a LocalStorage namespace |
253 virtual std::unique_ptr<WebStorageNamespace> CreateLocalStorageNamespace(); | 255 virtual WebStorageNamespace* CreateLocalStorageNamespace() { return nullptr; } |
254 | 256 |
255 // FileSystem ---------------------------------------------------------- | 257 // FileSystem ---------------------------------------------------------- |
256 | 258 |
257 // Must return non-null. | 259 // Must return non-null. |
258 virtual WebFileSystem* FileSystem() { return nullptr; } | 260 virtual WebFileSystem* FileSystem() { return nullptr; } |
259 | 261 |
260 // Return a filename-friendly identifier for an origin. | 262 // Return a filename-friendly identifier for an origin. |
261 virtual WebString FileSystemCreateOriginIdentifier( | 263 virtual WebString FileSystemCreateOriginIdentifier( |
262 const WebSecurityOrigin& origin) { | 264 const WebSecurityOrigin& origin) { |
263 return WebString(); | 265 return WebString(); |
264 } | 266 } |
265 | 267 |
266 // IDN conversion ------------------------------------------------------ | 268 // IDN conversion ------------------------------------------------------ |
267 | 269 |
268 virtual WebString ConvertIDNToUnicode(const WebString& host) { return host; } | 270 virtual WebString ConvertIDNToUnicode(const WebString& host) { return host; } |
269 | 271 |
270 // IndexedDB ---------------------------------------------------------- | 272 // IndexedDB ---------------------------------------------------------- |
271 | 273 |
272 // Must return non-null. | 274 // Must return non-null. |
273 virtual WebIDBFactory* IdbFactory() { return nullptr; } | 275 virtual WebIDBFactory* IdbFactory() { return nullptr; } |
274 | 276 |
275 // Cache Storage ---------------------------------------------------------- | 277 // Cache Storage ---------------------------------------------------------- |
276 | 278 |
277 virtual std::unique_ptr<WebServiceWorkerCacheStorage> CreateCacheStorage( | 279 // The caller is responsible for deleting the returned object. |
278 const WebSecurityOrigin&); | 280 virtual WebServiceWorkerCacheStorage* CacheStorage(const WebSecurityOrigin&) { |
| 281 return nullptr; |
| 282 } |
279 | 283 |
280 // Gamepad ------------------------------------------------------------- | 284 // Gamepad ------------------------------------------------------------- |
281 | 285 |
282 virtual void SampleGamepads(device::Gamepads& into) {} | 286 virtual void SampleGamepads(device::Gamepads& into) {} |
283 | 287 |
284 // History ------------------------------------------------------------- | 288 // History ------------------------------------------------------------- |
285 | 289 |
286 // Returns the hash for the given canonicalized URL for use in visited | 290 // Returns the hash for the given canonicalized URL for use in visited |
287 // link coloring. | 291 // link coloring. |
288 virtual unsigned long long VisitedLinkHash(const char* canonical_url, | 292 virtual unsigned long long VisitedLinkHash(const char* canonical_url, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 388 } |
385 virtual WebString QueryLocalizedString(WebLocalizedString::Name, | 389 virtual WebString QueryLocalizedString(WebLocalizedString::Name, |
386 const WebString& parameter1, | 390 const WebString& parameter1, |
387 const WebString& parameter2) { | 391 const WebString& parameter2) { |
388 return WebString(); | 392 return WebString(); |
389 } | 393 } |
390 | 394 |
391 // Threads ------------------------------------------------------- | 395 // Threads ------------------------------------------------------- |
392 | 396 |
393 // Creates an embedder-defined thread. | 397 // Creates an embedder-defined thread. |
394 virtual std::unique_ptr<WebThread> CreateThread(const char* name); | 398 virtual WebThread* CreateThread(const char* name) { return nullptr; } |
395 | 399 |
396 // Returns an interface to the current thread. This is owned by the | 400 // Returns an interface to the current thread. This is owned by the |
397 // embedder. | 401 // embedder. |
398 virtual WebThread* CurrentThread() { return nullptr; } | 402 virtual WebThread* CurrentThread() { return nullptr; } |
399 | 403 |
400 // Returns a blame context for attributing top-level work which does not | 404 // Returns a blame context for attributing top-level work which does not |
401 // belong to a particular frame scope. | 405 // belong to a particular frame scope. |
402 virtual BlameContext* GetTopLevelBlameContext() { return nullptr; } | 406 virtual BlameContext* GetTopLevelBlameContext() { return nullptr; } |
403 | 407 |
404 // Resources ----------------------------------------------------------- | 408 // Resources ----------------------------------------------------------- |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 WebString vendor_info; | 490 WebString vendor_info; |
487 WebString renderer_info; | 491 WebString renderer_info; |
488 WebString driver_version; | 492 WebString driver_version; |
489 WebString error_message; | 493 WebString error_message; |
490 }; | 494 }; |
491 // Returns a newly allocated and initialized offscreen context provider, | 495 // Returns a newly allocated and initialized offscreen context provider, |
492 // backed by an independent context. Returns null if the context cannot be | 496 // backed by an independent context. Returns null if the context cannot be |
493 // created or initialized. | 497 // created or initialized. |
494 // Passing an existing provider to shareContext will create the new context | 498 // Passing an existing provider to shareContext will create the new context |
495 // in the same share group as the one passed. | 499 // in the same share group as the one passed. |
496 virtual std::unique_ptr<WebGraphicsContext3DProvider> | 500 virtual WebGraphicsContext3DProvider* |
497 CreateOffscreenGraphicsContext3DProvider( | 501 CreateOffscreenGraphicsContext3DProvider( |
498 const ContextAttributes&, | 502 const ContextAttributes&, |
499 const WebURL& top_document_url, | 503 const WebURL& top_document_url, |
500 WebGraphicsContext3DProvider* share_context, | 504 WebGraphicsContext3DProvider* share_context, |
501 GraphicsInfo*); | 505 GraphicsInfo*) { |
| 506 return nullptr; |
| 507 } |
502 | 508 |
503 // Returns a newly allocated and initialized offscreen context provider, | 509 // Returns a newly allocated and initialized offscreen context provider, |
504 // backed by the process-wide shared main thread context. Returns null if | 510 // backed by the process-wide shared main thread context. Returns null if |
505 // the context cannot be created or initialized. | 511 // the context cannot be created or initialized. |
506 virtual std::unique_ptr<WebGraphicsContext3DProvider> | 512 virtual WebGraphicsContext3DProvider* |
507 CreateSharedOffscreenGraphicsContext3DProvider(); | 513 CreateSharedOffscreenGraphicsContext3DProvider() { |
| 514 return nullptr; |
| 515 } |
508 | 516 |
509 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() { | 517 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() { |
510 return nullptr; | 518 return nullptr; |
511 } | 519 } |
512 | 520 |
513 virtual std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap( | 521 virtual std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap( |
514 const WebSize& size) { | 522 const WebSize& size) { |
515 return nullptr; | 523 return nullptr; |
516 } | 524 } |
517 | 525 |
518 virtual bool IsThreadedCompositingEnabled() { return false; } | 526 virtual bool IsThreadedCompositingEnabled() { return false; } |
519 virtual bool IsThreadedAnimationEnabled() { return true; } | 527 virtual bool IsThreadedAnimationEnabled() { return true; } |
520 | 528 |
521 virtual WebCompositorSupport* CompositorSupport() { return nullptr; } | 529 virtual WebCompositorSupport* CompositorSupport() { return nullptr; } |
522 | 530 |
| 531 virtual WebFlingAnimator* CreateFlingAnimator() { return nullptr; } |
| 532 |
523 // Creates a new fling animation curve instance for device |deviceSource| | 533 // Creates a new fling animation curve instance for device |deviceSource| |
524 // with |velocity| and already scrolled |cumulativeScroll| pixels. | 534 // with |velocity| and already scrolled |cumulativeScroll| pixels. |
525 virtual std::unique_ptr<WebGestureCurve> CreateFlingAnimationCurve( | 535 virtual WebGestureCurve* CreateFlingAnimationCurve( |
526 WebGestureDevice device_source, | 536 WebGestureDevice device_source, |
527 const WebFloatPoint& velocity, | 537 const WebFloatPoint& velocity, |
528 const WebSize& cumulative_scroll); | 538 const WebSize& cumulative_scroll) { |
| 539 return nullptr; |
| 540 } |
529 | 541 |
530 // Whether the command line flag: --disable-gpu-compositing or --disable-gpu | 542 // Whether the command line flag: --disable-gpu-compositing or --disable-gpu |
531 // exists or not | 543 // exists or not |
532 // NOTE: This function should not be called from core/ and modules/, but | 544 // NOTE: This function should not be called from core/ and modules/, but |
533 // called by platform/graphics/ is fine. | 545 // called by platform/graphics/ is fine. |
534 virtual bool IsGPUCompositingEnabled() { return true; } | 546 virtual bool IsGPUCompositingEnabled() { return true; } |
535 | 547 |
536 // WebRTC ---------------------------------------------------------- | 548 // WebRTC ---------------------------------------------------------- |
537 | 549 |
538 // Creates a WebRTCPeerConnectionHandler for RTCPeerConnection. | 550 // Creates a WebRTCPeerConnectionHandler for RTCPeerConnection. |
539 // May return null if WebRTC functionality is not avaliable or if it's out of | 551 // May return null if WebRTC functionality is not avaliable or if it's out of |
540 // resources. | 552 // resources. |
541 virtual std::unique_ptr<WebRTCPeerConnectionHandler> | 553 virtual WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( |
542 CreateRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient*); | 554 WebRTCPeerConnectionHandlerClient*) { |
| 555 return nullptr; |
| 556 } |
543 | 557 |
544 // Creates a WebMediaRecorderHandler to record MediaStreams. | 558 // Creates a WebMediaRecorderHandler to record MediaStreams. |
545 // May return null if the functionality is not available or out of resources. | 559 // May return null if the functionality is not available or out of resources. |
546 virtual std::unique_ptr<WebMediaRecorderHandler> CreateMediaRecorderHandler(); | 560 virtual WebMediaRecorderHandler* CreateMediaRecorderHandler() { |
| 561 return nullptr; |
| 562 } |
547 | 563 |
548 // May return null if WebRTC functionality is not available or out of | 564 // May return null if WebRTC functionality is not available or out of |
549 // resources. | 565 // resources. |
550 virtual std::unique_ptr<WebRTCCertificateGenerator> | 566 virtual WebRTCCertificateGenerator* CreateRTCCertificateGenerator() { |
551 CreateRTCCertificateGenerator(); | 567 return nullptr; |
| 568 } |
552 | 569 |
553 // May return null if WebRTC functionality is not available or out of | 570 // May return null if WebRTC functionality is not available or out of |
554 // resources. | 571 // resources. |
555 virtual std::unique_ptr<WebMediaStreamCenter> CreateMediaStreamCenter( | 572 virtual WebMediaStreamCenter* CreateMediaStreamCenter( |
556 WebMediaStreamCenterClient*); | 573 WebMediaStreamCenterClient*) { |
| 574 return nullptr; |
| 575 } |
557 | 576 |
558 // Creates a WebCanvasCaptureHandler to capture Canvas output. | 577 // Creates a WebCanvasCaptureHandler to capture Canvas output. |
559 virtual std::unique_ptr<WebCanvasCaptureHandler> | 578 virtual WebCanvasCaptureHandler* |
560 CreateCanvasCaptureHandler(const WebSize&, double, WebMediaStreamTrack*); | 579 CreateCanvasCaptureHandler(const WebSize&, double, WebMediaStreamTrack*) { |
| 580 return nullptr; |
| 581 } |
561 | 582 |
562 // Fills in the WebMediaStream to capture from the WebMediaPlayer identified | 583 // Fills in the WebMediaStream to capture from the WebMediaPlayer identified |
563 // by the second parameter. | 584 // by the second parameter. |
564 virtual void CreateHTMLVideoElementCapturer(WebMediaStream*, | 585 virtual void CreateHTMLVideoElementCapturer(WebMediaStream*, |
565 WebMediaPlayer*) {} | 586 WebMediaPlayer*) {} |
566 virtual void CreateHTMLAudioElementCapturer(WebMediaStream*, | 587 virtual void CreateHTMLAudioElementCapturer(WebMediaStream*, |
567 WebMediaPlayer*) {} | 588 WebMediaPlayer*) {} |
568 | 589 |
569 // Creates a WebImageCaptureFrameGrabber to take a snapshot of a Video Tracks. | 590 // Creates a WebImageCaptureFrameGrabber to take a snapshot of a Video Tracks. |
570 // May return null if the functionality is not available. | 591 // May return null if the functionality is not available. |
571 virtual std::unique_ptr<WebImageCaptureFrameGrabber> | 592 virtual WebImageCaptureFrameGrabber* CreateImageCaptureFrameGrabber() { |
572 CreateImageCaptureFrameGrabber(); | 593 return nullptr; |
| 594 } |
573 | 595 |
574 // WebWorker ---------------------------------------------------------- | 596 // WebWorker ---------------------------------------------------------- |
575 | 597 |
576 virtual void DidStartWorkerThread() {} | 598 virtual void DidStartWorkerThread() {} |
577 virtual void WillStopWorkerThread() {} | 599 virtual void WillStopWorkerThread() {} |
578 virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {} | 600 virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {} |
579 virtual bool AllowScriptExtensionForServiceWorker(const WebURL& script_url) { | 601 virtual bool AllowScriptExtensionForServiceWorker(const WebURL& script_url) { |
580 return false; | 602 return false; |
581 } | 603 } |
582 | 604 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // Requests purging memory. The platform may or may not purge memory, | 691 // Requests purging memory. The platform may or may not purge memory, |
670 // depending on memory pressure. | 692 // depending on memory pressure. |
671 virtual void RequestPurgeMemory() {} | 693 virtual void RequestPurgeMemory() {} |
672 | 694 |
673 // Feature Policy ----------------------------------------------------- | 695 // Feature Policy ----------------------------------------------------- |
674 | 696 |
675 // Create a new feature policy object for a document, given its parent | 697 // Create a new feature policy object for a document, given its parent |
676 // document's policy (may be nullptr), its container policy (may be empty), | 698 // document's policy (may be nullptr), its container policy (may be empty), |
677 // the header policy with which it was delivered (may be empty), and the | 699 // the header policy with which it was delivered (may be empty), and the |
678 // document's origin. | 700 // document's origin. |
679 virtual std::unique_ptr<WebFeaturePolicy> CreateFeaturePolicy( | 701 virtual WebFeaturePolicy* CreateFeaturePolicy( |
680 const WebFeaturePolicy* parent_policy, | 702 const WebFeaturePolicy* parent_policy, |
681 const WebParsedFeaturePolicy& container_policy, | 703 const WebParsedFeaturePolicy& container_policy, |
682 const WebParsedFeaturePolicy& policy_header, | 704 const WebParsedFeaturePolicy& policy_header, |
683 const WebSecurityOrigin&); | 705 const WebSecurityOrigin&) { |
| 706 return nullptr; |
| 707 } |
684 | 708 |
685 // Create a new feature policy for a document whose origin has changed, given | 709 // Create a new feature policy for a document whose origin has changed, given |
686 // the previous policy object and the new origin. | 710 // the previous policy object and the new origin. |
687 virtual std::unique_ptr<WebFeaturePolicy> DuplicateFeaturePolicyWithOrigin( | 711 virtual WebFeaturePolicy* DuplicateFeaturePolicyWithOrigin( |
688 const WebFeaturePolicy&, | 712 const WebFeaturePolicy&, |
689 const WebSecurityOrigin&); | 713 const WebSecurityOrigin&) { |
| 714 return nullptr; |
| 715 } |
690 | 716 |
691 protected: | 717 protected: |
692 Platform(); | 718 Platform(); |
693 virtual ~Platform() {} | 719 virtual ~Platform() {} |
694 | 720 |
695 WebThread* main_thread_; | 721 WebThread* main_thread_; |
696 }; | 722 }; |
697 | 723 |
698 } // namespace blink | 724 } // namespace blink |
699 | 725 |
700 #endif | 726 #endif |
OLD | NEW |