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

Unified Diff: extensions/renderer/send_request_natives.cc

Issue 235943018: Move extensions bindings code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/send_request_natives.h ('k') | extensions/renderer/set_icon_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/send_request_natives.cc
diff --git a/chrome/renderer/extensions/send_request_natives.cc b/extensions/renderer/send_request_natives.cc
similarity index 73%
rename from chrome/renderer/extensions/send_request_natives.cc
rename to extensions/renderer/send_request_natives.cc
index 5a7c46b14b8a846b39f19c5a1bec34b2b532339f..face9421e2c24bcbf168f6ea66d01e9081af0e69 100644
--- a/chrome/renderer/extensions/send_request_natives.cc
+++ b/extensions/renderer/send_request_natives.cc
@@ -2,36 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/extensions/send_request_natives.h"
+#include "extensions/renderer/send_request_natives.h"
#include "base/json/json_reader.h"
#include "content/public/renderer/v8_value_converter.h"
#include "extensions/renderer/request_sender.h"
+#include "extensions/renderer/script_context.h"
using content::V8ValueConverter;
namespace extensions {
-SendRequestNatives::SendRequestNatives(Dispatcher* dispatcher,
- RequestSender* request_sender,
- ChromeV8Context* context)
- : ChromeV8Extension(dispatcher, context),
- request_sender_(request_sender) {
+SendRequestNatives::SendRequestNatives(RequestSender* request_sender,
+ ScriptContext* context)
+ : ObjectBackedNativeHandler(context), request_sender_(request_sender) {
RouteFunction("GetNextRequestId",
base::Bind(&SendRequestNatives::GetNextRequestId,
base::Unretained(this)));
- RouteFunction("StartRequest",
- base::Bind(&SendRequestNatives::StartRequest,
- base::Unretained(this)));
- RouteFunction("GetGlobal",
- base::Bind(&SendRequestNatives::GetGlobal,
- base::Unretained(this)));
+ RouteFunction(
+ "StartRequest",
+ base::Bind(&SendRequestNatives::StartRequest, base::Unretained(this)));
+ RouteFunction(
+ "GetGlobal",
+ base::Bind(&SendRequestNatives::GetGlobal, base::Unretained(this)));
}
void SendRequestNatives::GetNextRequestId(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- args.GetReturnValue().Set(static_cast<int32_t>(
- request_sender_->GetNextRequestId()));
+ args.GetReturnValue().Set(
+ static_cast<int32_t>(request_sender_->GetNextRequestId()));
}
// Starts an API request to the browser, with an optional callback. The
@@ -62,7 +61,11 @@ void SendRequestNatives::StartRequest(
}
request_sender_->StartRequest(
- context(), name, request_id, has_callback, for_io_thread,
+ context(),
+ name,
+ request_id,
+ has_callback,
+ for_io_thread,
static_cast<base::ListValue*>(value_args.get()));
}
« no previous file with comments | « extensions/renderer/send_request_natives.h ('k') | extensions/renderer/set_icon_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698