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

Side by Side Diff: extensions/browser/extension_function_dispatcher.cc

Issue 2034543002: Clear UIThreadExtensionFunction::render_frame_host_ when RFH is gone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_function_dispatcher.h" 5 #include "extensions/browser/extension_function_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 ExtensionAPI::GetSharedInstance(), browser_context_, callback)); 484 ExtensionAPI::GetSharedInstance(), browser_context_, callback));
485 if (!function.get()) 485 if (!function.get())
486 return; 486 return;
487 487
488 UIThreadExtensionFunction* function_ui = 488 UIThreadExtensionFunction* function_ui =
489 function->AsUIThreadExtensionFunction(); 489 function->AsUIThreadExtensionFunction();
490 if (!function_ui) { 490 if (!function_ui) {
491 NOTREACHED(); 491 NOTREACHED();
492 return; 492 return;
493 } 493 }
494 function_ui->SetRenderFrameHost(render_frame_host); 494 if (params.embedded_worker_id != -1) {
495 function_ui->set_is_from_service_worker(true);
496 } else {
497 function_ui->SetRenderFrameHost(render_frame_host);
498 }
495 function_ui->set_dispatcher(AsWeakPtr()); 499 function_ui->set_dispatcher(AsWeakPtr());
496 function_ui->set_browser_context(browser_context_); 500 function_ui->set_browser_context(browser_context_);
497 if (extension && 501 if (extension &&
498 ExtensionsBrowserClient::Get()->CanExtensionCrossIncognito( 502 ExtensionsBrowserClient::Get()->CanExtensionCrossIncognito(
499 extension, browser_context_)) { 503 extension, browser_context_)) {
500 function->set_include_incognito(true); 504 function->set_include_incognito(true);
501 } 505 }
502 506
503 if (!CheckPermissions(function.get(), params, callback)) 507 if (!CheckPermissions(function.get(), params, callback))
504 return; 508 return;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 // static 655 // static
652 void ExtensionFunctionDispatcher::SendAccessDenied( 656 void ExtensionFunctionDispatcher::SendAccessDenied(
653 const ExtensionFunction::ResponseCallback& callback, 657 const ExtensionFunction::ResponseCallback& callback,
654 functions::HistogramValue histogram_value) { 658 functions::HistogramValue histogram_value) {
655 base::ListValue empty_list; 659 base::ListValue empty_list;
656 callback.Run(ExtensionFunction::FAILED, empty_list, 660 callback.Run(ExtensionFunction::FAILED, empty_list,
657 "Access to extension API denied.", histogram_value); 661 "Access to extension API denied.", histogram_value);
658 } 662 }
659 663
660 } // namespace extensions 664 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698