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

Unified Diff: extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc

Issue 2017113002: [Extensions] DCHECK that ExtensionFunctions respond (and only once) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc
diff --git a/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc b/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc
index 0f15d9acceacb87c1ed1788accdb1546574f7966..42ea3122b0f94a1e3948cf0aae6965e7ecccb498 100644
--- a/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc
+++ b/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc
@@ -16,7 +16,8 @@ AppViewGuestInternalAttachFrameFunction::
AppViewGuestInternalAttachFrameFunction() {
}
-bool AppViewGuestInternalAttachFrameFunction::RunAsync() {
+ExtensionFunction::ResponseAction
+AppViewGuestInternalAttachFrameFunction::Run() {
std::unique_ptr<appview::AttachFrame::Params> params(
appview::AttachFrame::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
@@ -24,25 +25,38 @@ bool AppViewGuestInternalAttachFrameFunction::RunAsync() {
GURL url = extension()->GetResourceURL(params->url);
EXTENSION_FUNCTION_VALIDATE(url.is_valid());
- return AppViewGuest::CompletePendingRequest(
- browser_context(), url, params->guest_instance_id, extension_id(),
- render_frame_host()->GetProcess());
+ ResponseValue response;
+ if (AppViewGuest::CompletePendingRequest(
+ browser_context(), url, params->guest_instance_id, extension_id(),
+ render_frame_host()->GetProcess())) {
+ response = NoArguments();
+ } else {
+ response = Error("could not complete");
+ }
+ return RespondNow(std::move(response));
}
AppViewGuestInternalDenyRequestFunction::
AppViewGuestInternalDenyRequestFunction() {
}
-bool AppViewGuestInternalDenyRequestFunction::RunAsync() {
+ExtensionFunction::ResponseAction
+AppViewGuestInternalDenyRequestFunction::Run() {
std::unique_ptr<appview::DenyRequest::Params> params(
appview::DenyRequest::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
// Since the URL passed into AppViewGuest:::CompletePendingRequest is invalid,
// a new <appview> WebContents will not be created.
- return AppViewGuest::CompletePendingRequest(
- browser_context(), GURL(), params->guest_instance_id, extension_id(),
- render_frame_host()->GetProcess());
+ ResponseValue response;
+ if (AppViewGuest::CompletePendingRequest(
+ browser_context(), GURL(), params->guest_instance_id, extension_id(),
+ render_frame_host()->GetProcess())) {
+ response = NoArguments();
+ } else {
+ response = Error("could not complete");
+ }
+ return RespondNow(std::move(response));
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698