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

Side by Side Diff: extensions/renderer/send_request_natives.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « extensions/renderer/event_bindings.cc ('k') | extensions/utility/unpacker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/renderer/event_bindings.cc ('k') | extensions/utility/unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698