OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
30 #include "content/renderer/render_view_impl.h" | 30 #include "content/renderer/render_view_impl.h" |
31 #include "content/renderer/renderer_clipboard_client.h" | 31 #include "content/renderer/renderer_clipboard_client.h" |
32 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 32 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
33 #include "content/renderer/websharedworkerrepository_impl.h" | 33 #include "content/renderer/websharedworkerrepository_impl.h" |
34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
35 #include "ipc/ipc_sync_message_filter.h" | 35 #include "ipc/ipc_sync_message_filter.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" | |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
49 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { | 557 RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { |
559 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 558 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
560 switches::kDisableSharedWorkers)) { | 559 switches::kDisableSharedWorkers)) { |
561 return shared_worker_repository_.get(); | 560 return shared_worker_repository_.get(); |
562 } else { | 561 } else { |
563 return NULL; | 562 return NULL; |
564 } | 563 } |
565 } | 564 } |
566 | 565 |
567 WebKit::WebGraphicsContext3D* | 566 WebKit::WebGraphicsContext3D* |
568 RendererWebKitPlatformSupportImpl::createGraphicsContext3D() { | |
569 // The WebGraphicsContext3DInProcessImpl code path is used for | |
570 // layout tests (though not through this code) as well as for | |
571 // debugging and bringing up new ports. | |
572 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | |
573 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( | |
574 gfx::kNullPluginWindow, NULL); | |
575 } else { | |
576 #if defined(ENABLE_GPU) | |
577 return new WebGraphicsContext3DCommandBufferImpl(); | |
578 #else | |
579 return NULL; | |
580 #endif | |
581 } | |
582 } | |
583 | |
584 WebKit::WebGraphicsContext3D* | |
585 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | 567 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
586 const WebGraphicsContext3D::Attributes& attributes) { | 568 const WebGraphicsContext3D::Attributes& attributes) { |
587 // The WebGraphicsContext3DInProcessImpl code path is used for | 569 // The WebGraphicsContext3DInProcessImpl code path is used for |
588 // layout tests (though not through this code) as well as for | 570 // layout tests (though not through this code) as well as for |
589 // debugging and bringing up new ports. | 571 // debugging and bringing up new ports. |
590 scoped_ptr<WebGraphicsContext3D> context; | |
591 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 572 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
592 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 573 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
593 gfx::kNullPluginWindow, NULL)); | 574 attributes, NULL, false); |
594 } else { | 575 } else { |
595 #if defined(ENABLE_GPU) | 576 scoped_ptr<WebGraphicsContext3D> context; |
596 context.reset(new WebGraphicsContext3DCommandBufferImpl()); | 577 context.reset(new WebGraphicsContext3DCommandBufferImpl()); |
597 #else | 578 if (!context->initialize(attributes, NULL, false)) |
598 return NULL; | 579 return NULL; |
599 #endif | 580 return context.release(); |
600 } | 581 } |
601 if (!context->initialize(attributes, NULL, false)) | |
602 return NULL; | |
603 return context.release(); | |
604 } | 582 } |
605 | 583 |
606 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { | 584 double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { |
607 return audio_hardware::GetOutputSampleRate(); | 585 return audio_hardware::GetOutputSampleRate(); |
608 } | 586 } |
609 | 587 |
610 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { | 588 size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { |
611 return audio_hardware::GetOutputBufferSize(); | 589 return audio_hardware::GetOutputBufferSize(); |
612 } | 590 } |
613 | 591 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( | 654 RendererWebKitPlatformSupportImpl::createPeerConnectionHandler( |
677 WebKit::WebPeerConnectionHandlerClient* client) { | 655 WebKit::WebPeerConnectionHandlerClient* client) { |
678 WebFrame* web_frame = WebFrame::frameForCurrentContext(); | 656 WebFrame* web_frame = WebFrame::frameForCurrentContext(); |
679 if (!web_frame) | 657 if (!web_frame) |
680 return NULL; | 658 return NULL; |
681 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 659 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
682 if (!render_view) | 660 if (!render_view) |
683 return NULL; | 661 return NULL; |
684 return render_view->CreatePeerConnectionHandler(client); | 662 return render_view->CreatePeerConnectionHandler(client); |
685 } | 663 } |
OLD | NEW |