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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 struct WebFloatPoint; | 116 struct WebFloatPoint; |
117 class WebThemeEngine; | 117 class WebThemeEngine; |
118 class WebThread; | 118 class WebThread; |
119 class WebTrialTokenValidator; | 119 class WebTrialTokenValidator; |
120 class WebURL; | 120 class WebURL; |
121 class WebURLLoader; | 121 class WebURLLoader; |
122 class WebUnitTestSupport; | 122 class WebUnitTestSupport; |
123 struct WebLocalizedString; | 123 struct WebLocalizedString; |
124 struct WebSize; | 124 struct WebSize; |
125 | 125 |
126 class Platform { | 126 class BLINK_PLATFORM_EXPORT Platform { |
127 public: | 127 public: |
128 // HTML5 Database ------------------------------------------------------ | 128 // HTML5 Database ------------------------------------------------------ |
129 | 129 |
130 #ifdef WIN32 | 130 #ifdef WIN32 |
131 typedef HANDLE FileHandle; | 131 typedef HANDLE FileHandle; |
132 #else | 132 #else |
133 typedef int FileHandle; | 133 typedef int FileHandle; |
134 #endif | 134 #endif |
135 | 135 |
136 BLINK_PLATFORM_EXPORT static void initialize(Platform*); | 136 static void initialize(Platform*); |
137 BLINK_PLATFORM_EXPORT static void shutdown(); | 137 static void shutdown(); |
138 BLINK_PLATFORM_EXPORT static Platform* current(); | 138 static Platform* current(); |
139 | 139 |
140 // May return null. | 140 // May return null. |
141 virtual WebCookieJar* cookieJar() { return nullptr; } | 141 virtual WebCookieJar* cookieJar() { return nullptr; } |
142 | 142 |
143 // Must return non-null. | 143 // Must return non-null. |
144 virtual WebClipboard* clipboard() { return nullptr; } | 144 virtual WebClipboard* clipboard() { return nullptr; } |
145 | 145 |
146 // Must return non-null. | 146 // Must return non-null. |
147 virtual WebFileUtilities* fileUtilities() { return nullptr; } | 147 virtual WebFileUtilities* fileUtilities() { return nullptr; } |
148 | 148 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // WebFrameClient::suddenTerminationDisablerChanged. | 380 // WebFrameClient::suddenTerminationDisablerChanged. |
381 virtual void suddenTerminationChanged(bool enabled) { } | 381 virtual void suddenTerminationChanged(bool enabled) { } |
382 | 382 |
383 | 383 |
384 // System -------------------------------------------------------------- | 384 // System -------------------------------------------------------------- |
385 | 385 |
386 // Returns a value such as "en-US". | 386 // Returns a value such as "en-US". |
387 virtual WebString defaultLocale() { return WebString(); } | 387 virtual WebString defaultLocale() { return WebString(); } |
388 | 388 |
389 // Returns an interface to the main thread. Can be null if blink was initial
ized on a thread without a message loop. | 389 // Returns an interface to the main thread. Can be null if blink was initial
ized on a thread without a message loop. |
390 BLINK_PLATFORM_EXPORT WebThread* mainThread() const; | 390 WebThread* mainThread() const; |
391 | 391 |
392 // Returns an interface to the compositor thread. This can be null if the | 392 // Returns an interface to the compositor thread. This can be null if the |
393 // renderer was created with threaded rendering desabled. | 393 // renderer was created with threaded rendering desabled. |
394 virtual WebThread* compositorThread() const { return 0; } | 394 virtual WebThread* compositorThread() const { return 0; } |
395 | 395 |
396 // Vibration ----------------------------------------------------------- | 396 // Vibration ----------------------------------------------------------- |
397 | 397 |
398 // Starts a vibration for the given duration in milliseconds. If there is cu
rrently an active | 398 // Starts a vibration for the given duration in milliseconds. If there is cu
rrently an active |
399 // vibration it will be cancelled before the new one is started. | 399 // vibration it will be cancelled before the new one is started. |
400 virtual void vibrate(unsigned time) { } | 400 virtual void vibrate(unsigned time) { } |
(...skipping 16 matching lines...) Expand all Loading... |
417 // be on a single line for extract_actions.py to find it. Please see | 417 // be on a single line for extract_actions.py to find it. Please see |
418 // that script for more details. Intended use is: | 418 // that script for more details. Intended use is: |
419 // recordAction(UserMetricsAction("MyAction")) | 419 // recordAction(UserMetricsAction("MyAction")) |
420 virtual void recordAction(const UserMetricsAction&) { } | 420 virtual void recordAction(const UserMetricsAction&) { } |
421 | 421 |
422 // Registers a memory dump provider. The WebMemoryDumpProvider::onMemoryDump | 422 // Registers a memory dump provider. The WebMemoryDumpProvider::onMemoryDump |
423 // method will be called on the same thread that called the | 423 // method will be called on the same thread that called the |
424 // registerMemoryDumpProvider() method. |name| is used for debugging | 424 // registerMemoryDumpProvider() method. |name| is used for debugging |
425 // (duplicates are allowed) and must be a long-lived C string. | 425 // (duplicates are allowed) and must be a long-lived C string. |
426 // See crbug.com/458295 for design docs. | 426 // See crbug.com/458295 for design docs. |
427 BLINK_PLATFORM_EXPORT virtual void registerMemoryDumpProvider(blink::WebMemo
ryDumpProvider*, const char* name); | 427 virtual void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*, const
char* name); |
428 | 428 |
429 // Must be called on the thread that called registerMemoryDumpProvider(). | 429 // Must be called on the thread that called registerMemoryDumpProvider(). |
430 BLINK_PLATFORM_EXPORT virtual void unregisterMemoryDumpProvider(blink::WebMe
moryDumpProvider*); | 430 virtual void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*); |
431 | 431 |
432 class TraceLogEnabledStateObserver { | 432 class TraceLogEnabledStateObserver { |
433 public: | 433 public: |
434 virtual ~TraceLogEnabledStateObserver() = default; | 434 virtual ~TraceLogEnabledStateObserver() = default; |
435 virtual void onTraceLogEnabled() = 0; | 435 virtual void onTraceLogEnabled() = 0; |
436 virtual void onTraceLogDisabled() = 0; | 436 virtual void onTraceLogDisabled() = 0; |
437 }; | 437 }; |
438 | 438 |
439 // Register or unregister a trace log state observer. Does not take ownershi
p. | 439 // Register or unregister a trace log state observer. Does not take ownershi
p. |
440 virtual void addTraceLogEnabledStateObserver(TraceLogEnabledStateObserver*)
{} | 440 virtual void addTraceLogEnabledStateObserver(TraceLogEnabledStateObserver*)
{} |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 | 602 |
603 // Background Sync API------------------------------------------------------
------ | 603 // Background Sync API------------------------------------------------------
------ |
604 | 604 |
605 virtual WebSyncProvider* backgroundSyncProvider() { return nullptr; } | 605 virtual WebSyncProvider* backgroundSyncProvider() { return nullptr; } |
606 | 606 |
607 // Experimental Framework ---------------------------------------------- | 607 // Experimental Framework ---------------------------------------------- |
608 | 608 |
609 virtual WebTrialTokenValidator* trialTokenValidator() { return nullptr; } | 609 virtual WebTrialTokenValidator* trialTokenValidator() { return nullptr; } |
610 | 610 |
611 protected: | 611 protected: |
612 BLINK_PLATFORM_EXPORT Platform(); | 612 Platform(); |
613 virtual ~Platform() { } | 613 virtual ~Platform() { } |
614 | 614 |
615 WebThread* m_mainThread; | 615 WebThread* m_mainThread; |
616 }; | 616 }; |
617 | 617 |
618 } // namespace blink | 618 } // namespace blink |
619 | 619 |
620 #endif | 620 #endif |
OLD | NEW |