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

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

Issue 1244243003: Revert of Call EnsureWebKitInitialized() before registering extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « content/renderer/render_thread_impl.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/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 *(base::CommandLine::ForCurrentProcess()); 192 *(base::CommandLine::ForCurrentProcess());
193 set_idle_notifications_ = 193 set_idle_notifications_ =
194 command_line.HasSwitch(switches::kExtensionProcess) || 194 command_line.HasSwitch(switches::kExtensionProcess) ||
195 command_line.HasSwitch(::switches::kSingleProcess); 195 command_line.HasSwitch(::switches::kSingleProcess);
196 196
197 if (set_idle_notifications_) { 197 if (set_idle_notifications_) {
198 RenderThread::Get()->SetIdleNotificationDelayInMs( 198 RenderThread::Get()->SetIdleNotificationDelayInMs(
199 kInitialExtensionIdleHandlerDelayMs); 199 kInitialExtensionIdleHandlerDelayMs);
200 } 200 }
201 201
202 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension());
203
202 script_context_set_.reset( 204 script_context_set_.reset(
203 new ScriptContextSet(&extensions_, &active_extension_ids_)); 205 new ScriptContextSet(&extensions_, &active_extension_ids_));
204 user_script_set_manager_.reset(new UserScriptSetManager(&extensions_)); 206 user_script_set_manager_.reset(new UserScriptSetManager(&extensions_));
205 script_injection_manager_.reset( 207 script_injection_manager_.reset(
206 new ScriptInjectionManager(&extensions_, user_script_set_manager_.get())); 208 new ScriptInjectionManager(&extensions_, user_script_set_manager_.get()));
207 user_script_set_manager_observer_.Add(user_script_set_manager_.get()); 209 user_script_set_manager_observer_.Add(user_script_set_manager_.get());
208 request_sender_.reset(new RequestSender(this)); 210 request_sender_.reset(new RequestSender(this));
209 PopulateSourceMap(); 211 PopulateSourceMap();
210 } 212 }
211 213
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages, 737 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages,
736 content_watcher_.get(), 738 content_watcher_.get(),
737 ContentWatcher::OnWatchPages) 739 ContentWatcher::OnWatchPages)
738 IPC_MESSAGE_UNHANDLED(handled = false) 740 IPC_MESSAGE_UNHANDLED(handled = false)
739 IPC_END_MESSAGE_MAP() 741 IPC_END_MESSAGE_MAP()
740 742
741 return handled; 743 return handled;
742 } 744 }
743 745
744 void Dispatcher::WebKitInitialized() { 746 void Dispatcher::WebKitInitialized() {
745 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension());
746
747 // For extensions, we want to ensure we call the IdleHandler every so often, 747 // For extensions, we want to ensure we call the IdleHandler every so often,
748 // even if the extension keeps up activity. 748 // even if the extension keeps up activity.
749 if (set_idle_notifications_) { 749 if (set_idle_notifications_) {
750 forced_idle_timer_.reset(new base::RepeatingTimer<content::RenderThread>); 750 forced_idle_timer_.reset(new base::RepeatingTimer<content::RenderThread>);
751 forced_idle_timer_->Start( 751 forced_idle_timer_->Start(
752 FROM_HERE, 752 FROM_HERE,
753 base::TimeDelta::FromMilliseconds(kMaxExtensionIdleHandlerDelayMs), 753 base::TimeDelta::FromMilliseconds(kMaxExtensionIdleHandlerDelayMs),
754 RenderThread::Get(), 754 RenderThread::Get(),
755 &RenderThread::IdleHandler); 755 &RenderThread::IdleHandler);
756 } 756 }
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // The "guestViewDeny" module must always be loaded last. It registers 1442 // The "guestViewDeny" module must always be loaded last. It registers
1443 // error-providing custom elements for the GuestView types that are not 1443 // error-providing custom elements for the GuestView types that are not
1444 // available, and thus all of those types must have been checked and loaded 1444 // available, and thus all of those types must have been checked and loaded
1445 // (or not loaded) beforehand. 1445 // (or not loaded) beforehand.
1446 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1446 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1447 module_system->Require("guestViewDeny"); 1447 module_system->Require("guestViewDeny");
1448 } 1448 }
1449 } 1449 }
1450 1450
1451 } // namespace extensions 1451 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698