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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 | 1021 |
1022 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1022 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1023 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) { | 1023 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) { |
1024 std::string size_string = command_line->GetSwitchValueASCII( | 1024 std::string size_string = command_line->GetSwitchValueASCII( |
1025 switches::kWebGLCommandBufferSizeKb); | 1025 switches::kWebGLCommandBufferSizeKb); |
1026 size_t buffer_size_kb; | 1026 size_t buffer_size_kb; |
1027 if (base::StringToSizeT(size_string, &buffer_size_kb)) { | 1027 if (base::StringToSizeT(size_string, &buffer_size_kb)) { |
1028 limits.command_buffer_size = buffer_size_kb * 1024; | 1028 limits.command_buffer_size = buffer_size_kb * 1024; |
1029 } | 1029 } |
1030 } | 1030 } |
1031 bool lose_context_when_out_of_memory = false; | 1031 |
1032 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1032 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
1033 gpu_channel_host.get(), | 1033 gpu_channel_host.get(), |
1034 attributes, | 1034 attributes, |
1035 lose_context_when_out_of_memory, | |
1036 GURL(attributes.topDocumentURL), | 1035 GURL(attributes.topDocumentURL), |
1037 limits, | 1036 limits, |
1038 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); | 1037 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); |
1039 } | 1038 } |
1040 | 1039 |
1041 //------------------------------------------------------------------------------ | 1040 //------------------------------------------------------------------------------ |
1042 | 1041 |
1043 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: | 1042 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
1044 createSharedOffscreenGraphicsContext3DProvider() { | 1043 createSharedOffscreenGraphicsContext3DProvider() { |
1045 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = | 1044 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 return; | 1185 return; |
1187 QuotaDispatcher::ThreadSpecificInstance( | 1186 QuotaDispatcher::ThreadSpecificInstance( |
1188 thread_safe_sender_.get(), | 1187 thread_safe_sender_.get(), |
1189 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1188 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
1190 storage_partition, | 1189 storage_partition, |
1191 static_cast<quota::StorageType>(type), | 1190 static_cast<quota::StorageType>(type), |
1192 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1191 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1193 } | 1192 } |
1194 | 1193 |
1195 } // namespace content | 1194 } // namespace content |
OLD | NEW |