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() { |
} |