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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: gles2impl-tests Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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 1031 bool lose_context_when_out_of_memory = false;
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,
1035 GURL(attributes.topDocumentURL), 1036 GURL(attributes.topDocumentURL),
1036 limits, 1037 limits,
1037 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); 1038 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context));
1038 } 1039 }
1039 1040
1040 //------------------------------------------------------------------------------ 1041 //------------------------------------------------------------------------------
1041 1042
1042 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: 1043 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl::
1043 createSharedOffscreenGraphicsContext3DProvider() { 1044 createSharedOffscreenGraphicsContext3DProvider() {
1044 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = 1045 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider =
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 return; 1186 return;
1186 QuotaDispatcher::ThreadSpecificInstance( 1187 QuotaDispatcher::ThreadSpecificInstance(
1187 thread_safe_sender_.get(), 1188 thread_safe_sender_.get(),
1188 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1189 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1189 storage_partition, 1190 storage_partition,
1190 static_cast<quota::StorageType>(type), 1191 static_cast<quota::StorageType>(type),
1191 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1192 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1192 } 1193 }
1193 1194
1194 } // namespace content 1195 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698