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

Side by Side Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 8113035: Remove RenderProcessHost::is_extension_process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | content/app/content_main.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/extensions/extension_dispatcher.h" 5 #include "chrome/renderer/extensions/extension_dispatcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/child_process_logging.h" 8 #include "chrome/common/child_process_logging.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 23 matching lines...) Expand all
34 static const int64 kMaxExtensionIdleHandlerDelayS = 5*60 /* seconds */; 34 static const int64 kMaxExtensionIdleHandlerDelayS = 5*60 /* seconds */;
35 } 35 }
36 36
37 using WebKit::WebDataSource; 37 using WebKit::WebDataSource;
38 using WebKit::WebFrame; 38 using WebKit::WebFrame;
39 using WebKit::WebSecurityPolicy; 39 using WebKit::WebSecurityPolicy;
40 using WebKit::WebString; 40 using WebKit::WebString;
41 41
42 ExtensionDispatcher::ExtensionDispatcher() 42 ExtensionDispatcher::ExtensionDispatcher()
43 : is_webkit_initialized_(false) { 43 : is_webkit_initialized_(false) {
44 std::string type_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 44 is_extension_process_ =
45 switches::kProcessType); 45 CommandLine::ForCurrentProcess()->HasSwitch(switches::kExtensionProcess);
46 is_extension_process_ = type_str == switches::kExtensionProcess ||
47 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); 46 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
Mihai Parparita -not on Chrome 2011/10/04 22:24:14 This line is now a no-op, since you removed the ||
jochen (gone - plz use gerrit) 2011/10/05 07:43:46 Done.
48 47
49 if (is_extension_process_) { 48 if (is_extension_process_) {
50 RenderThread::current()->set_idle_notification_delay_in_s( 49 RenderThread::current()->set_idle_notification_delay_in_s(
51 kInitialExtensionIdleHandlerDelayS); 50 kInitialExtensionIdleHandlerDelayS);
52 } 51 }
53 52
54 user_script_slave_.reset(new UserScriptSlave(&extensions_)); 53 user_script_slave_.reset(new UserScriptSlave(&extensions_));
55 } 54 }
56 55
57 ExtensionDispatcher::~ExtensionDispatcher() { 56 ExtensionDispatcher::~ExtensionDispatcher() {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 child_process_logging::SetActiveExtensions(active_extensions); 338 child_process_logging::SetActiveExtensions(active_extensions);
340 } 339 }
341 340
342 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension, 341 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension,
343 bool restrict_to_extensions) { 342 bool restrict_to_extensions) {
344 if (restrict_to_extensions) 343 if (restrict_to_extensions)
345 restricted_v8_extensions_.insert(extension->name()); 344 restricted_v8_extensions_.insert(extension->name());
346 345
347 RenderThread::current()->RegisterExtension(extension); 346 RenderThread::current()->RegisterExtension(extension);
348 } 347 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | content/app/content_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698