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

Side by Side Diff: ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: David's comments Created 8 years, 4 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 | « ipc/ipc_message_utils.cc ('k') | sync/internal_api/sync_manager_impl.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 "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" 5 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/shared_impl/ppapi_globals.h" 8 #include "ppapi/shared_impl/ppapi_globals.h"
9 #include "ppapi/shared_impl/var.h" 9 #include "ppapi/shared_impl/var.h"
10 #include "ppapi/shared_impl/var_tracker.h" 10 #include "ppapi/shared_impl/var_tracker.h"
(...skipping 12 matching lines...) Expand all
23 PP_X509Certificate_Private_Field field, 23 PP_X509Certificate_Private_Field field,
24 base::Value* value) { 24 base::Value* value) {
25 uint32_t index = static_cast<uint32_t>(field); 25 uint32_t index = static_cast<uint32_t>(field);
26 bool success = values_.Set(index, value); 26 bool success = values_.Set(index, value);
27 DCHECK(success); 27 DCHECK(success);
28 } 28 }
29 29
30 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( 30 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar(
31 PP_X509Certificate_Private_Field field) const { 31 PP_X509Certificate_Private_Field field) const {
32 uint32_t index = static_cast<uint32_t>(field); 32 uint32_t index = static_cast<uint32_t>(field);
33 base::Value* value; 33 const base::Value* value;
34 bool success = values_.Get(index, &value); 34 bool success = values_.Get(index, &value);
35 if (!success) { 35 if (!success) {
36 // Our list received might be smaller than the number of fields, so just 36 // Our list received might be smaller than the number of fields, so just
37 // return null if the index is OOB. 37 // return null if the index is OOB.
38 return PP_MakeNull(); 38 return PP_MakeNull();
39 } 39 }
40 40
41 switch (value->GetType()) { 41 switch (value->GetType()) {
42 case Value::TYPE_NULL: 42 case Value::TYPE_NULL:
43 return PP_MakeNull(); 43 return PP_MakeNull();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 const std::vector<char>& der, 137 const std::vector<char>& der,
138 PPB_X509Certificate_Fields* result) { 138 PPB_X509Certificate_Fields* result) {
139 // A concrete PPB_X509Certificate_Private_Shared should only ever be 139 // A concrete PPB_X509Certificate_Private_Shared should only ever be
140 // constructed by passing in PPB_X509Certificate_Fields, in which case it is 140 // constructed by passing in PPB_X509Certificate_Fields, in which case it is
141 // already initialized. 141 // already initialized.
142 CHECK(false); 142 CHECK(false);
143 return false; 143 return false;
144 } 144 }
145 145
146 } // namespace ppapi 146 } // namespace ppapi
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | sync/internal_api/sync_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698