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

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: benchmark 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/test/test_context_provider_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 998
999 CommandLine* command_line = CommandLine::ForCurrentProcess(); 999 CommandLine* command_line = CommandLine::ForCurrentProcess();
1000 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) { 1000 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) {
1001 std::string size_string = command_line->GetSwitchValueASCII( 1001 std::string size_string = command_line->GetSwitchValueASCII(
1002 switches::kWebGLCommandBufferSizeKb); 1002 switches::kWebGLCommandBufferSizeKb);
1003 size_t buffer_size_kb; 1003 size_t buffer_size_kb;
1004 if (base::StringToSizeT(size_string, &buffer_size_kb)) { 1004 if (base::StringToSizeT(size_string, &buffer_size_kb)) {
1005 limits.command_buffer_size = buffer_size_kb * 1024; 1005 limits.command_buffer_size = buffer_size_kb * 1024;
1006 } 1006 }
1007 } 1007 }
1008 1008 bool lose_context_when_out_of_memory = false;
1009 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1009 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
1010 gpu_channel_host.get(), 1010 gpu_channel_host.get(),
1011 attributes, 1011 attributes,
1012 lose_context_when_out_of_memory,
1012 GURL(attributes.topDocumentURL), 1013 GURL(attributes.topDocumentURL),
1013 limits, 1014 limits,
1014 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); 1015 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context));
1015 } 1016 }
1016 1017
1017 //------------------------------------------------------------------------------ 1018 //------------------------------------------------------------------------------
1018 1019
1019 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: 1020 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl::
1020 createSharedOffscreenGraphicsContext3DProvider() { 1021 createSharedOffscreenGraphicsContext3DProvider() {
1021 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = 1022 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider =
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 return; 1163 return;
1163 QuotaDispatcher::ThreadSpecificInstance( 1164 QuotaDispatcher::ThreadSpecificInstance(
1164 thread_safe_sender_.get(), 1165 thread_safe_sender_.get(),
1165 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1166 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1166 storage_partition, 1167 storage_partition,
1167 static_cast<quota::StorageType>(type), 1168 static_cast<quota::StorageType>(type),
1168 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1169 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1169 } 1170 }
1170 1171
1171 } // namespace content 1172 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/test/test_context_provider_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698