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

Side by Side Diff: chrome/renderer/webplugin_delegate_pepper.cc

Issue 2881014: Coverity: Fix missing const on WebPluginDelegatePepper::Device3DCreateContext override arg. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 5 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 | « chrome/renderer/webplugin_delegate_pepper.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #define PEPPER_APIS_ENABLED 1 5 #define PEPPER_APIS_ENABLED 1
6 6
7 #include "chrome/renderer/webplugin_delegate_pepper.h" 7 #include "chrome/renderer/webplugin_delegate_pepper.h"
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 return NPERR_GENERIC_ERROR; 916 return NPERR_GENERIC_ERROR;
917 } 917 }
918 } 918 }
919 } 919 }
920 920
921 return NPERR_NO_ERROR; 921 return NPERR_NO_ERROR;
922 } 922 }
923 923
924 NPError WebPluginDelegatePepper::Device3DCreateContext( 924 NPError WebPluginDelegatePepper::Device3DCreateContext(
925 int32 config, 925 int32 config,
926 int32* attrib_list, 926 const int32* attrib_list,
927 NPDeviceContext3D** context) { 927 NPDeviceContext3D** context) {
928 if (!context) 928 if (!context)
929 return NPERR_GENERIC_ERROR; 929 return NPERR_GENERIC_ERROR;
930 930
931 // Only one config available currently. 931 // Only one config available currently.
932 if (config != 0) 932 if (config != 0)
933 return NPERR_GENERIC_ERROR; 933 return NPERR_GENERIC_ERROR;
934 934
935 // For now, just use the old API to initialize the context. 935 // For now, just use the old API to initialize the context.
936 NPDeviceContext3DConfig old_config; 936 NPDeviceContext3DConfig old_config;
937 old_config.commandBufferSize = kDefaultCommandBufferSize; 937 old_config.commandBufferSize = kDefaultCommandBufferSize;
938 if (attrib_list) { 938 if (attrib_list) {
939 for (int32* attrib_pair = attrib_list; *attrib_pair; attrib_pair += 2) { 939 for (const int32* attrib_pair = attrib_list; *attrib_pair;
940 attrib_pair += 2) {
940 switch (attrib_pair[0]) { 941 switch (attrib_pair[0]) {
941 case NP3DAttrib_CommandBufferSize: 942 case NP3DAttrib_CommandBufferSize:
942 old_config.commandBufferSize = attrib_pair[1]; 943 old_config.commandBufferSize = attrib_pair[1];
943 break; 944 break;
944 default: 945 default:
945 return NPERR_GENERIC_ERROR; 946 return NPERR_GENERIC_ERROR;
946 } 947 }
947 } 948 }
948 } 949 }
949 950
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 CGRect bounds; 1749 CGRect bounds;
1749 bounds.origin.x = dest_rect.x(); 1750 bounds.origin.x = dest_rect.x();
1750 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height(); 1751 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height();
1751 bounds.size.width = dest_rect.width(); 1752 bounds.size.width = dest_rect.width();
1752 bounds.size.height = dest_rect.height(); 1753 bounds.size.height = dest_rect.height();
1753 1754
1754 CGContextDrawImage(canvas, bounds, image); 1755 CGContextDrawImage(canvas, bounds, image);
1755 CGContextRestoreGState(canvas); 1756 CGContextRestoreGState(canvas);
1756 } 1757 }
1757 #endif // defined(OS_MACOSX) 1758 #endif // defined(OS_MACOSX)
1758
OLDNEW
« no previous file with comments | « chrome/renderer/webplugin_delegate_pepper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698