| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 args.GetIsolate()->ThrowException(v8::Exception::TypeError( | 929 args.GetIsolate()->ThrowException(v8::Exception::TypeError( |
| 930 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidAudioParams))); | 930 v8::String::NewFromUtf8(args.GetIsolate(), kInvalidAudioParams))); |
| 931 return; | 931 return; |
| 932 } | 932 } |
| 933 | 933 |
| 934 std::unique_ptr<base::DictionaryValue> options; | 934 std::unique_ptr<base::DictionaryValue> options; |
| 935 if (args.Length() >= 9) { | 935 if (args.Length() >= 9) { |
| 936 std::unique_ptr<V8ValueConverter> converter(V8ValueConverter::create()); | 936 std::unique_ptr<V8ValueConverter> converter(V8ValueConverter::create()); |
| 937 std::unique_ptr<base::Value> options_value( | 937 std::unique_ptr<base::Value> options_value( |
| 938 converter->FromV8Value(args[8], context()->v8_context())); | 938 converter->FromV8Value(args[8], context()->v8_context())); |
| 939 if (!options_value->IsType(base::Value::TYPE_NULL)) { | 939 if (!options_value->IsType(base::Value::Type::NONE)) { |
| 940 options = base::DictionaryValue::From(std::move(options_value)); | 940 options = base::DictionaryValue::From(std::move(options_value)); |
| 941 if (!options) { | 941 if (!options) { |
| 942 args.GetIsolate()->ThrowException(v8::Exception::TypeError( | 942 args.GetIsolate()->ThrowException(v8::Exception::TypeError( |
| 943 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertArgs))); | 943 v8::String::NewFromUtf8(args.GetIsolate(), kUnableToConvertArgs))); |
| 944 return; | 944 return; |
| 945 } | 945 } |
| 946 } | 946 } |
| 947 } | 947 } |
| 948 | 948 |
| 949 if (!options) { | 949 if (!options) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 LOG(ERROR) << "Failed to add Cast audio track to media stream."; | 994 LOG(ERROR) << "Failed to add Cast audio track to media stream."; |
| 995 } | 995 } |
| 996 if (!content::AddVideoTrackToMediaStream(std::move(video), true, // is_remote | 996 if (!content::AddVideoTrackToMediaStream(std::move(video), true, // is_remote |
| 997 true, // is_readonly | 997 true, // is_readonly |
| 998 &web_stream)) { | 998 &web_stream)) { |
| 999 LOG(ERROR) << "Failed to add Cast video track to media stream."; | 999 LOG(ERROR) << "Failed to add Cast video track to media stream."; |
| 1000 } | 1000 } |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 } // namespace extensions | 1003 } // namespace extensions |
| OLD | NEW |