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

Side by Side Diff: chrome/renderer/extensions/cast_streaming_native_handler.cc

Issue 116543010: Remove the Value class names from the global namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 12 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/renderer/extensions/cast_streaming_native_handler.h" 5 #include "chrome/renderer/extensions/cast_streaming_native_handler.h"
6 6
7 #include <functional> 7 #include <functional>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 CHECK_EQ(2, args.Length()); 255 CHECK_EQ(2, args.Length());
256 CHECK(args[0]->IsInt32()); 256 CHECK(args[0]->IsInt32());
257 CHECK(args[1]->IsObject()); 257 CHECK(args[1]->IsObject());
258 258
259 const int transport_id = args[0]->ToInt32()->Value(); 259 const int transport_id = args[0]->ToInt32()->Value();
260 CastRtpStream* transport = GetRtpStreamOrThrow(transport_id); 260 CastRtpStream* transport = GetRtpStreamOrThrow(transport_id);
261 if (!transport) 261 if (!transport)
262 return; 262 return;
263 263
264 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 264 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
265 scoped_ptr<Value> params_value( 265 scoped_ptr<base::Value> params_value(
266 converter->FromV8Value(args[1], context()->v8_context())); 266 converter->FromV8Value(args[1], context()->v8_context()));
267 if (!params_value) { 267 if (!params_value) {
268 args.GetIsolate()->ThrowException(v8::Exception::TypeError( 268 args.GetIsolate()->ThrowException(v8::Exception::TypeError(
269 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertParams))); 269 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertParams)));
270 return; 270 return;
271 } 271 }
272 scoped_ptr<RtpParams> params = RtpParams::FromValue(*params_value); 272 scoped_ptr<RtpParams> params = RtpParams::FromValue(*params_value);
273 if (!params) { 273 if (!params) {
274 args.GetIsolate()->ThrowException(v8::Exception::TypeError( 274 args.GetIsolate()->ThrowException(v8::Exception::TypeError(
275 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidRtpParams))); 275 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidRtpParams)));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 CHECK_EQ(2, args.Length()); 309 CHECK_EQ(2, args.Length());
310 CHECK(args[0]->IsInt32()); 310 CHECK(args[0]->IsInt32());
311 CHECK(args[1]->IsObject()); 311 CHECK(args[1]->IsObject());
312 312
313 const int transport_id = args[0]->ToInt32()->Value(); 313 const int transport_id = args[0]->ToInt32()->Value();
314 CastUdpTransport* transport = GetUdpTransportOrThrow(transport_id); 314 CastUdpTransport* transport = GetUdpTransportOrThrow(transport_id);
315 if (!transport) 315 if (!transport)
316 return; 316 return;
317 317
318 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 318 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
319 scoped_ptr<Value> udp_params_value( 319 scoped_ptr<base::Value> udp_params_value(
320 converter->FromV8Value(args[1], context()->v8_context())); 320 converter->FromV8Value(args[1], context()->v8_context()));
321 if (!udp_params_value) { 321 if (!udp_params_value) {
322 args.GetIsolate()->ThrowException(v8::Exception::TypeError( 322 args.GetIsolate()->ThrowException(v8::Exception::TypeError(
323 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertArgs))); 323 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertArgs)));
324 return; 324 return;
325 } 325 }
326 scoped_ptr<UdpParams> udp_params = UdpParams::FromValue(*udp_params_value); 326 scoped_ptr<UdpParams> udp_params = UdpParams::FromValue(*udp_params_value);
327 if (!udp_params) { 327 if (!udp_params) {
328 args.GetIsolate()->ThrowException(v8::Exception::TypeError( 328 args.GetIsolate()->ThrowException(v8::Exception::TypeError(
329 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidUdpParams))); 329 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidUdpParams)));
(...skipping 26 matching lines...) Expand all
356 transport_id); 356 transport_id);
357 if (iter != udp_transport_map_.end()) 357 if (iter != udp_transport_map_.end())
358 return iter->second.get(); 358 return iter->second.get();
359 v8::Isolate* isolate = context()->v8_context()->GetIsolate(); 359 v8::Isolate* isolate = context()->v8_context()->GetIsolate();
360 isolate->ThrowException(v8::Exception::RangeError( 360 isolate->ThrowException(v8::Exception::RangeError(
361 v8::String::NewFromUtf8(isolate, kUdpTransportNotFound))); 361 v8::String::NewFromUtf8(isolate, kUdpTransportNotFound)));
362 return NULL; 362 return NULL;
363 } 363 }
364 364
365 } // namespace extensions 365 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_hash_store_impl_unittest.cc ('k') | content/renderer/v8_value_converter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698