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

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

Issue 98543004: Remove usage of deprecated V8 APIs from c/r/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/send_request_natives.h" 5 #include "chrome/renderer/extensions/send_request_natives.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "content/public/renderer/v8_value_converter.h" 8 #include "content/public/renderer/v8_value_converter.h"
9 #include "chrome/renderer/extensions/request_sender.h" 9 #include "chrome/renderer/extensions/request_sender.h"
10 10
(...skipping 20 matching lines...) Expand all
31 void SendRequestNatives::GetNextRequestId( 31 void SendRequestNatives::GetNextRequestId(
32 const v8::FunctionCallbackInfo<v8::Value>& args) { 32 const v8::FunctionCallbackInfo<v8::Value>& args) {
33 args.GetReturnValue().Set(static_cast<int32_t>( 33 args.GetReturnValue().Set(static_cast<int32_t>(
34 request_sender_->GetNextRequestId())); 34 request_sender_->GetNextRequestId()));
35 } 35 }
36 36
37 // Starts an API request to the browser, with an optional callback. The 37 // Starts an API request to the browser, with an optional callback. The
38 // callback will be dispatched to EventBindings::HandleResponse. 38 // callback will be dispatched to EventBindings::HandleResponse.
39 void SendRequestNatives::StartRequest( 39 void SendRequestNatives::StartRequest(
40 const v8::FunctionCallbackInfo<v8::Value>& args) { 40 const v8::FunctionCallbackInfo<v8::Value>& args) {
41 std::string name = *v8::String::AsciiValue(args[0]); 41 std::string name = *v8::String::Utf8Value(args[0]);
42 int request_id = args[2]->Int32Value(); 42 int request_id = args[2]->Int32Value();
43 bool has_callback = args[3]->BooleanValue(); 43 bool has_callback = args[3]->BooleanValue();
44 bool for_io_thread = args[4]->BooleanValue(); 44 bool for_io_thread = args[4]->BooleanValue();
45 bool preserve_null_in_objects = args[5]->BooleanValue(); 45 bool preserve_null_in_objects = args[5]->BooleanValue();
46 46
47 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 47 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
48 48
49 // See http://crbug.com/149880. The context menus APIs relies on this, but 49 // See http://crbug.com/149880. The context menus APIs relies on this, but
50 // we shouldn't really be doing it (e.g. for the sake of the storage API). 50 // we shouldn't really be doing it (e.g. for the sake of the storage API).
51 converter->SetFunctionAllowed(true); 51 converter->SetFunctionAllowed(true);
(...skipping 15 matching lines...) Expand all
67 67
68 void SendRequestNatives::GetGlobal( 68 void SendRequestNatives::GetGlobal(
69 const v8::FunctionCallbackInfo<v8::Value>& args) { 69 const v8::FunctionCallbackInfo<v8::Value>& args) {
70 CHECK_EQ(1, args.Length()); 70 CHECK_EQ(1, args.Length());
71 CHECK(args[0]->IsObject()); 71 CHECK(args[0]->IsObject());
72 args.GetReturnValue().Set( 72 args.GetReturnValue().Set(
73 v8::Handle<v8::Object>::Cast(args[0])->CreationContext()->Global()); 73 v8::Handle<v8::Object>::Cast(args[0])->CreationContext()->Global());
74 } 74 }
75 75
76 } // namespace extensions 76 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/scoped_persistent.h ('k') | chrome/renderer/extensions/set_icon_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698