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

Unified Diff: components/guest_view/renderer/guest_view_request.cc

Issue 1560553002: Framelet Prototype 2016 Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + Applied Brett's Windows + Fixed security issue Created 4 years, 11 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
Index: components/guest_view/renderer/guest_view_request.cc
diff --git a/components/guest_view/renderer/guest_view_request.cc b/components/guest_view/renderer/guest_view_request.cc
index 45edac41c10b009c4dca3f3489f7440bfce8b359..a79cc9719890a2bcd4a77685b203a4eb8c32d0bd 100644
--- a/components/guest_view/renderer/guest_view_request.cc
+++ b/components/guest_view/renderer/guest_view_request.cc
@@ -17,18 +17,22 @@
namespace guest_view {
-GuestViewRequest::GuestViewRequest(GuestViewContainer* container,
- v8::Local<v8::Function> callback,
- v8::Isolate* isolate)
- : container_(container),
+GuestViewRequest::GuestViewRequest(GuestViewContainer* container)
+ : container_(container) {}
+
+GuestViewRequest::~GuestViewRequest() {}
+
+GuestViewJavaScriptRequest::GuestViewJavaScriptRequest(
+ GuestViewContainer* container,
+ v8::Local<v8::Function> callback,
+ v8::Isolate* isolate)
+ : GuestViewRequest(container),
callback_(isolate, callback),
- isolate_(isolate) {
-}
+ isolate_(isolate) {}
-GuestViewRequest::~GuestViewRequest() {
-}
+GuestViewJavaScriptRequest::~GuestViewJavaScriptRequest() {}
-void GuestViewRequest::ExecuteCallbackIfAvailable(
+void GuestViewJavaScriptRequest::ExecuteCallbackIfAvailable(
int argc,
scoped_ptr<v8::Local<v8::Value>[]> argv) {
if (callback_.IsEmpty())
@@ -47,13 +51,17 @@ void GuestViewRequest::ExecuteCallbackIfAvailable(
callback->Call(context->Global(), argc, argv.get());
}
+void GuestViewJavaScriptRequest::HandleDefaultResponse() {
+ ExecuteCallbackIfAvailable(0 /* argc */, nullptr);
+}
+
GuestViewAttachRequest::GuestViewAttachRequest(
GuestViewContainer* container,
int guest_instance_id,
scoped_ptr<base::DictionaryValue> params,
v8::Local<v8::Function> callback,
v8::Isolate* isolate)
- : GuestViewRequest(container, callback, isolate),
+ : GuestViewJavaScriptRequest(container, callback, isolate),
guest_instance_id_(guest_instance_id),
params_(std::move(params)) {}
@@ -109,12 +117,10 @@ void GuestViewAttachRequest::HandleResponse(const IPC::Message& message) {
ExecuteCallbackIfAvailable(argc, std::move(argv));
}
-GuestViewDetachRequest::GuestViewDetachRequest(
- GuestViewContainer* container,
- v8::Local<v8::Function> callback,
- v8::Isolate* isolate)
- : GuestViewRequest(container, callback, isolate) {
-}
+GuestViewDetachRequest::GuestViewDetachRequest(GuestViewContainer* container,
+ v8::Local<v8::Function> callback,
+ v8::Isolate* isolate)
+ : GuestViewJavaScriptRequest(container, callback, isolate) {}
GuestViewDetachRequest::~GuestViewDetachRequest() {
}
« no previous file with comments | « components/guest_view/renderer/guest_view_request.h ('k') | components/guest_view/renderer/iframe_guest_view_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698