Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: third_party/WebKit/public/platform/Platform.h

Issue 2387113002: reflow comments in public/platform/ (Closed)
Patch Set: nit Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebAddressSpace.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 // Process ------------------------------------------------------------- 322 // Process -------------------------------------------------------------
323 323
324 // Returns a unique identifier for a process. This may not necessarily be 324 // Returns a unique identifier for a process. This may not necessarily be
325 // the process's process ID. 325 // the process's process ID.
326 virtual uint32_t getUniqueIdForProcess() { return 0; } 326 virtual uint32_t getUniqueIdForProcess() { return 0; }
327 327
328 // Message Ports ------------------------------------------------------- 328 // Message Ports -------------------------------------------------------
329 329
330 // Creates a Message Port Channel pair. This can be called on any thread. 330 // Creates a Message Port Channel pair. This can be called on any thread.
331 // The returned objects should only be used on the thread they were created on . 331 // The returned objects should only be used on the thread they were created
332 // on.
332 virtual void createMessageChannel(WebMessagePortChannel** channel1, 333 virtual void createMessageChannel(WebMessagePortChannel** channel1,
333 WebMessagePortChannel** channel2) { 334 WebMessagePortChannel** channel2) {
334 *channel1 = 0; 335 *channel1 = 0;
335 *channel2 = 0; 336 *channel2 = 0;
336 } 337 }
337 338
338 // Network ------------------------------------------------------------- 339 // Network -------------------------------------------------------------
339 340
340 // Returns a new WebURLLoader instance. 341 // Returns a new WebURLLoader instance.
341 virtual WebURLLoader* createURLLoader() { return nullptr; } 342 virtual WebURLLoader* createURLLoader() { return nullptr; }
342 343
343 // May return null. 344 // May return null.
344 virtual WebPrescientNetworking* prescientNetworking() { return nullptr; } 345 virtual WebPrescientNetworking* prescientNetworking() { return nullptr; }
345 346
346 // Returns the User-Agent string. 347 // Returns the User-Agent string.
347 virtual WebString userAgent() { return WebString(); } 348 virtual WebString userAgent() { return WebString(); }
348 349
349 // A suggestion to cache this metadata in association with this URL. 350 // A suggestion to cache this metadata in association with this URL.
350 virtual void cacheMetadata(const WebURL&, 351 virtual void cacheMetadata(const WebURL&,
351 int64_t responseTime, 352 int64_t responseTime,
352 const char* data, 353 const char* data,
353 size_t dataSize) {} 354 size_t dataSize) {}
354 355
355 // A suggestion to cache this metadata in association with this URL which reso urce is in CacheStorage. 356 // A suggestion to cache this metadata in association with this URL which
357 // resource is in CacheStorage.
356 virtual void cacheMetadataInCacheStorage( 358 virtual void cacheMetadataInCacheStorage(
357 const WebURL&, 359 const WebURL&,
358 int64_t responseTime, 360 int64_t responseTime,
359 const char* data, 361 const char* data,
360 size_t dataSize, 362 size_t dataSize,
361 const blink::WebSecurityOrigin& cacheStorageOrigin, 363 const blink::WebSecurityOrigin& cacheStorageOrigin,
362 const WebString& cacheStorageCacheName) {} 364 const WebString& cacheStorageCacheName) {}
363 365
364 // Returns the decoded data url if url had a supported mimetype and parsing wa s successful. 366 // Returns the decoded data url if url had a supported mimetype and parsing
367 // was successful.
365 virtual WebData parseDataURL(const WebURL&, 368 virtual WebData parseDataURL(const WebURL&,
366 WebString& mimetype, 369 WebString& mimetype,
367 WebString& charset) { 370 WebString& charset) {
368 return WebData(); 371 return WebData();
369 } 372 }
370 373
371 virtual WebURLError cancelledError(const WebURL&) const { 374 virtual WebURLError cancelledError(const WebURL&) const {
372 return WebURLError(); 375 return WebURLError();
373 } 376 }
374 377
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 425
423 // Returns a blame context for attributing top-level work which does not 426 // Returns a blame context for attributing top-level work which does not
424 // belong to a particular frame scope. 427 // belong to a particular frame scope.
425 virtual BlameContext* topLevelBlameContext() { return nullptr; } 428 virtual BlameContext* topLevelBlameContext() { return nullptr; }
426 429
427 // Resources ----------------------------------------------------------- 430 // Resources -----------------------------------------------------------
428 431
429 // Returns a blob of data corresponding to the named resource. 432 // Returns a blob of data corresponding to the named resource.
430 virtual WebData loadResource(const char* name) { return WebData(); } 433 virtual WebData loadResource(const char* name) { return WebData(); }
431 434
432 // Decodes the in-memory audio file data and returns the linear PCM audio data in the destinationBus. 435 // Decodes the in-memory audio file data and returns the linear PCM audio data
433 // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate. 436 // in the destinationBus. A sample-rate conversion to sampleRate will occur
437 // if the file data is at a different sample-rate.
434 // Returns true on success. 438 // Returns true on success.
435 virtual bool loadAudioResource(WebAudioBus* destinationBus, 439 virtual bool loadAudioResource(WebAudioBus* destinationBus,
436 const char* audioFileData, 440 const char* audioFileData,
437 size_t dataSize) { 441 size_t dataSize) {
438 return false; 442 return false;
439 } 443 }
440 444
441 // Scrollbar ---------------------------------------------------------- 445 // Scrollbar ----------------------------------------------------------
442 446
443 // Must return non-null. 447 // Must return non-null.
444 virtual WebScrollbarBehavior* scrollbarBehavior() { return nullptr; } 448 virtual WebScrollbarBehavior* scrollbarBehavior() { return nullptr; }
445 449
446 // Sudden Termination -------------------------------------------------- 450 // Sudden Termination --------------------------------------------------
447 451
448 // Disable/Enable sudden termination on a process level. When possible, it 452 // Disable/Enable sudden termination on a process level. When possible, it
449 // is preferable to disable sudden termination on a per-frame level via 453 // is preferable to disable sudden termination on a per-frame level via
450 // WebFrameClient::suddenTerminationDisablerChanged. 454 // WebFrameClient::suddenTerminationDisablerChanged.
451 virtual void suddenTerminationChanged(bool enabled) {} 455 virtual void suddenTerminationChanged(bool enabled) {}
452 456
453 // System -------------------------------------------------------------- 457 // System --------------------------------------------------------------
454 458
455 // Returns a value such as "en-US". 459 // Returns a value such as "en-US".
456 virtual WebString defaultLocale() { return WebString(); } 460 virtual WebString defaultLocale() { return WebString(); }
457 461
458 // Returns an interface to the main thread. Can be null if blink was initializ ed on a thread without a message loop. 462 // Returns an interface to the main thread. Can be null if blink was
463 // initialized on a thread without a message loop.
459 WebThread* mainThread() const; 464 WebThread* mainThread() const;
460 465
461 // Returns an interface to the compositor thread. This can be null if the 466 // Returns an interface to the compositor thread. This can be null if the
462 // renderer was created with threaded rendering desabled. 467 // renderer was created with threaded rendering desabled.
463 virtual WebThread* compositorThread() const { return 0; } 468 virtual WebThread* compositorThread() const { return 0; }
464 469
465 // Testing ------------------------------------------------------------- 470 // Testing -------------------------------------------------------------
466 471
467 // Gets a pointer to URLLoaderMockFactory for testing. Will not be available i n production builds. 472 // Gets a pointer to URLLoaderMockFactory for testing. Will not be available
473 // in production builds.
468 virtual WebURLLoaderMockFactory* getURLLoaderMockFactory() { return nullptr; } 474 virtual WebURLLoaderMockFactory* getURLLoaderMockFactory() { return nullptr; }
469 475
470 // Record to a RAPPOR privacy-preserving metric, see: https://www.chromium.org /developers/design-documents/rappor. 476 // Record to a RAPPOR privacy-preserving metric, see:
471 // recordRappor records a sample string, while recordRapporURL records the eTL D+1 of a url. 477 // https://www.chromium.org/developers/design-documents/rappor.
478 // recordRappor records a sample string, while recordRapporURL records the
479 // eTLD+1 of a url.
472 virtual void recordRappor(const char* metric, const WebString& sample) {} 480 virtual void recordRappor(const char* metric, const WebString& sample) {}
473 virtual void recordRapporURL(const char* metric, const blink::WebURL& url) {} 481 virtual void recordRapporURL(const char* metric, const blink::WebURL& url) {}
474 482
475 // Record a UMA sequence action. The UserMetricsAction construction must 483 // Record a UMA sequence action. The UserMetricsAction construction must
476 // be on a single line for extract_actions.py to find it. Please see 484 // be on a single line for extract_actions.py to find it. Please see
477 // that script for more details. Intended use is: 485 // that script for more details. Intended use is:
478 // recordAction(UserMetricsAction("MyAction")) 486 // recordAction(UserMetricsAction("MyAction"))
479 virtual void recordAction(const UserMetricsAction&) {} 487 virtual void recordAction(const UserMetricsAction&) {}
480 488
481 typedef uint64_t WebMemoryAllocatorDumpGuid; 489 typedef uint64_t WebMemoryAllocatorDumpGuid;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 virtual WebGestureCurve* createFlingAnimationCurve( 550 virtual WebGestureCurve* createFlingAnimationCurve(
543 WebGestureDevice deviceSource, 551 WebGestureDevice deviceSource,
544 const WebFloatPoint& velocity, 552 const WebFloatPoint& velocity,
545 const WebSize& cumulativeScroll) { 553 const WebSize& cumulativeScroll) {
546 return nullptr; 554 return nullptr;
547 } 555 }
548 556
549 // WebRTC ---------------------------------------------------------- 557 // WebRTC ----------------------------------------------------------
550 558
551 // Creates a WebRTCPeerConnectionHandler for RTCPeerConnection. 559 // Creates a WebRTCPeerConnectionHandler for RTCPeerConnection.
552 // May return null if WebRTC functionality is not avaliable or if it's out of resources. 560 // May return null if WebRTC functionality is not avaliable or if it's out of
561 // resources.
553 virtual WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler( 562 virtual WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler(
554 WebRTCPeerConnectionHandlerClient*) { 563 WebRTCPeerConnectionHandlerClient*) {
555 return nullptr; 564 return nullptr;
556 } 565 }
557 566
558 // Creates a WebMediaRecorderHandler to record MediaStreams. 567 // Creates a WebMediaRecorderHandler to record MediaStreams.
559 // May return null if the functionality is not available or out of resources. 568 // May return null if the functionality is not available or out of resources.
560 virtual WebMediaRecorderHandler* createMediaRecorderHandler() { 569 virtual WebMediaRecorderHandler* createMediaRecorderHandler() {
561 return nullptr; 570 return nullptr;
562 } 571 }
563 572
564 // May return null if WebRTC functionality is not available or out of resource s. 573 // May return null if WebRTC functionality is not available or out of
574 // resources.
565 virtual WebRTCCertificateGenerator* createRTCCertificateGenerator() { 575 virtual WebRTCCertificateGenerator* createRTCCertificateGenerator() {
566 return nullptr; 576 return nullptr;
567 } 577 }
568 578
569 // May return null if WebRTC functionality is not available or out of resource s. 579 // May return null if WebRTC functionality is not available or out of
580 // resources.
570 virtual WebMediaStreamCenter* createMediaStreamCenter( 581 virtual WebMediaStreamCenter* createMediaStreamCenter(
571 WebMediaStreamCenterClient*) { 582 WebMediaStreamCenterClient*) {
572 return nullptr; 583 return nullptr;
573 } 584 }
574 585
575 // Creates a WebCanvasCaptureHandler to capture Canvas output. 586 // Creates a WebCanvasCaptureHandler to capture Canvas output.
576 virtual WebCanvasCaptureHandler* 587 virtual WebCanvasCaptureHandler*
577 createCanvasCaptureHandler(const WebSize&, double, WebMediaStreamTrack*) { 588 createCanvasCaptureHandler(const WebSize&, double, WebMediaStreamTrack*) {
578 return nullptr; 589 return nullptr;
579 } 590 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 // type and notify the given listener (if not null) when there is an update. 626 // type and notify the given listener (if not null) when there is an update.
616 virtual void startListening(WebPlatformEventType type, 627 virtual void startListening(WebPlatformEventType type,
617 WebPlatformEventListener* listener) {} 628 WebPlatformEventListener* listener) {}
618 629
619 // Request the platform to stop listening to the specified event and no 630 // Request the platform to stop listening to the specified event and no
620 // longer notify the listener, if any. 631 // longer notify the listener, if any.
621 virtual void stopListening(WebPlatformEventType type) {} 632 virtual void stopListening(WebPlatformEventType type) {}
622 633
623 // This method converts from the supplied DOM code enum to the 634 // This method converts from the supplied DOM code enum to the
624 // embedder's DOM code value for the key pressed. |domCode| values are 635 // embedder's DOM code value for the key pressed. |domCode| values are
625 // based on the value defined in ui/events/keycodes/dom4/keycode_converter_dat a.h. 636 // based on the value defined in
637 // ui/events/keycodes/dom4/keycode_converter_data.h.
626 // Returns null string, if DOM code value is not found. 638 // Returns null string, if DOM code value is not found.
627 virtual WebString domCodeStringFromEnum(int domCode) { return WebString(); } 639 virtual WebString domCodeStringFromEnum(int domCode) { return WebString(); }
628 640
629 // This method converts from the suppled DOM code value to the 641 // This method converts from the suppled DOM code value to the
630 // embedder's DOM code enum for the key pressed. |codeString| is defined in 642 // embedder's DOM code enum for the key pressed. |codeString| is defined in
631 // ui/events/keycodes/dom4/keycode_converter_data.h. 643 // ui/events/keycodes/dom4/keycode_converter_data.h.
632 // Returns 0, if DOM code enum is not found. 644 // Returns 0, if DOM code enum is not found.
633 virtual int domEnumFromCodeString(const WebString& codeString) { return 0; } 645 virtual int domEnumFromCodeString(const WebString& codeString) { return 0; }
634 646
635 // This method converts from the supplied DOM |key| enum to the 647 // This method converts from the supplied DOM |key| enum to the
636 // corresponding DOM |key| string value for the key pressed. |domKey| values a re 648 // corresponding DOM |key| string value for the key pressed. |domKey| values
637 // based on the value defined in ui/events/keycodes/dom3/dom_key_data.h. 649 // are based on the value defined in ui/events/keycodes/dom3/dom_key_data.h.
638 // Returns empty string, if DOM key value is not found. 650 // Returns empty string, if DOM key value is not found.
639 virtual WebString domKeyStringFromEnum(int domKey) { return WebString(); } 651 virtual WebString domKeyStringFromEnum(int domKey) { return WebString(); }
640 652
641 // This method converts from the suppled DOM |key| value to the 653 // This method converts from the suppled DOM |key| value to the
642 // embedder's DOM |key| enum for the key pressed. |keyString| is defined in 654 // embedder's DOM |key| enum for the key pressed. |keyString| is defined in
643 // ui/events/keycodes/dom3/dom_key_data.h. 655 // ui/events/keycodes/dom3/dom_key_data.h.
644 // Returns 0 if DOM key enum is not found. 656 // Returns 0 if DOM key enum is not found.
645 virtual int domKeyEnumFromString(const WebString& keyString) { return 0; } 657 virtual int domKeyEnumFromString(const WebString& keyString) { return 0; }
646 658
647 // Quota ----------------------------------------------------------- 659 // Quota -----------------------------------------------------------
(...skipping 12 matching lines...) Expand all
660 virtual WebDatabaseObserver* databaseObserver() { return nullptr; } 672 virtual WebDatabaseObserver* databaseObserver() { return nullptr; }
661 673
662 // Web Notifications -------------------------------------------------- 674 // Web Notifications --------------------------------------------------
663 675
664 virtual WebNotificationManager* notificationManager() { return nullptr; } 676 virtual WebNotificationManager* notificationManager() { return nullptr; }
665 677
666 // Push API------------------------------------------------------------ 678 // Push API------------------------------------------------------------
667 679
668 virtual WebPushProvider* pushProvider() { return nullptr; } 680 virtual WebPushProvider* pushProvider() { return nullptr; }
669 681
670 // Background Sync API-------------------------------------------------------- ---- 682 // Background Sync API-------------------------------------------------
671 683
672 virtual WebSyncProvider* backgroundSyncProvider() { return nullptr; } 684 virtual WebSyncProvider* backgroundSyncProvider() { return nullptr; }
673 685
674 // Experimental Framework ---------------------------------------------- 686 // Experimental Framework ----------------------------------------------
675 687
676 virtual WebTrialTokenValidator* trialTokenValidator() { return nullptr; } 688 virtual WebTrialTokenValidator* trialTokenValidator() { return nullptr; }
677 689
678 protected: 690 protected:
679 Platform(); 691 Platform();
680 virtual ~Platform() {} 692 virtual ~Platform() {}
681 693
682 WebThread* m_mainThread; 694 WebThread* m_mainThread;
683 }; 695 };
684 696
685 } // namespace blink 697 } // namespace blink
686 698
687 #endif 699 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebAddressSpace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698