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

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

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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) 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } else if (val->IsInt32()) { 199 } else if (val->IsInt32()) {
200 *result = PP_MakeInt32(val->ToInt32()->Value()); 200 *result = PP_MakeInt32(val->ToInt32()->Value());
201 } else if (val->IsNumber() || val->IsNumberObject()) { 201 } else if (val->IsNumber() || val->IsNumberObject()) {
202 *result = PP_MakeDouble(val->ToNumber()->Value()); 202 *result = PP_MakeDouble(val->ToNumber()->Value());
203 } else if (val->IsString() || val->IsStringObject()) { 203 } else if (val->IsString() || val->IsStringObject()) {
204 v8::String::Utf8Value utf8(val->ToString()); 204 v8::String::Utf8Value utf8(val->ToString());
205 *result = StringVar::StringToPPVar(std::string(*utf8, utf8.length())); 205 *result = StringVar::StringToPPVar(std::string(*utf8, utf8.length()));
206 } else if (val->IsArray()) { 206 } else if (val->IsArray()) {
207 *result = (new ArrayVar())->GetPPVar(); 207 *result = (new ArrayVar())->GetPPVar();
208 } else if (val->IsObject()) { 208 } else if (val->IsObject()) {
209 scoped_ptr<WebKit::WebArrayBuffer> web_array_buffer( 209 scoped_ptr<blink::WebArrayBuffer> web_array_buffer(
210 WebKit::WebArrayBuffer::createFromV8Value(val)); 210 blink::WebArrayBuffer::createFromV8Value(val));
211 if (web_array_buffer.get()) { 211 if (web_array_buffer.get()) {
212 scoped_refptr<HostArrayBufferVar> buffer_var(new HostArrayBufferVar( 212 scoped_refptr<HostArrayBufferVar> buffer_var(new HostArrayBufferVar(
213 *web_array_buffer)); 213 *web_array_buffer));
214 *result = buffer_var->GetPPVar(); 214 *result = buffer_var->GetPPVar();
215 } else { 215 } else {
216 bool was_resource; 216 bool was_resource;
217 if (!resource_converter->FromV8Value(val->ToObject(), context, result, 217 if (!resource_converter->FromV8Value(val->ToObject(), context, result,
218 &was_resource)) 218 &was_resource))
219 return false; 219 return false;
220 if (!was_resource) { 220 if (!was_resource) {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 bool success = dict_var->SetWithStringKey( 507 bool success = dict_var->SetWithStringKey(
508 std::string(*name_utf8, name_utf8.length()), child_var); 508 std::string(*name_utf8, name_utf8.length()), child_var);
509 DCHECK(success); 509 DCHECK(success);
510 } 510 }
511 } 511 }
512 } 512 }
513 resource_converter_->Flush(base::Bind(callback, root)); 513 resource_converter_->Flush(base::Bind(callback, root));
514 } 514 }
515 515
516 } // namespace content 516 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/usb_key_code_conversion_win.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698