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