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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: comments addressed Created 3 years, 9 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/renderer/dispatcher.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | 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/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 void Dispatcher::RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) { 600 void Dispatcher::RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) {
601 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame); 601 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame);
602 if (!frame_helper) 602 if (!frame_helper)
603 return; // The frame is invisible to extensions. 603 return; // The frame is invisible to extensions.
604 604
605 frame_helper->RunScriptsAtDocumentEnd(); 605 frame_helper->RunScriptsAtDocumentEnd();
606 // |frame_helper| and |render_frame| might be dead by now. 606 // |frame_helper| and |render_frame| might be dead by now.
607 } 607 }
608 608
609 void Dispatcher::RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) {
610 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame);
611 if (!frame_helper)
612 return; // The frame is invisible to extensions.
613
614 frame_helper->RunScriptsAtDocumentIdle();
615 // |frame_helper| and |render_frame| might be dead by now.
616 }
617
609 void Dispatcher::OnExtensionResponse(int request_id, 618 void Dispatcher::OnExtensionResponse(int request_id,
610 bool success, 619 bool success,
611 const base::ListValue& response, 620 const base::ListValue& response,
612 const std::string& error) { 621 const std::string& error) {
613 bindings_system_->HandleResponse(request_id, success, response, error); 622 bindings_system_->HandleResponse(request_id, success, response, error);
614 } 623 }
615 624
616 void Dispatcher::DispatchEvent( 625 void Dispatcher::DispatchEvent(
617 const std::string& extension_id, 626 const std::string& extension_id,
618 const std::string& event_name, 627 const std::string& event_name,
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 // The "guestViewDeny" module must always be loaded last. It registers 1417 // The "guestViewDeny" module must always be loaded last. It registers
1409 // error-providing custom elements for the GuestView types that are not 1418 // error-providing custom elements for the GuestView types that are not
1410 // available, and thus all of those types must have been checked and loaded 1419 // available, and thus all of those types must have been checked and loaded
1411 // (or not loaded) beforehand. 1420 // (or not loaded) beforehand.
1412 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1421 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1413 module_system->Require("guestViewDeny"); 1422 module_system->Require("guestViewDeny");
1414 } 1423 }
1415 } 1424 }
1416 1425
1417 } // namespace extensions 1426 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698