| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/send_request_natives.h" | 5 #include "extensions/renderer/send_request_natives.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // See http://crbug.com/149880. The context menus APIs relies on this, but | 47 // See http://crbug.com/149880. The context menus APIs relies on this, but |
| 48 // we shouldn't really be doing it (e.g. for the sake of the storage API). | 48 // we shouldn't really be doing it (e.g. for the sake of the storage API). |
| 49 converter->SetFunctionAllowed(true); | 49 converter->SetFunctionAllowed(true); |
| 50 | 50 |
| 51 if (!preserve_null_in_objects) | 51 if (!preserve_null_in_objects) |
| 52 converter->SetStripNullFromObjects(true); | 52 converter->SetStripNullFromObjects(true); |
| 53 | 53 |
| 54 std::unique_ptr<base::Value> value_args( | 54 std::unique_ptr<base::Value> value_args( |
| 55 converter->FromV8Value(args[1], context()->v8_context())); | 55 converter->FromV8Value(args[1], context()->v8_context())); |
| 56 if (!value_args.get() || !value_args->IsType(base::Value::TYPE_LIST)) { | 56 if (!value_args.get() || !value_args->IsType(base::Value::Type::LIST)) { |
| 57 NOTREACHED() << "Unable to convert args passed to StartRequest"; | 57 NOTREACHED() << "Unable to convert args passed to StartRequest"; |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 | 60 |
| 61 if (request_sender_->StartRequest( | 61 if (request_sender_->StartRequest( |
| 62 context(), | 62 context(), |
| 63 name, | 63 name, |
| 64 request_id, | 64 request_id, |
| 65 has_callback, | 65 has_callback, |
| 66 for_io_thread, | 66 for_io_thread, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 78 CHECK(args[0]->IsObject()); | 78 CHECK(args[0]->IsObject()); |
| 79 v8::Local<v8::Context> v8_context = | 79 v8::Local<v8::Context> v8_context = |
| 80 v8::Local<v8::Object>::Cast(args[0])->CreationContext(); | 80 v8::Local<v8::Object>::Cast(args[0])->CreationContext(); |
| 81 if (ContextCanAccessObject(context()->v8_context(), v8_context->Global(), | 81 if (ContextCanAccessObject(context()->v8_context(), v8_context->Global(), |
| 82 false)) { | 82 false)) { |
| 83 args.GetReturnValue().Set(v8_context->Global()); | 83 args.GetReturnValue().Set(v8_context->Global()); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace extensions | 87 } // namespace extensions |
| OLD | NEW |