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

Side by Side Diff: content/renderer/pepper/v8_var_converter.cc

Issue 18599005: [PPAPI] Added PP_VARTYPE_RESOURCE as a PP_VarType enum value. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unittest_utils comparison of resource vars. Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/pepper/v8_var_converter.h" 5 #include "content/renderer/pepper/v8_var_converter.h"
6 6
7 #include <map> 7 #include <map>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 v8::Local<v8::Value>::New(host_buffer->webkit_buffer().toV8Value()); 141 v8::Local<v8::Value>::New(host_buffer->webkit_buffer().toV8Value());
142 break; 142 break;
143 } 143 }
144 case PP_VARTYPE_ARRAY: 144 case PP_VARTYPE_ARRAY:
145 *result = v8::Array::New(); 145 *result = v8::Array::New();
146 break; 146 break;
147 case PP_VARTYPE_DICTIONARY: 147 case PP_VARTYPE_DICTIONARY:
148 *result = v8::Object::New(); 148 *result = v8::Object::New();
149 break; 149 break;
150 case PP_VARTYPE_OBJECT: 150 case PP_VARTYPE_OBJECT:
151 case PP_VARTYPE_RESOURCE:
152 // TODO(mgiuca): Convert PP_VARTYPE_RESOURCE vars into the correct V8
153 // type. (http://crbug.com/177017)
151 NOTREACHED(); 154 NOTREACHED();
152 result->Clear(); 155 result->Clear();
153 return false; 156 return false;
154 } 157 }
155 158
156 *did_create = true; 159 *did_create = true;
157 if (ppapi::VarTracker::IsVarTypeRefcounted(var.type)) 160 if (ppapi::VarTracker::IsVarTypeRefcounted(var.type))
158 (*visited_ids)[var.value.as_id] = *result; 161 (*visited_ids)[var.value.as_id] = *result;
159 return true; 162 return true;
160 } 163 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 bool success = dict_var->SetWithStringKey( 503 bool success = dict_var->SetWithStringKey(
501 std::string(*name_utf8, name_utf8.length()), child_var); 504 std::string(*name_utf8, name_utf8.length()), child_var);
502 DCHECK(success); 505 DCHECK(success);
503 } 506 }
504 } 507 }
505 } 508 }
506 resource_converter_->Flush(base::Bind(callback, root)); 509 resource_converter_->Flush(base::Bind(callback, root));
507 } 510 }
508 511
509 } // namespace content 512 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698