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

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

Issue 1158913002: Replacing the 'return 0;' statements with 'return nullptr;' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | public/platform/WebCompositorSupport.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 typedef HANDLE FileHandle; 127 typedef HANDLE FileHandle;
128 #else 128 #else
129 typedef int FileHandle; 129 typedef int FileHandle;
130 #endif 130 #endif
131 131
132 BLINK_PLATFORM_EXPORT static void initialize(Platform*); 132 BLINK_PLATFORM_EXPORT static void initialize(Platform*);
133 BLINK_PLATFORM_EXPORT static void shutdown(); 133 BLINK_PLATFORM_EXPORT static void shutdown();
134 BLINK_PLATFORM_EXPORT static Platform* current(); 134 BLINK_PLATFORM_EXPORT static Platform* current();
135 135
136 // May return null. 136 // May return null.
137 virtual WebCookieJar* cookieJar() { return 0; } 137 virtual WebCookieJar* cookieJar() { return nullptr; }
138 138
139 // Must return non-null. 139 // Must return non-null.
140 virtual WebClipboard* clipboard() { return 0; } 140 virtual WebClipboard* clipboard() { return nullptr; }
141 141
142 // Must return non-null. 142 // Must return non-null.
143 virtual WebFileUtilities* fileUtilities() { return 0; } 143 virtual WebFileUtilities* fileUtilities() { return nullptr; }
144 144
145 // Must return non-null. 145 // Must return non-null.
146 virtual WebMimeRegistry* mimeRegistry() { return 0; } 146 virtual WebMimeRegistry* mimeRegistry() { return nullptr; }
147 147
148 // May return null if sandbox support is not necessary 148 // May return null if sandbox support is not necessary
149 virtual WebSandboxSupport* sandboxSupport() { return 0; } 149 virtual WebSandboxSupport* sandboxSupport() { return nullptr; }
150 150
151 // May return null on some platforms. 151 // May return null on some platforms.
152 virtual WebThemeEngine* themeEngine() { return 0; } 152 virtual WebThemeEngine* themeEngine() { return nullptr; }
153 153
154 virtual WebFallbackThemeEngine* fallbackThemeEngine() { return 0; } 154 virtual WebFallbackThemeEngine* fallbackThemeEngine() { return nullptr; }
155 155
156 // May return null. 156 // May return null.
157 virtual WebSpeechSynthesizer* createSpeechSynthesizer(WebSpeechSynthesizerCl ient*) { return 0; } 157 virtual WebSpeechSynthesizer* createSpeechSynthesizer(WebSpeechSynthesizerCl ient*) { return nullptr; }
158 158
159 159
160 // Audio -------------------------------------------------------------- 160 // Audio --------------------------------------------------------------
161 161
162 virtual double audioHardwareSampleRate() { return 0; } 162 virtual double audioHardwareSampleRate() { return 0; }
163 virtual size_t audioHardwareBufferSize() { return 0; } 163 virtual size_t audioHardwareBufferSize() { return 0; }
164 virtual unsigned audioHardwareOutputChannels() { return 0; } 164 virtual unsigned audioHardwareOutputChannels() { return 0; }
165 165
166 // Creates a device for audio I/O. 166 // Creates a device for audio I/O.
167 // Pass in (numberOfInputChannels > 0) if live/local audio input is desired. 167 // Pass in (numberOfInputChannels > 0) if live/local audio input is desired.
168 virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned number OfInputChannels, unsigned numberOfChannels, double sampleRate, WebAudioDevice::R enderCallback*, const WebString& deviceId) { return 0; } 168 virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned number OfInputChannels, unsigned numberOfChannels, double sampleRate, WebAudioDevice::R enderCallback*, const WebString& deviceId) { return nullptr; }
169 169
170 170
171 // MIDI ---------------------------------------------------------------- 171 // MIDI ----------------------------------------------------------------
172 172
173 // Creates a platform dependent WebMIDIAccessor. MIDIAccessor under platform 173 // Creates a platform dependent WebMIDIAccessor. MIDIAccessor under platform
174 // creates and owns it. 174 // creates and owns it.
175 virtual WebMIDIAccessor* createMIDIAccessor(WebMIDIAccessorClient*) { return 0; } 175 virtual WebMIDIAccessor* createMIDIAccessor(WebMIDIAccessorClient*) { return nullptr; }
176 176
177 177
178 // Blob ---------------------------------------------------------------- 178 // Blob ----------------------------------------------------------------
179 179
180 // Must return non-null. 180 // Must return non-null.
181 virtual WebBlobRegistry* blobRegistry() { return 0; } 181 virtual WebBlobRegistry* blobRegistry() { return nullptr; }
182 182
183 // Database ------------------------------------------------------------ 183 // Database ------------------------------------------------------------
184 184
185 // Opens a database file; dirHandle should be 0 if the caller does not need 185 // Opens a database file; dirHandle should be 0 if the caller does not need
186 // a handle to the directory containing this file 186 // a handle to the directory containing this file
187 virtual FileHandle databaseOpenFile(const WebString& vfsFileName, int desire dFlags) { return FileHandle(); } 187 virtual FileHandle databaseOpenFile(const WebString& vfsFileName, int desire dFlags) { return FileHandle(); }
188 188
189 // Deletes a database file and returns the error code 189 // Deletes a database file and returns the error code
190 virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) { return 0; } 190 virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) { return 0; }
191 191
192 // Returns the attributes of the given database file 192 // Returns the attributes of the given database file
193 virtual long databaseGetFileAttributes(const WebString& vfsFileName) { retur n 0; } 193 virtual long databaseGetFileAttributes(const WebString& vfsFileName) { retur n 0; }
194 194
195 // Returns the size of the given database file 195 // Returns the size of the given database file
196 virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; } 196 virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; }
197 197
198 // Returns the space available for the given origin 198 // Returns the space available for the given origin
199 virtual long long databaseGetSpaceAvailableForOrigin(const WebString& origin Identifier) { return 0; } 199 virtual long long databaseGetSpaceAvailableForOrigin(const WebString& origin Identifier) { return 0; }
200 200
201 // Set the size of the given database file 201 // Set the size of the given database file
202 virtual bool databaseSetFileSize(const WebString& vfsFileName, long long siz e) { return false; } 202 virtual bool databaseSetFileSize(const WebString& vfsFileName, long long siz e) { return false; }
203 203
204 204
205 // DOM Storage -------------------------------------------------- 205 // DOM Storage --------------------------------------------------
206 206
207 // Return a LocalStorage namespace 207 // Return a LocalStorage namespace
208 virtual WebStorageNamespace* createLocalStorageNamespace() { return 0; } 208 virtual WebStorageNamespace* createLocalStorageNamespace() { return nullptr; }
209 209
210 210
211 // FileSystem ---------------------------------------------------------- 211 // FileSystem ----------------------------------------------------------
212 212
213 // Must return non-null. 213 // Must return non-null.
214 virtual WebFileSystem* fileSystem() { return 0; } 214 virtual WebFileSystem* fileSystem() { return nullptr; }
215 215
216 216
217 // IDN conversion ------------------------------------------------------ 217 // IDN conversion ------------------------------------------------------
218 218
219 virtual WebString convertIDNToUnicode(const WebString& host, const WebString & languages) { return host; } 219 virtual WebString convertIDNToUnicode(const WebString& host, const WebString & languages) { return host; }
220 220
221 221
222 // IndexedDB ---------------------------------------------------------- 222 // IndexedDB ----------------------------------------------------------
223 223
224 // Must return non-null. 224 // Must return non-null.
225 virtual WebIDBFactory* idbFactory() { return 0; } 225 virtual WebIDBFactory* idbFactory() { return nullptr; }
226 226
227 227
228 // Cache Storage ---------------------------------------------------------- 228 // Cache Storage ----------------------------------------------------------
229 229
230 // The caller is responsible for deleting the returned object. 230 // The caller is responsible for deleting the returned object.
231 virtual WebServiceWorkerCacheStorage* cacheStorage(const WebString& originId entifier) { return nullptr; } 231 virtual WebServiceWorkerCacheStorage* cacheStorage(const WebString& originId entifier) { return nullptr; }
232 232
233 // Gamepad ------------------------------------------------------------- 233 // Gamepad -------------------------------------------------------------
234 234
235 virtual void sampleGamepads(WebGamepads& into) { into.length = 0; } 235 virtual void sampleGamepads(WebGamepads& into) { into.length = 0; }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 // Returns private and shared usage, in bytes. Private bytes is the amount o f 279 // Returns private and shared usage, in bytes. Private bytes is the amount o f
280 // memory currently allocated to this process that cannot be shared. Returns 280 // memory currently allocated to this process that cannot be shared. Returns
281 // false on platform specific error conditions. 281 // false on platform specific error conditions.
282 virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedB ytes) { return false; } 282 virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedB ytes) { return false; }
283 283
284 // Reports number of bytes used by memory allocator for internal needs. 284 // Reports number of bytes used by memory allocator for internal needs.
285 // Returns true if the size has been reported, or false otherwise. 285 // Returns true if the size has been reported, or false otherwise.
286 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; } 286 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; }
287 287
288 // Allocates discardable memory. May return 0, even if the platform supports 288 // Allocates discardable memory. May return nullptr, even if the platform su pports
289 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is 289 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is
290 // returned in an locked state. You may use its underlying data() member 290 // returned in an locked state. You may use its underlying data() member
291 // directly, taking care to unlock it when you are ready to let it become 291 // directly, taking care to unlock it when you are ready to let it become
292 // discardable. 292 // discardable.
293 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) { return 0; } 293 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) { return nullptr; }
294 294
295 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1); 295 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1);
296 296
297 // Returns the maximum amount of memory a decoded image should be allowed. 297 // Returns the maximum amount of memory a decoded image should be allowed.
298 // See comments on ImageDecoder::m_maxDecodedBytes. 298 // See comments on ImageDecoder::m_maxDecodedBytes.
299 virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; } 299 virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; }
300 300
301 301
302 // Message Ports ------------------------------------------------------- 302 // Message Ports -------------------------------------------------------
303 303
304 // Creates a Message Port Channel pair. This can be called on any thread. 304 // Creates a Message Port Channel pair. This can be called on any thread.
305 // The returned objects should only be used on the thread they were created on. 305 // The returned objects should only be used on the thread they were created on.
306 virtual void createMessageChannel(WebMessagePortChannel** channel1, WebMessa gePortChannel** channel2) { *channel1 = 0; *channel2 = 0; } 306 virtual void createMessageChannel(WebMessagePortChannel** channel1, WebMessa gePortChannel** channel2) { *channel1 = 0; *channel2 = 0; }
307 307
308 308
309 // Network ------------------------------------------------------------- 309 // Network -------------------------------------------------------------
310 310
311 // Returns a new WebURLLoader instance. 311 // Returns a new WebURLLoader instance.
312 virtual WebURLLoader* createURLLoader() { return 0; } 312 virtual WebURLLoader* createURLLoader() { return nullptr; }
313 313
314 // May return null. 314 // May return null.
315 virtual WebPrescientNetworking* prescientNetworking() { return 0; } 315 virtual WebPrescientNetworking* prescientNetworking() { return nullptr; }
316 316
317 // Returns a new WebSocketHandle instance. 317 // Returns a new WebSocketHandle instance.
318 virtual WebSocketHandle* createWebSocketHandle() { return 0; } 318 virtual WebSocketHandle* createWebSocketHandle() { return nullptr; }
319 319
320 // Returns the User-Agent string. 320 // Returns the User-Agent string.
321 virtual WebString userAgent() { return WebString(); } 321 virtual WebString userAgent() { return WebString(); }
322 322
323 // A suggestion to cache this metadata in association with this URL. 323 // A suggestion to cache this metadata in association with this URL.
324 virtual void cacheMetadata(const WebURL&, int64 responseTime, const char* da ta, size_t dataSize) { } 324 virtual void cacheMetadata(const WebURL&, int64 responseTime, const char* da ta, size_t dataSize) { }
325 325
326 // Returns the decoded data url if url had a supported mimetype and parsing was successful. 326 // Returns the decoded data url if url had a supported mimetype and parsing was successful.
327 virtual WebData parseDataURL(const WebURL&, WebString& mimetype, WebString& charset) { return WebData(); } 327 virtual WebData parseDataURL(const WebURL&, WebString& mimetype, WebString& charset) { return WebData(); }
328 328
329 virtual WebURLError cancelledError(const WebURL&) const { return WebURLError (); } 329 virtual WebURLError cancelledError(const WebURL&) const { return WebURLError (); }
330 330
331 virtual bool isReservedIPAddress(const WebString& host) const { return false ; } 331 virtual bool isReservedIPAddress(const WebString& host) const { return false ; }
332 332
333 virtual bool portAllowed(const WebURL&) const { return false; } 333 virtual bool portAllowed(const WebURL&) const { return false; }
334 334
335 // Plugins ------------------------------------------------------------- 335 // Plugins -------------------------------------------------------------
336 336
337 // If refresh is true, then cached information should not be used to 337 // If refresh is true, then cached information should not be used to
338 // satisfy this call. 338 // satisfy this call.
339 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { } 339 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { }
340 340
341 341
342 // Public Suffix List -------------------------------------------------- 342 // Public Suffix List --------------------------------------------------
343 343
344 // May return null on some platforms. 344 // May return null on some platforms.
345 virtual WebPublicSuffixList* publicSuffixList() { return 0; } 345 virtual WebPublicSuffixList* publicSuffixList() { return nullptr; }
346 346
347 347
348 // Resources ----------------------------------------------------------- 348 // Resources -----------------------------------------------------------
349 349
350 // Returns a localized string resource (with substitution parameters). 350 // Returns a localized string resource (with substitution parameters).
351 virtual WebString queryLocalizedString(WebLocalizedString::Name) { return We bString(); } 351 virtual WebString queryLocalizedString(WebLocalizedString::Name) { return We bString(); }
352 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebSt ring& parameter) { return WebString(); } 352 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebSt ring& parameter) { return WebString(); }
353 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebSt ring& parameter1, const WebString& parameter2) { return WebString(); } 353 virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebSt ring& parameter1, const WebString& parameter2) { return WebString(); }
354 354
355 355
356 // Threads ------------------------------------------------------- 356 // Threads -------------------------------------------------------
357 357
358 // Creates an embedder-defined thread. 358 // Creates an embedder-defined thread.
359 virtual WebThread* createThread(const char* name) { return 0; } 359 virtual WebThread* createThread(const char* name) { return nullptr; }
360 360
361 // Returns an interface to the current thread. This is owned by the 361 // Returns an interface to the current thread. This is owned by the
362 // embedder. 362 // embedder.
363 virtual WebThread* currentThread() { return 0; } 363 virtual WebThread* currentThread() { return nullptr; }
364 364
365 // Yield the current thread so another thread can be scheduled. 365 // Yield the current thread so another thread can be scheduled.
366 virtual void yieldCurrentThread() { } 366 virtual void yieldCurrentThread() { }
367 367
368 // WaitableEvent ------------------------------------------------------- 368 // WaitableEvent -------------------------------------------------------
369 369
370 // Creates an embedder-defined waitable event object. 370 // Creates an embedder-defined waitable event object.
371 virtual WebWaitableEvent* createWaitableEvent() { return 0; } 371 virtual WebWaitableEvent* createWaitableEvent() { return nullptr; }
372 372
373 // Waits on multiple events and returns the event object that has been 373 // Waits on multiple events and returns the event object that has been
374 // signaled. This may return 0 if it fails to wait events. 374 // signaled. This may return nullptr if it fails to wait events.
375 // Any event objects given to this method must not deleted while this 375 // Any event objects given to this method must not deleted while this
376 // wait is happening. 376 // wait is happening.
377 virtual WebWaitableEvent* waitMultipleEvents(const WebVector<WebWaitableEven t*>& events) { return 0; } 377 virtual WebWaitableEvent* waitMultipleEvents(const WebVector<WebWaitableEven t*>& events) { return nullptr; }
378 378
379 379
380 // Profiling ----------------------------------------------------------- 380 // Profiling -----------------------------------------------------------
381 381
382 virtual void decrementStatsCounter(const char* name) { } 382 virtual void decrementStatsCounter(const char* name) { }
383 virtual void incrementStatsCounter(const char* name) { } 383 virtual void incrementStatsCounter(const char* name) { }
384 384
385 385
386 // Resources ----------------------------------------------------------- 386 // Resources -----------------------------------------------------------
387 387
388 // Returns a blob of data corresponding to the named resource. 388 // Returns a blob of data corresponding to the named resource.
389 virtual WebData loadResource(const char* name) { return WebData(); } 389 virtual WebData loadResource(const char* name) { return WebData(); }
390 390
391 // Decodes the in-memory audio file data and returns the linear PCM audio da ta in the destinationBus. 391 // Decodes the in-memory audio file data and returns the linear PCM audio da ta in the destinationBus.
392 // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate. 392 // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate.
393 // Returns true on success. 393 // Returns true on success.
394 virtual bool loadAudioResource(WebAudioBus* destinationBus, const char* audi oFileData, size_t dataSize) { return false; } 394 virtual bool loadAudioResource(WebAudioBus* destinationBus, const char* audi oFileData, size_t dataSize) { return false; }
395 395
396 // Screen ------------------------------------------------------------- 396 // Screen -------------------------------------------------------------
397 397
398 // Supplies the system monitor color profile. 398 // Supplies the system monitor color profile.
399 virtual void screenColorProfile(WebVector<char>* profile) { } 399 virtual void screenColorProfile(WebVector<char>* profile) { }
400 400
401 401
402 // Scrollbar ---------------------------------------------------------- 402 // Scrollbar ----------------------------------------------------------
403 403
404 // Must return non-null. 404 // Must return non-null.
405 virtual WebScrollbarBehavior* scrollbarBehavior() { return 0; } 405 virtual WebScrollbarBehavior* scrollbarBehavior() { return nullptr; }
406 406
407 407
408 // Sudden Termination -------------------------------------------------- 408 // Sudden Termination --------------------------------------------------
409 409
410 // Disable/Enable sudden termination on a process level. When possible, it 410 // Disable/Enable sudden termination on a process level. When possible, it
411 // is preferable to disable sudden termination on a per-frame level via 411 // is preferable to disable sudden termination on a per-frame level via
412 // WebFrameClient::suddenTerminationDisablerChanged. 412 // WebFrameClient::suddenTerminationDisablerChanged.
413 virtual void suddenTerminationChanged(bool enabled) { } 413 virtual void suddenTerminationChanged(bool enabled) { }
414 414
415 415
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // vibration it will be cancelled before the new one is started. 448 // vibration it will be cancelled before the new one is started.
449 virtual void vibrate(unsigned time) { } 449 virtual void vibrate(unsigned time) { }
450 450
451 // Cancels the current vibration, if there is one. 451 // Cancels the current vibration, if there is one.
452 virtual void cancelVibration() { } 452 virtual void cancelVibration() { }
453 453
454 454
455 // Testing ------------------------------------------------------------- 455 // Testing -------------------------------------------------------------
456 456
457 // Get a pointer to testing support interfaces. Will not be available in pro duction builds. 457 // Get a pointer to testing support interfaces. Will not be available in pro duction builds.
458 virtual WebUnitTestSupport* unitTestSupport() { return 0; } 458 virtual WebUnitTestSupport* unitTestSupport() { return nullptr; }
459 459
460 460
461 // Tracing ------------------------------------------------------------- 461 // Tracing -------------------------------------------------------------
462 462
463 // Get a pointer to the enabled state of the given trace category. The 463 // Get a pointer to the enabled state of the given trace category. The
464 // embedder can dynamically change the enabled state as trace event 464 // embedder can dynamically change the enabled state as trace event
465 // recording is started and stopped by the application. Only long-lived 465 // recording is started and stopped by the application. Only long-lived
466 // literal strings should be given as the category name. The implementation 466 // literal strings should be given as the category name. The implementation
467 // expects the returned pointer to be held permanently in a local static. If 467 // expects the returned pointer to be held permanently in a local static. If
468 // the unsigned char is non-zero, tracing is enabled. If tracing is enabled, 468 // the unsigned char is non-zero, tracing is enabled. If tracing is enabled,
469 // addTraceEvent is expected to be called by the trace event macros. 469 // addTraceEvent is expected to be called by the trace event macros.
470 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categor yName) { return 0; } 470 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categor yName) { return nullptr; }
471 471
472 typedef intptr_t TraceEventAPIAtomicWord; 472 typedef intptr_t TraceEventAPIAtomicWord;
473 473
474 // Get a pointer to a global state of the given thread. An embedder is 474 // Get a pointer to a global state of the given thread. An embedder is
475 // expected to update the global state as the state of the embedder changes. 475 // expected to update the global state as the state of the embedder changes.
476 // A sampling thread in the Chromium side reads the global state periodicall y 476 // A sampling thread in the Chromium side reads the global state periodicall y
477 // and reflects the sampling profiled results into about:tracing. 477 // and reflects the sampling profiled results into about:tracing.
478 virtual TraceEventAPIAtomicWord* getTraceSamplingState(const unsigned bucket Name) { return 0; } 478 virtual TraceEventAPIAtomicWord* getTraceSamplingState(const unsigned bucket Name) { return nullptr; }
479 479
480 typedef uint64_t TraceEventHandle; 480 typedef uint64_t TraceEventHandle;
481 481
482 // Add a trace event to the platform tracing system. Depending on the actual 482 // Add a trace event to the platform tracing system. Depending on the actual
483 // enabled state, this event may be recorded or dropped. 483 // enabled state, this event may be recorded or dropped.
484 // - phase specifies the type of event: 484 // - phase specifies the type of event:
485 // - BEGIN ('B'): Marks the beginning of a scoped event. 485 // - BEGIN ('B'): Marks the beginning of a scoped event.
486 // - END ('E'): Marks the end of a scoped event. 486 // - END ('E'): Marks the end of a scoped event.
487 // - COMPLETE ('X'): Marks the beginning of a scoped event, but doesn't 487 // - COMPLETE ('X'): Marks the beginning of a scoped event, but doesn't
488 // need a matching END event. Instead, at the end of the scope, 488 // need a matching END event. Instead, at the end of the scope,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 virtual void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*) { } 577 virtual void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*) { }
578 578
579 // Must be called on the thread that called registerMemoryDumpProvider(). 579 // Must be called on the thread that called registerMemoryDumpProvider().
580 virtual void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*) { } 580 virtual void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*) { }
581 581
582 // GPU ---------------------------------------------------------------- 582 // GPU ----------------------------------------------------------------
583 // 583 //
584 // May return null if GPU is not supported. 584 // May return null if GPU is not supported.
585 // Returns newly allocated and initialized offscreen WebGraphicsContext3D in stance. 585 // Returns newly allocated and initialized offscreen WebGraphicsContext3D in stance.
586 // Passing an existing context to shareContext will create the new context i n the same share group as the passed context. 586 // Passing an existing context to shareContext will create the new context i n the same share group as the passed context.
587 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&, WebGraphicsContext3D* shareContext) { return 0; } 587 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&, WebGraphicsContext3D* shareContext) { return nullptr ; }
588 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&, WebGraphicsContext3D* shareContext, WebGLInfo* glInf o) { return 0; } 588 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&, WebGraphicsContext3D* shareContext, WebGLInfo* glInf o) { return nullptr; }
589 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&) { return 0; } 589 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGrap hicsContext3D::Attributes&) { return nullptr; }
590 590
591 // Returns a newly allocated and initialized offscreen context provider. The provider may return a null 591 // Returns a newly allocated and initialized offscreen context provider. The provider may return a null
592 // graphics context if GPU is not supported. 592 // graphics context if GPU is not supported.
593 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D Provider() { return 0; } 593 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D Provider() { return nullptr; }
594 594
595 // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas. 595 // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas.
596 // This will return false if the platform cannot promise that contexts will be preserved across operations like 596 // This will return false if the platform cannot promise that contexts will be preserved across operations like
597 // locking the screen or if the platform cannot provide a context with suita ble performance characteristics. 597 // locking the screen or if the platform cannot provide a context with suita ble performance characteristics.
598 // 598 //
599 // This value must be checked again after a context loss event as the platfo rm's capabilities may have changed. 599 // This value must be checked again after a context loss event as the platfo rm's capabilities may have changed.
600 virtual bool canAccelerate2dCanvas() { return false; } 600 virtual bool canAccelerate2dCanvas() { return false; }
601 601
602 virtual bool isThreadedCompositingEnabled() { return false; } 602 virtual bool isThreadedCompositingEnabled() { return false; }
603 603
604 virtual WebCompositorSupport* compositorSupport() { return 0; } 604 virtual WebCompositorSupport* compositorSupport() { return nullptr; }
605 605
606 virtual WebFlingAnimator* createFlingAnimator() { return 0; } 606 virtual WebFlingAnimator* createFlingAnimator() { return nullptr; }
607 607
608 // Creates a new fling animation curve instance for device |deviceSource| 608 // Creates a new fling animation curve instance for device |deviceSource|
609 // with |velocity| and already scrolled |cumulativeScroll| pixels. 609 // with |velocity| and already scrolled |cumulativeScroll| pixels.
610 virtual WebGestureCurve* createFlingAnimationCurve(WebGestureDevice deviceSo urce, const WebFloatPoint& velocity, const WebSize& cumulativeScroll) { return 0 ; } 610 virtual WebGestureCurve* createFlingAnimationCurve(WebGestureDevice deviceSo urce, const WebFloatPoint& velocity, const WebSize& cumulativeScroll) { return n ullptr; }
611 611
612 // WebRTC ---------------------------------------------------------- 612 // WebRTC ----------------------------------------------------------
613 613
614 // Creates an WebRTCPeerConnectionHandler for RTCPeerConnection. 614 // Creates an WebRTCPeerConnectionHandler for RTCPeerConnection.
615 // May return null if WebRTC functionality is not avaliable or out of resour ces. 615 // May return null if WebRTC functionality is not avaliable or out of resour ces.
616 virtual WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler(WebRTCPe erConnectionHandlerClient*) { return 0; } 616 virtual WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler(WebRTCPe erConnectionHandlerClient*) { return nullptr; }
617 617
618 // May return null if WebRTC functionality is not avaliable or out of resour ces. 618 // May return null if WebRTC functionality is not avaliable or out of resour ces.
619 virtual WebMediaStreamCenter* createMediaStreamCenter(WebMediaStreamCenterCl ient*) { return 0; } 619 virtual WebMediaStreamCenter* createMediaStreamCenter(WebMediaStreamCenterCl ient*) { return nullptr; }
620 620
621 621
622 // WebWorker ---------------------------------------------------------- 622 // WebWorker ----------------------------------------------------------
623 623
624 virtual void didStartWorkerRunLoop() { } 624 virtual void didStartWorkerRunLoop() { }
625 virtual void didStopWorkerRunLoop() { } 625 virtual void didStopWorkerRunLoop() { }
626 626
627 // WebCrypto ---------------------------------------------------------- 627 // WebCrypto ----------------------------------------------------------
628 628
629 virtual WebCrypto* crypto() { return 0; } 629 virtual WebCrypto* crypto() { return nullptr; }
630 630
631 631
632 // Platform events ----------------------------------------------------- 632 // Platform events -----------------------------------------------------
633 // Device Orientation, Device Motion, Device Light, Battery, Gamepad. 633 // Device Orientation, Device Motion, Device Light, Battery, Gamepad.
634 634
635 // Request the platform to start listening to the events of the specified 635 // Request the platform to start listening to the events of the specified
636 // type and notify the given listener (if not null) when there is an update. 636 // type and notify the given listener (if not null) when there is an update.
637 virtual void startListening(WebPlatformEventType type, WebPlatformEventListe ner* listener) { } 637 virtual void startListening(WebPlatformEventType type, WebPlatformEventListe ner* listener) { }
638 638
639 // Request the platform to stop listening to the specified event and no 639 // Request the platform to stop listening to the specified event and no
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 // an error occurs WebStorageQuotaCallbacks::didFail is called with an 672 // an error occurs WebStorageQuotaCallbacks::didFail is called with an
673 // error code. 673 // error code.
674 virtual void queryStorageUsageAndQuota( 674 virtual void queryStorageUsageAndQuota(
675 const WebURL& storagePartition, 675 const WebURL& storagePartition,
676 WebStorageQuotaType, 676 WebStorageQuotaType,
677 WebStorageQuotaCallbacks) { } 677 WebStorageQuotaCallbacks) { }
678 678
679 679
680 // WebDatabase -------------------------------------------------------- 680 // WebDatabase --------------------------------------------------------
681 681
682 virtual WebDatabaseObserver* databaseObserver() { return 0; } 682 virtual WebDatabaseObserver* databaseObserver() { return nullptr; }
683 683
684 684
685 // Web Notifications -------------------------------------------------- 685 // Web Notifications --------------------------------------------------
686 686
687 virtual WebNotificationManager* notificationManager() { return 0; } 687 virtual WebNotificationManager* notificationManager() { return nullptr; }
688 688
689 689
690 // Geofencing --------------------------------------------------------- 690 // Geofencing ---------------------------------------------------------
691 691
692 virtual WebGeofencingProvider* geofencingProvider() { return 0; } 692 virtual WebGeofencingProvider* geofencingProvider() { return nullptr; }
693 693
694 694
695 // Bluetooth ---------------------------------------------------------- 695 // Bluetooth ----------------------------------------------------------
696 696
697 // Returns pointer to client owned WebBluetooth implementation. 697 // Returns pointer to client owned WebBluetooth implementation.
698 virtual WebBluetooth* bluetooth() { return 0; } 698 virtual WebBluetooth* bluetooth() { return nullptr; }
699 699
700 700
701 // Push API------------------------------------------------------------ 701 // Push API------------------------------------------------------------
702 702
703 virtual WebPushProvider* pushProvider() { return 0; } 703 virtual WebPushProvider* pushProvider() { return nullptr; }
704 704
705 705
706 // navigator.connect -------------------------------------------------- 706 // navigator.connect --------------------------------------------------
707 707
708 virtual WebNavigatorConnectProvider* navigatorConnectProvider() { return 0; } 708 virtual WebNavigatorConnectProvider* navigatorConnectProvider() { return nul lptr; }
709 709
710 // Permissions -------------------------------------------------------- 710 // Permissions --------------------------------------------------------
711 711
712 virtual WebPermissionClient* permissionClient() { return 0; } 712 virtual WebPermissionClient* permissionClient() { return nullptr; }
713 713
714 714
715 // Background Sync API------------------------------------------------------ ------ 715 // Background Sync API------------------------------------------------------ ------
716 716
717 virtual WebSyncProvider* backgroundSyncProvider() { return 0; } 717 virtual WebSyncProvider* backgroundSyncProvider() { return nullptr; }
718 718
719 protected: 719 protected:
720 BLINK_PLATFORM_EXPORT Platform(); 720 BLINK_PLATFORM_EXPORT Platform();
721 virtual ~Platform() { } 721 virtual ~Platform() { }
722 722
723 WebThread* m_mainThread; 723 WebThread* m_mainThread;
724 }; 724 };
725 725
726 } // namespace blink 726 } // namespace blink
727 727
728 #endif 728 #endif
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebCompositorSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698