diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 20:25:18 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 20:25:18 +0000 |
commit | 4573fbd30d7ed70f959efb69b32ad9547465f0ce (patch) | |
tree | 958d424cf2dfa7b22aba942c8ebc383a5ba22517 | |
parent | 5262dc192af688c4f9301753fa7890975303b909 (diff) | |
download | chromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.zip chromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.tar.gz chromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.tar.bz2 |
Move content_restriction.h and main_function_params.h to content/public/common, and put them in the content namespace.
BUG=98716
Review URL: http://codereview.chromium.org/8387039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108004 0039d316-1c4b-4281-b951-d872f2087c98
64 files changed, 164 insertions, 140 deletions
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index 93ce114..b2c55a6 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -105,8 +105,8 @@ base::LazyInstance<chrome::ChromeContentUtilityClient> base::LazyInstance<chrome::ChromeContentPluginClient> g_chrome_content_plugin_client(base::LINKER_INITIALIZED); -extern int NaClMain(const MainFunctionParams&); -extern int ServiceProcessMain(const MainFunctionParams&); +extern int NaClMain(const content::MainFunctionParams&); +extern int ServiceProcessMain(const content::MainFunctionParams&); namespace { @@ -374,7 +374,7 @@ void SetUpProfilingShutdownHandler() { struct MainFunction { const char* name; - int (*function)(const MainFunctionParams&); + int (*function)(const content::MainFunctionParams&); }; } // namespace @@ -657,7 +657,7 @@ void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { int ChromeMainDelegate::RunProcess( const std::string& process_type, - const MainFunctionParams& main_function_params) { + const content::MainFunctionParams& main_function_params) { static const MainFunction kMainFunctions[] = { { switches::kServiceProcess, ServiceProcessMain }, #if defined(OS_MACOSX) diff --git a/chrome/app/chrome_main_delegate.h b/chrome/app/chrome_main_delegate.h index 064b561..3e9b72a 100644 --- a/chrome/app/chrome_main_delegate.h +++ b/chrome/app/chrome_main_delegate.h @@ -28,7 +28,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; virtual int RunProcess( const std::string& process_type, - const MainFunctionParams& main_function_params) OVERRIDE; + const content::MainFunctionParams& main_function_params) OVERRIDE; virtual void ProcessExiting(const std::string& process_type) OVERRIDE; #if defined(OS_MACOSX) diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index ea45498..4844237 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -90,9 +90,9 @@ #include "chrome/installer/util/google_update_settings.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/common/child_process.h" -#include "content/common/main_function_params.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_client.h" +#include "content/public/common/main_function_params.h" #include "grit/app_locale_settings.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -413,7 +413,7 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line, // Initializes the profile, possibly doing some user prompting to pick a // fallback profile. Returns the newly created profile, or NULL if startup // should not continue. -Profile* CreateProfile(const MainFunctionParams& parameters, +Profile* CreateProfile(const content::MainFunctionParams& parameters, const FilePath& user_data_dir, const CommandLine& parsed_command_line) { Profile* profile; @@ -686,7 +686,7 @@ const char kMissingLocaleDataMessage[] = // BrowserMainParts ------------------------------------------------------------ ChromeBrowserMainParts::ChromeBrowserMainParts( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters), parsed_command_line_(parameters.command_line), result_code_(content::RESULT_CODE_NORMAL_EXIT), diff --git a/chrome/browser/chrome_browser_main.h b/chrome/browser/chrome_browser_main.h index 817e8de..13f0675 100644 --- a/chrome/browser/chrome_browser_main.h +++ b/chrome/browser/chrome_browser_main.h @@ -23,7 +23,6 @@ class PrefService; class Profile; class ShutdownWatcherHelper; class TranslateManager; -struct MainFunctionParams; namespace chrome_browser { // For use by ShowMissingLocaleMessageBox. @@ -31,6 +30,10 @@ extern const char kMissingLocaleDataTitle[]; extern const char kMissingLocaleDataMessage[]; } +namespace content { +struct MainFunctionParams; +} + class ChromeBrowserMainParts : public content::BrowserMainParts { public: virtual ~ChromeBrowserMainParts(); @@ -40,7 +43,7 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { // switches. MetricsService* SetupMetricsAndFieldTrials(PrefService* local_state); - const MainFunctionParams& parameters() const { + const content::MainFunctionParams& parameters() const { return parameters_; } const CommandLine& parsed_command_line() const { @@ -48,7 +51,8 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { } protected: - explicit ChromeBrowserMainParts(const MainFunctionParams& parameters); + explicit ChromeBrowserMainParts( + const content::MainFunctionParams& parameters); // content::BrowserParts overrides virtual void PreEarlyInitialization() OVERRIDE {} @@ -109,7 +113,7 @@ class ChromeBrowserMainParts : public content::BrowserMainParts { // Members initialized on construction --------------------------------------- - const MainFunctionParams& parameters_; + const content::MainFunctionParams& parameters_; const CommandLine& parsed_command_line_; int result_code_; diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index 8e595ee..295533d 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc @@ -12,7 +12,7 @@ #endif ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : ChromeBrowserMainPartsPosix(parameters) { } diff --git a/chrome/browser/chrome_browser_main_linux.h b/chrome/browser/chrome_browser_main_linux.h index 80f3e55..e9f3bee 100644 --- a/chrome/browser/chrome_browser_main_linux.h +++ b/chrome/browser/chrome_browser_main_linux.h @@ -13,7 +13,8 @@ class ChromeBrowserMainPartsLinux : public ChromeBrowserMainPartsPosix { public: - explicit ChromeBrowserMainPartsLinux(const MainFunctionParams& parameters); + explicit ChromeBrowserMainPartsLinux( + const content::MainFunctionParams& parameters); // ChromeBrowserMainParts overrides. virtual void ShowMissingLocaleMessageBox() OVERRIDE; diff --git a/chrome/browser/chrome_browser_main_mac.h b/chrome/browser/chrome_browser_main_mac.h index 2ba7e7b..dc08bbf 100644 --- a/chrome/browser/chrome_browser_main_mac.h +++ b/chrome/browser/chrome_browser_main_mac.h @@ -10,7 +10,8 @@ class ChromeBrowserMainPartsMac : public ChromeBrowserMainPartsPosix { public: - explicit ChromeBrowserMainPartsMac(const MainFunctionParams& parameters); + explicit ChromeBrowserMainPartsMac( + const content::MainFunctionParams& parameters); // BrowserParts overrides. virtual void PreEarlyInitialization() OVERRIDE; diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index 99428ee..02c9d05 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -19,7 +19,7 @@ #include "chrome/browser/metrics/metrics_service.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #include "content/public/common/result_codes.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" @@ -46,7 +46,7 @@ int DoUninstallTasks(bool chrome_still_running) { // ChromeBrowserMainPartsMac --------------------------------------------------- ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : ChromeBrowserMainPartsPosix(parameters) { } diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index 2a9fe0e..1a53281 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc @@ -187,7 +187,7 @@ void SetFileDescriptorLimit(unsigned int max_descriptors) { // ChromeBrowserMainPartsPosix ------------------------------------------------- ChromeBrowserMainPartsPosix::ChromeBrowserMainPartsPosix( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : ChromeBrowserMainParts(parameters) { } diff --git a/chrome/browser/chrome_browser_main_posix.h b/chrome/browser/chrome_browser_main_posix.h index 79a6566..6188de7 100644 --- a/chrome/browser/chrome_browser_main_posix.h +++ b/chrome/browser/chrome_browser_main_posix.h @@ -9,7 +9,8 @@ class ChromeBrowserMainPartsPosix : public ChromeBrowserMainParts { public: - explicit ChromeBrowserMainPartsPosix(const MainFunctionParams& parameters); + explicit ChromeBrowserMainPartsPosix( + const content::MainFunctionParams& parameters); virtual void PreEarlyInitialization() OVERRIDE; virtual void PostMainMessageLoopStart() OVERRIDE; diff --git a/chrome/browser/chrome_browser_main_unittest.cc b/chrome/browser/chrome_browser_main_unittest.cc index e682c9c..4a2f265 100644 --- a/chrome/browser/chrome_browser_main_unittest.cc +++ b/chrome/browser/chrome_browser_main_unittest.cc @@ -11,8 +11,8 @@ #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/testing_pref_service.h" -#include "content/common/main_function_params.h" #include "content/public/browser/content_browser_client.h" +#include "content/public/common/main_function_params.h" #include "net/socket/client_socket_pool_base.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,7 +28,8 @@ class BrowserMainTest : public testing::Test { TEST_F(BrowserMainTest, WarmConnectionFieldTrial_WarmestSocket) { command_line_.AppendSwitchASCII(switches::kSocketReusePolicy, "0"); - scoped_ptr<MainFunctionParams> params(new MainFunctionParams(command_line_)); + scoped_ptr<content::MainFunctionParams> params( + new content::MainFunctionParams(command_line_)); ScopedVector<content::BrowserMainParts> bwv; content::GetContentClient()->browser()->CreateBrowserMainParts( *params, &(bwv.get())); @@ -43,7 +44,8 @@ TEST_F(BrowserMainTest, WarmConnectionFieldTrial_WarmestSocket) { } TEST_F(BrowserMainTest, WarmConnectionFieldTrial_Random) { - scoped_ptr<MainFunctionParams> params(new MainFunctionParams(command_line_)); + scoped_ptr<content::MainFunctionParams> params( + new content::MainFunctionParams(command_line_)); ScopedVector<content::BrowserMainParts> bwv; content::GetContentClient()->browser()->CreateBrowserMainParts( *params, &(bwv.get())); @@ -65,7 +67,8 @@ TEST_F(BrowserMainTest, WarmConnectionFieldTrial_Random) { TEST_F(BrowserMainTest, WarmConnectionFieldTrial_Invalid) { command_line_.AppendSwitchASCII(switches::kSocketReusePolicy, "100"); - scoped_ptr<MainFunctionParams> params(new MainFunctionParams(command_line_)); + scoped_ptr<content::MainFunctionParams> params( + new content::MainFunctionParams(command_line_)); // This test ends up launching a new process, and that doesn't initialize the // ContentClient interfaces. ScopedVector<content::BrowserMainParts> bwv; diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 6064a00..2af430b 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -31,7 +31,7 @@ #include "chrome/installer/util/helper.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/shell_util.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -136,7 +136,7 @@ int DoUninstallTasks(bool chrome_still_running) { // ChromeBrowserMainPartsWin --------------------------------------------------- ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : ChromeBrowserMainParts(parameters) { } diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index f54f557..dddda5d 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h @@ -19,7 +19,8 @@ int DoUninstallTasks(bool chrome_still_running); class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { public: - explicit ChromeBrowserMainPartsWin(const MainFunctionParams& parameters); + explicit ChromeBrowserMainPartsWin( + const content::MainFunctionParams& parameters); // BrowserParts overrides. virtual void PreMainMessageLoopStart() OVERRIDE; diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 032bfce..727c953 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -202,7 +202,7 @@ RenderProcessHostPrivilege GetProcessPrivilege( namespace chrome { void ChromeContentBrowserClient::CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<content::BrowserMainParts*>* parts_list) { // Construct the Main browser parts based on the OS type. #if defined(OS_WIN) diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 4d4e0ec6..35368e1 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -16,7 +16,7 @@ namespace chrome { class ChromeContentBrowserClient : public content::ContentBrowserClient { public: virtual void CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<content::BrowserMainParts*>* parts_list) OVERRIDE; virtual RenderWidgetHostView* CreateViewForWidget( RenderWidgetHost* widget) OVERRIDE; diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index cb897b0..c4126ea 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -20,7 +20,7 @@ #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/defaults.h" #include "chrome/common/chrome_switches.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #include "net/base/network_change_notifier.h" #if defined(TOOLKIT_USES_GTK) @@ -71,7 +71,7 @@ static base::LazyInstance<MessageLoopObserver> g_message_loop_observer( base::LINKER_INITIALIZED); ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : ChromeBrowserMainPartsLinux(parameters) { } diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.h b/chrome/browser/chromeos/chrome_browser_main_chromeos.h index 790477f..5190db1 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.h +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.h @@ -15,7 +15,8 @@ class SessionManagerObserver; class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { public: - explicit ChromeBrowserMainPartsChromeos(const MainFunctionParams& parameters); + explicit ChromeBrowserMainPartsChromeos( + const content::MainFunctionParams& parameters); virtual ~ChromeBrowserMainPartsChromeos(); virtual void PreEarlyInitialization() OVERRIDE; diff --git a/chrome/browser/mac/relauncher.cc b/chrome/browser/mac/relauncher.cc index ee1af48..700f8da 100644 --- a/chrome/browser/mac/relauncher.cc +++ b/chrome/browser/mac/relauncher.cc @@ -28,9 +28,9 @@ #include "base/sys_string_conversions.h" #include "chrome/browser/mac/install_from_dmg.h" #include "chrome/common/chrome_switches.h" -#include "content/common/main_function_params.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" // RTLD_MAIN_ONLY is supported as of Mac OS X 10.5, but <dlfcn.h> does not // define it in the 10.5 SDK. It is present in the 10.6 SDK and is documented @@ -255,7 +255,7 @@ void RelauncherSynchronizeWithParent() { namespace internal { -int RelauncherMain(const MainFunctionParams& main_parameters) { +int RelauncherMain(const content::MainFunctionParams& main_parameters) { // CommandLine rearranges the order of the arguments returned by // main_parameters.argv(), rendering it impossible to determine which // arguments originally came before kRelauncherArgSeparator and which came diff --git a/chrome/browser/mac/relauncher.h b/chrome/browser/mac/relauncher.h index 26ab08b..7ccdd9c 100644 --- a/chrome/browser/mac/relauncher.h +++ b/chrome/browser/mac/relauncher.h @@ -33,7 +33,9 @@ #include <string> #include <vector> +namespace content { struct MainFunctionParams; +} namespace mac_relauncher { @@ -73,7 +75,7 @@ namespace internal { // The entry point from ChromeMain into the relauncher process. This is not a // user API. Don't call it if your name isn't ChromeMain. -int RelauncherMain(const MainFunctionParams& main_parameters); +int RelauncherMain(const content::MainFunctionParams& main_parameters); } // namespace internal diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc index 55348f6..51d9956 100644 --- a/chrome/browser/printing/print_preview_message_handler.cc +++ b/chrome/browser/printing/print_preview_message_handler.cc @@ -21,8 +21,8 @@ #include "chrome/common/print_messages.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/content_restriction.h" #include "content/public/browser/browser_thread.h" +#include "content/public/common/content_restriction.h" #include "printing/page_size_margins.h" #include "printing/print_job_constants.h" @@ -245,7 +245,7 @@ bool PrintPreviewMessageHandler::OnMessageReceived( void PrintPreviewMessageHandler::DidStartLoading() { if (tab_contents()->delegate() && PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) { - tab_contents()->SetContentRestrictions(CONTENT_RESTRICTION_PRINT); + tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT); } } diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 01af4ed..a137dea 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -64,8 +64,8 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/user_metrics.h" -#include "content/common/content_restriction.h" #include "content/public/browser/notification_service.h" +#include "content/public/common/content_restriction.h" #include "grit/generated_resources.h" #include "net/base/escape.h" #include "net/base/net_util.h" @@ -1000,13 +1000,13 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { if (id == IDC_PRINT && (source_tab_contents_->content_restrictions() & - CONTENT_RESTRICTION_PRINT)) { + content::CONTENT_RESTRICTION_PRINT)) { return false; } if (id == IDC_SAVE_PAGE && (source_tab_contents_->content_restrictions() & - CONTENT_RESTRICTION_SAVE)) { + content::CONTENT_RESTRICTION_SAVE)) { return false; } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index e6000a3..13ea20a9 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -149,9 +149,9 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/browser/user_metrics.h" -#include "content/common/content_restriction.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_details.h" +#include "content/public/common/content_restriction.h" #include "content/public/common/content_switches.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -4727,11 +4727,11 @@ void Browser::UpdateCommandsForContentRestrictionState() { int restrictions = GetContentRestrictionsForSelectedTab(); command_updater_.UpdateCommandEnabled( - IDC_COPY, !(restrictions & CONTENT_RESTRICTION_COPY)); + IDC_COPY, !(restrictions & content::CONTENT_RESTRICTION_COPY)); command_updater_.UpdateCommandEnabled( - IDC_CUT, !(restrictions & CONTENT_RESTRICTION_CUT)); + IDC_CUT, !(restrictions & content::CONTENT_RESTRICTION_CUT)); command_updater_.UpdateCommandEnabled( - IDC_PASTE, !(restrictions & CONTENT_RESTRICTION_PASTE)); + IDC_PASTE, !(restrictions & content::CONTENT_RESTRICTION_PASTE)); UpdateSaveAsState(restrictions); UpdatePrintingState(restrictions); } @@ -4750,7 +4750,7 @@ void Browser::UpdatePrintingState(int content_restrictions) { bool has_constrained_window = (wrapper && wrapper->constrained_window_tab_helper()->constrained_window_count()); if (has_constrained_window || - content_restrictions & CONTENT_RESTRICTION_PRINT) { + content_restrictions & content::CONTENT_RESTRICTION_PRINT) { print_enabled = false; advanced_print_enabled = false; } @@ -4816,7 +4816,7 @@ void Browser::MarkHomePageAsChanged(PrefService* pref_service) { } void Browser::UpdateSaveAsState(int content_restrictions) { - bool enabled = !(content_restrictions & CONTENT_RESTRICTION_SAVE); + bool enabled = !(content_restrictions & content::CONTENT_RESTRICTION_SAVE); PrefService* state = g_browser_process->local_state(); if (state) enabled = enabled && state->GetBoolean(prefs::kAllowFileSelectionDialogs); @@ -5382,7 +5382,7 @@ int Browser::GetContentRestrictionsForSelectedTab() { NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); // See comment in UpdateCommandsForTabState about why we call url(). if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) - content_restrictions |= CONTENT_RESTRICTION_SAVE; + content_restrictions |= content::CONTENT_RESTRICTION_SAVE; } return content_restrictions; } diff --git a/chrome/nacl/nacl_exe_win_64.cc b/chrome/nacl/nacl_exe_win_64.cc index c347c7b..9bddf80 100644 --- a/chrome/nacl/nacl_exe_win_64.cc +++ b/chrome/nacl/nacl_exe_win_64.cc @@ -17,16 +17,16 @@ #include "chrome/nacl/nacl_listener.h" #include "chrome/nacl/nacl_main_platform_delegate.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" #include "content/public/app/startup_helper_win.h" +#include "content/public/common/main_function_params.h" #include "content/public/common/sandbox_init.h" #include "sandbox/src/sandbox_types.h" -extern int NaClMain(const MainFunctionParams&); +extern int NaClMain(const content::MainFunctionParams&); // main() routine for the NaCl broker process. // This is necessary for supporting NaCl in Chrome on Win64. -int NaClBrokerMain(const MainFunctionParams& parameters) { +int NaClBrokerMain(const content::MainFunctionParams& parameters) { const CommandLine& parsed_command_line = parameters.command_line; MessageLoopForIO main_message_loop; @@ -67,7 +67,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { // Die if the sandbox can't be enabled. CHECK(sandbox_initialized_ok) << "Error initializing sandbox for " << process_type; - MainFunctionParams main_params(command_line); + content::MainFunctionParams main_params(command_line); main_params.sandbox_info = &sandbox_info; if (process_type == switches::kNaClLoaderProcess) diff --git a/chrome/nacl/nacl_helper_linux.cc b/chrome/nacl/nacl_helper_linux.cc index 3f8646f..a90b589 100644 --- a/chrome/nacl/nacl_helper_linux.cc +++ b/chrome/nacl/nacl_helper_linux.cc @@ -15,12 +15,12 @@ #include <vector> #include "base/at_exit.h" +#include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/rand_util.h" #include "chrome/nacl/nacl_listener.h" -#include "content/common/main_function_params.h" #include "content/common/unix_domain_socket_posix.h" #include "ipc/ipc_switches.h" #include "native_client/src/trusted/service_runtime/sel_memory.h" diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc index 87e37eb..3029dbb 100644 --- a/chrome/nacl/nacl_main.cc +++ b/chrome/nacl/nacl_main.cc @@ -14,7 +14,7 @@ #include "chrome/nacl/nacl_main_platform_delegate.h" #include "content/common/child_process.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" // This function provides some ways to test crash and assertion handling // behavior of the renderer. @@ -29,7 +29,7 @@ static void HandleNaClTestParameters(const CommandLine& command_line) { } // main() routine for the NaCl loader process. -int NaClMain(const MainFunctionParams& parameters) { +int NaClMain(const content::MainFunctionParams& parameters) { const CommandLine& parsed_command_line = parameters.command_line; // This function allows pausing execution using the --nacl-startup-dialog diff --git a/chrome/nacl/nacl_main_platform_delegate.h b/chrome/nacl/nacl_main_platform_delegate.h index b1c56f6..7979516 100644 --- a/chrome/nacl/nacl_main_platform_delegate.h +++ b/chrome/nacl/nacl_main_platform_delegate.h @@ -7,14 +7,15 @@ #pragma once #include "base/native_library.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" typedef bool (*RunNaClLoaderTests)(void); const char kNaClLoaderTestCall[] = "RunNaClLoaderTests"; class NaClMainPlatformDelegate { public: - explicit NaClMainPlatformDelegate(const MainFunctionParams& parameters); + explicit NaClMainPlatformDelegate( + const content::MainFunctionParams& parameters); ~NaClMainPlatformDelegate(); // Called first thing and last thing in the process' lifecycle, i.e. before @@ -35,7 +36,7 @@ class NaClMainPlatformDelegate { bool RunSandboxTests(); private: - const MainFunctionParams& parameters_; + const content::MainFunctionParams& parameters_; base::NativeLibrary sandbox_test_module_; DISALLOW_COPY_AND_ASSIGN(NaClMainPlatformDelegate); diff --git a/chrome/nacl/nacl_main_platform_delegate_linux.cc b/chrome/nacl/nacl_main_platform_delegate_linux.cc index d8e4b23..2941c55 100644 --- a/chrome/nacl/nacl_main_platform_delegate_linux.cc +++ b/chrome/nacl/nacl_main_platform_delegate_linux.cc @@ -8,7 +8,7 @@ #include "seccompsandbox/sandbox.h" NaClMainPlatformDelegate::NaClMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters), sandbox_test_module_(NULL) { } diff --git a/chrome/nacl/nacl_main_platform_delegate_mac.mm b/chrome/nacl/nacl_main_platform_delegate_mac.mm index c5eb65a..6e3121e 100644 --- a/chrome/nacl/nacl_main_platform_delegate_mac.mm +++ b/chrome/nacl/nacl_main_platform_delegate_mac.mm @@ -14,7 +14,7 @@ #include "content/public/common/sandbox_init.h" NaClMainPlatformDelegate::NaClMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters), sandbox_test_module_(NULL) { } diff --git a/chrome/nacl/nacl_main_platform_delegate_win.cc b/chrome/nacl/nacl_main_platform_delegate_win.cc index 1ce923e..d2ce5f3 100644 --- a/chrome/nacl/nacl_main_platform_delegate_win.cc +++ b/chrome/nacl/nacl_main_platform_delegate_win.cc @@ -12,7 +12,7 @@ #include "sandbox/src/sandbox.h" NaClMainPlatformDelegate::NaClMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters), sandbox_test_module_(NULL) { } diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index 14f1362..99d6c83 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -7,7 +7,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/service_process_util.h" #include "chrome/service/service_process.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #if defined(OS_WIN) #include "content/common/sandbox_policy.h" @@ -17,7 +17,7 @@ #endif // defined(OS_WIN) // Mainline routine for running as the service process. -int ServiceProcessMain(const MainFunctionParams& parameters) { +int ServiceProcessMain(const content::MainFunctionParams& parameters) { MessageLoopForUI main_message_loop; main_message_loop.set_thread_name("MainThread"); if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) { diff --git a/content/app/content_main.cc b/content/app/content_main.cc index 3cbf07f..ace58ff 100644 --- a/content/app/content_main.cc +++ b/content/app/content_main.cc @@ -15,7 +15,6 @@ #include "base/stringprintf.h" #include "base/string_number_conversions.h" #include "content/browser/browser_main.h" -#include "content/common/main_function_params.h" #include "content/common/set_process_title.h" #include "content/public/app/content_main_delegate.h" #include "content/public/app/startup_helper_win.h" @@ -23,6 +22,7 @@ #include "content/public/common/content_constants.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/public/common/sandbox_init.h" #include "crypto/nss_util.h" #include "ipc/ipc_switches.h" @@ -59,15 +59,15 @@ int tc_set_new_mode(int mode); } #endif -extern int GpuMain(const MainFunctionParams&); -extern int PluginMain(const MainFunctionParams&); -extern int PpapiPluginMain(const MainFunctionParams&); -extern int PpapiBrokerMain(const MainFunctionParams&); -extern int RendererMain(const MainFunctionParams&); -extern int WorkerMain(const MainFunctionParams&); -extern int UtilityMain(const MainFunctionParams&); +extern int GpuMain(const content::MainFunctionParams&); +extern int PluginMain(const content::MainFunctionParams&); +extern int PpapiPluginMain(const content::MainFunctionParams&); +extern int PpapiBrokerMain(const content::MainFunctionParams&); +extern int RendererMain(const content::MainFunctionParams&); +extern int WorkerMain(const content::MainFunctionParams&); +extern int UtilityMain(const content::MainFunctionParams&); #if defined(OS_POSIX) && !defined(OS_MACOSX) -extern int ZygoteMain(const MainFunctionParams&, +extern int ZygoteMain(const content::MainFunctionParams&, content::ZygoteForkDelegate* forkdelegate); #endif @@ -176,7 +176,7 @@ void InitializeStatsTable(base::ProcessId browser_pid, // flag. This struct is used to build a table of (flag, main function) pairs. struct MainFunction { const char* name; - int (*function)(const MainFunctionParams&); + int (*function)(const content::MainFunctionParams&); }; #if defined(OS_POSIX) && !defined(OS_MACOSX) @@ -184,7 +184,7 @@ struct MainFunction { // subprocesses that are launched via the zygote. This function // fills in some process-launching bits around ZygoteMain(). // Returns the exit code of the subprocess. -int RunZygote(const MainFunctionParams& main_function_params, +int RunZygote(const content::MainFunctionParams& main_function_params, content::ContentMainDelegate* delegate) { static const MainFunction kMainFunctions[] = { { switches::kRendererProcess, RendererMain }, @@ -219,7 +219,7 @@ int RunZygote(const MainFunctionParams& main_function_params, base::GetParentProcessId(base::GetCurrentProcId())); InitializeStatsTable(browser_pid, command_line); - MainFunctionParams main_params(command_line); + content::MainFunctionParams main_params(command_line); // Get the new process type from the new command line. std::string process_type = @@ -241,9 +241,10 @@ int RunZygote(const MainFunctionParams& main_function_params, // Run the FooMain() for a given process type. // If |process_type| is empty, runs BrowserMain(). // Returns the exit code for this process. -int RunNamedProcessTypeMain(const std::string& process_type, - const MainFunctionParams& main_function_params, - content::ContentMainDelegate* delegate) { +int RunNamedProcessTypeMain( + const std::string& process_type, + const content::MainFunctionParams& main_function_params, + content::ContentMainDelegate* delegate) { static const MainFunction kMainFunctions[] = { { "", BrowserMain }, { switches::kRendererProcess, RendererMain }, @@ -435,7 +436,7 @@ int ContentMain(int argc, SetProcessTitleFromCommandLine(argv); #endif - MainFunctionParams main_params(command_line); + content::MainFunctionParams main_params(command_line); #if defined(OS_WIN) main_params.sandbox_info = sandbox_info; #elif defined(OS_MACOSX) diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index c358f49..1127117 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc @@ -11,8 +11,8 @@ #include "base/metrics/histogram.h" #include "content/browser/browser_main_loop.h" #include "content/browser/notification_service_impl.h" -#include "content/common/main_function_params.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #if defined(OS_WIN) #include "base/win/scoped_com_initializer.h" @@ -33,7 +33,7 @@ bool ExitedMainMessageLoop() { } // namespace content // Main routine for running as the Browser process. -int BrowserMain(const MainFunctionParams& parameters) { +int BrowserMain(const content::MainFunctionParams& parameters) { TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); NotificationServiceImpl main_notification_service; diff --git a/content/browser/browser_main.h b/content/browser/browser_main.h index 86370bb..69a5d62 100644 --- a/content/browser/browser_main.h +++ b/content/browser/browser_main.h @@ -9,14 +9,14 @@ #include "base/basictypes.h" #include "content/common/content_export.h" -struct MainFunctionParams; - namespace content { +struct MainFunctionParams; + bool ExitedMainMessageLoop(); } // namespace content -CONTENT_EXPORT int BrowserMain(const MainFunctionParams& parameters); +CONTENT_EXPORT int BrowserMain(const content::MainFunctionParams& parameters); #endif // CONTENT_BROWSER_BROWSER_MAIN_H_ diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index ff12449..6d49467 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -14,11 +14,11 @@ #include "base/tracked_objects.h" #include "content/browser/browser_thread_impl.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" #include "content/common/sandbox_policy.h" #include "content/public/browser/browser_main_parts.h" #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/public/common/result_codes.h" #include "crypto/nss_util.h" #include "net/base/network_change_notifier.h" @@ -147,7 +147,7 @@ namespace content { // BrowserMainLoop construction / destructione ============================= -BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) +BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) : parameters_(parameters), parsed_command_line_(parameters.command_line), result_code_(content::RESULT_CODE_NORMAL_EXIT) { diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index 32d0c58..8642e4f 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h @@ -15,8 +15,6 @@ class CommandLine; class HighResolutionTimerManager; class MessageLoop; -struct MainFunctionParams; - namespace base { class SystemMonitor; } @@ -29,12 +27,13 @@ namespace content { class BrowserMainParts; class BrowserThreadImpl; +struct MainFunctionParams; // Implements the main browser loop stages called from |BrowserMain()|. // See comments in browser_main_parts.h for additional info. class BrowserMainLoop { public: - explicit BrowserMainLoop(const MainFunctionParams& parameters); + explicit BrowserMainLoop(const content::MainFunctionParams& parameters); virtual ~BrowserMainLoop(); void Init(); @@ -51,7 +50,7 @@ class BrowserMainLoop { void InitializeMainThread(); // Members initialized on construction --------------------------------------- - const MainFunctionParams& parameters_; + const content::MainFunctionParams& parameters_; const CommandLine& parsed_command_line_; int result_code_; diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index a2e9e32..c350fab 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -24,7 +24,7 @@ MockContentBrowserClient::~MockContentBrowserClient() { } void MockContentBrowserClient::CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<BrowserMainParts*>* parts_list) { } diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index 8152308..1889cc7 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -22,7 +22,7 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual ~MockContentBrowserClient(); virtual void CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<BrowserMainParts*>* parts_list) OVERRIDE; virtual RenderWidgetHostView* CreateViewForWidget( RenderWidgetHost* widget) OVERRIDE; diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 6962016..2e791b0 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -38,7 +38,6 @@ #include "content/browser/tab_contents/title_updated_details.h" #include "content/browser/user_metrics.h" #include "content/browser/webui/web_ui_factory.h" -#include "content/common/content_restriction.h" #include "content/common/intents_messages.h" #include "content/common/view_messages.h" #include "content/public/browser/content_browser_client.h" @@ -46,6 +45,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/content_constants.h" +#include "content/public/common/content_restriction.h" #include "content/public/common/url_constants.h" #include "content/public/common/view_types.h" #include "net/base/net_util.h" diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc index 4adb25b..c56d8ea 100644 --- a/content/browser/zygote_main_linux.cc +++ b/content/browser/zygote_main_linux.cc @@ -30,7 +30,6 @@ #include "crypto/nss_util.h" #include "content/common/chrome_descriptors.h" #include "content/common/font_config_ipc_linux.h" -#include "content/common/main_function_params.h" #include "content/common/pepper_plugin_registry.h" #include "content/common/process_watcher.h" #include "content/common/sandbox_methods_linux.h" @@ -38,6 +37,7 @@ #include "content/common/set_process_title.h" #include "content/common/unix_domain_socket_posix.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/public/common/result_codes.h" #include "content/public/common/zygote_fork_delegate_linux.h" #include "skia/ext/SkFontHost_fontconfig_control.h" @@ -805,7 +805,7 @@ static bool EnterSandbox() { #endif // CHROMIUM_SELINUX -bool ZygoteMain(const MainFunctionParams& params, +bool ZygoteMain(const content::MainFunctionParams& params, content::ZygoteForkDelegate* forkdelegate) { #if !defined(CHROMIUM_SELINUX) g_am_zygote_or_renderer = true; diff --git a/content/content_common.gypi b/content/content_common.gypi index 505846d..46ee9ce 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -33,12 +33,14 @@ 'public/common/content_constants.cc', 'public/common/content_constants.h', 'public/common/content_paths.h', + 'public/common/content_restriction.h', 'public/common/content_switches.cc', 'public/common/content_switches.h', 'public/common/dx_diag_node.cc', 'public/common/dx_diag_node.h', 'public/common/gpu_info.cc', 'public/common/gpu_info.h', + 'public/common/main_function_params.h', 'public/common/page_transition_types.cc', 'public/common/page_transition_types.h', 'public/common/page_type.h', @@ -87,7 +89,6 @@ 'common/content_counters.cc', 'common/content_counters.h', 'common/content_paths.cc', - 'common/content_restriction.h', 'common/css_colors.h', 'common/database_messages.h', 'common/database_util.cc', @@ -157,7 +158,6 @@ 'common/mac/font_descriptor.mm', 'common/mac/font_loader.h', 'common/mac/font_loader.mm', - 'common/main_function_params.h', 'common/media/audio_messages.h', 'common/media/audio_stream_state.h', 'common/media/media_stream_messages.h', diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index a4bb494..48ff837 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -15,8 +15,8 @@ #include "base/win/scoped_com_initializer.h" #include "build/build_config.h" #include "content/common/gpu/gpu_config.h" -#include "content/common/main_function_params.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/gpu/gpu_child_thread.h" #include "content/gpu/gpu_process.h" #include "ui/gfx/gl/gl_surface.h" @@ -33,7 +33,7 @@ #endif // Main function for starting the Gpu process. -int GpuMain(const MainFunctionParams& parameters) { +int GpuMain(const content::MainFunctionParams& parameters) { base::Time start_time = base::Time::Now(); const CommandLine& command_line = parameters.command_line; diff --git a/content/plugin/plugin_main.cc b/content/plugin/plugin_main.cc index 8a5d0ff..8e8b1ea 100644 --- a/content/plugin/plugin_main.cc +++ b/content/plugin/plugin_main.cc @@ -16,9 +16,9 @@ #include "base/threading/platform_thread.h" #include "content/common/child_process.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" #include "content/plugin/plugin_thread.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #if defined(OS_WIN) #include "content/common/injection_test_dll.h" @@ -75,7 +75,7 @@ int PreloadIMEForFlash() { #endif // main() routine for running as the plugin process. -int PluginMain(const MainFunctionParams& parameters) { +int PluginMain(const content::MainFunctionParams& parameters) { // The main thread of the plugin services UI. #if defined(OS_MACOSX) #if !defined(__LP64__) diff --git a/content/ppapi_plugin/ppapi_broker_main.cc b/content/ppapi_plugin/ppapi_broker_main.cc index f2a546e..7963e29 100644 --- a/content/ppapi_plugin/ppapi_broker_main.cc +++ b/content/ppapi_plugin/ppapi_broker_main.cc @@ -6,12 +6,12 @@ #include "base/threading/platform_thread.h" #include "build/build_config.h" #include "content/common/child_process.h" -#include "content/common/main_function_params.h" #include "content/ppapi_plugin/ppapi_thread.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" // Main function for starting the PPAPI broker process. -int PpapiBrokerMain(const MainFunctionParams& parameters) { +int PpapiBrokerMain(const content::MainFunctionParams& parameters) { const CommandLine& command_line = parameters.command_line; if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { ChildProcess::WaitForDebugger("PpapiBroker"); diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 11d771d..1b0d2ee 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc @@ -8,9 +8,9 @@ #include "base/threading/platform_thread.h" #include "build/build_config.h" #include "content/common/child_process.h" -#include "content/common/main_function_params.h" #include "content/ppapi_plugin/ppapi_thread.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "ppapi/proxy/proxy_module.h" #if defined(OS_WIN) @@ -28,7 +28,7 @@ void* g_target_services = 0; #endif // Main function for starting the PPAPI plugin process. -int PpapiPluginMain(const MainFunctionParams& parameters) { +int PpapiPluginMain(const content::MainFunctionParams& parameters) { const CommandLine& command_line = parameters.command_line; #if defined(OS_WIN) diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h index e8e2fde..6fd40b0 100644 --- a/content/public/app/content_main_delegate.h +++ b/content/public/app/content_main_delegate.h @@ -10,11 +10,10 @@ #include "build/build_config.h" -struct MainFunctionParams; - namespace content { class ZygoteForkDelegate; +struct MainFunctionParams; class ContentMainDelegate { public: @@ -36,8 +35,9 @@ class ContentMainDelegate { virtual void SandboxInitialized(const std::string& process_type) = 0; // Asks the embedder to start a process that content doesn't know about. - virtual int RunProcess(const std::string& process_type, - const MainFunctionParams& main_function_params) = 0; + virtual int RunProcess( + const std::string& process_type, + const content::MainFunctionParams& main_function_params) = 0; // Called right before the process exits. virtual void ProcessExiting(const std::string& process_type) = 0; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 4d4f1ad..8ec5549 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -35,11 +35,11 @@ class TabContents; class TabContentsView; class WorkerProcessHost; struct DesktopNotificationHostMsg_Show_Params; -struct MainFunctionParams; struct WebPreferences; namespace content { class BrowserMainParts; +struct MainFunctionParams; } namespace crypto { @@ -86,7 +86,7 @@ class ContentBrowserClient { // implementations for the browser startup code. See comments in // browser_main_parts.h. virtual void CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<BrowserMainParts*>* parts_list) = 0; // Platform-specific creator. Use this to construct new RenderWidgetHostViews diff --git a/content/common/content_restriction.h b/content/public/common/content_restriction.h index 1497939..3ea577d 100644 --- a/content/common/content_restriction.h +++ b/content/public/common/content_restriction.h @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_COMMON_CONTENT_RESTRICTION_H_ -#define CONTENT_COMMON_CONTENT_RESTRICTION_H_ +#ifndef CONTENT_PUBLIC_COMMON_CONTENT_RESTRICTION_H_ +#define CONTENT_PUBLIC_COMMON_CONTENT_RESTRICTION_H_ #pragma once +namespace content { + // Used by a full-page plugin to disable browser commands because of // restrictions on how the data is to be used (i.e. can't copy/print). enum ContentRestriction { @@ -16,4 +18,6 @@ enum ContentRestriction { CONTENT_RESTRICTION_SAVE = 1 << 4 }; -#endif // CONTENT_COMMON_CONTENT_RESTRICTION_H_ +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_CONTENT_RESTRICTION_H_ diff --git a/content/common/main_function_params.h b/content/public/common/main_function_params.h index 1b6323f..2a8a16d 100644 --- a/content/common/main_function_params.h +++ b/content/public/common/main_function_params.h @@ -6,8 +6,8 @@ // plugin) to shield the call sites from the differences between platforms // (e.g., POSIX doesn't need to pass any sandbox information). -#ifndef CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ -#define CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ +#ifndef CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ +#define CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ #pragma once #include "base/command_line.h" @@ -26,6 +26,8 @@ class ScopedNSAutoreleasePool; class Task; +namespace content { + struct MainFunctionParams { explicit MainFunctionParams(const CommandLine& cl) : command_line(cl), @@ -46,4 +48,6 @@ struct MainFunctionParams { Task* ui_task; }; -#endif // CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index 8d21de0..4661780 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -17,10 +17,10 @@ #include "base/threading/platform_thread.h" #include "base/time.h" #include "content/common/content_counters.h" -#include "content/common/main_function_params.h" #include "content/common/hi_res_timer_manager.h" #include "content/common/pepper_plugin_registry.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/renderer/render_process_impl.h" #include "content/renderer/render_thread_impl.h" #include "content/renderer/renderer_main_platform_delegate.h" @@ -121,7 +121,7 @@ class RendererMessageLoopObserver : public MessageLoop::TaskObserver { }; // mainline routine for running as the Renderer process -int RendererMain(const MainFunctionParams& parameters) { +int RendererMain(const content::MainFunctionParams& parameters) { TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); const CommandLine& parsed_command_line = parameters.command_line; diff --git a/content/renderer/renderer_main_platform_delegate.h b/content/renderer/renderer_main_platform_delegate.h index b98eb0a..e8b5db9 100644 --- a/content/renderer/renderer_main_platform_delegate.h +++ b/content/renderer/renderer_main_platform_delegate.h @@ -14,7 +14,7 @@ #include "base/basictypes.h" #include "content/common/content_export.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #ifdef __OBJC__ @class NSBundle; @@ -24,7 +24,8 @@ class NSBundle; class CONTENT_EXPORT RendererMainPlatformDelegate { public: - explicit RendererMainPlatformDelegate(const MainFunctionParams& parameters); + explicit RendererMainPlatformDelegate( + const content::MainFunctionParams& parameters); ~RendererMainPlatformDelegate(); // Called first thing and last thing in the process' lifecycle, i.e. before @@ -43,7 +44,7 @@ class CONTENT_EXPORT RendererMainPlatformDelegate { void RunSandboxTests(); private: - const MainFunctionParams& parameters_; + const content::MainFunctionParams& parameters_; #if defined(OS_WIN) HMODULE sandbox_test_module_; #elif defined(OS_MACOSX) diff --git a/content/renderer/renderer_main_platform_delegate_linux.cc b/content/renderer/renderer_main_platform_delegate_linux.cc index d990a7f..546cd5a 100644 --- a/content/renderer/renderer_main_platform_delegate_linux.cc +++ b/content/renderer/renderer_main_platform_delegate_linux.cc @@ -9,7 +9,7 @@ #include "content/public/common/content_switches.h" RendererMainPlatformDelegate::RendererMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters) { } diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm index c430733..68685c4 100644 --- a/content/renderer/renderer_main_platform_delegate_mac.mm +++ b/content/renderer/renderer_main_platform_delegate_mac.mm @@ -18,7 +18,7 @@ #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.h" RendererMainPlatformDelegate::RendererMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters) { } diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc index c917f0d..67a563d 100644 --- a/content/renderer/renderer_main_platform_delegate_win.cc +++ b/content/renderer/renderer_main_platform_delegate_win.cc @@ -62,7 +62,7 @@ void EnableThemeSupportForRenderer(bool no_sandbox) { } // namespace RendererMainPlatformDelegate::RendererMainPlatformDelegate( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : parameters_(parameters), sandbox_test_module_(NULL) { } diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index 7058cff..a336404 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -20,7 +20,7 @@ namespace content { ShellBrowserMainParts::ShellBrowserMainParts( - const MainFunctionParams& parameters) + const content::MainFunctionParams& parameters) : BrowserMainParts() { ShellContentBrowserClient* shell_browser_client = static_cast<ShellContentBrowserClient*>( diff --git a/content/shell/shell_browser_main.h b/content/shell/shell_browser_main.h index 7e43d88..55f725a 100644 --- a/content/shell/shell_browser_main.h +++ b/content/shell/shell_browser_main.h @@ -11,7 +11,6 @@ #include "content/public/browser/browser_main_parts.h" class ResourceDispatcherHost; -struct MainFunctionParams; namespace base { class Thread; @@ -24,10 +23,11 @@ class Clipboard; namespace content { class ShellBrowserContext; +struct MainFunctionParams; class ShellBrowserMainParts : public BrowserMainParts { public: - explicit ShellBrowserMainParts(const MainFunctionParams& parameters); + explicit ShellBrowserMainParts(const content::MainFunctionParams& parameters); virtual ~ShellBrowserMainParts(); virtual void PreEarlyInitialization() OVERRIDE {} diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 2b22709..18aae4e 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -29,7 +29,7 @@ ShellContentBrowserClient::~ShellContentBrowserClient() { } void ShellContentBrowserClient::CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<BrowserMainParts*>* parts_list) { parts_list->push_back(new ShellBrowserMainParts(parameters)); } diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 886dc00..382b207 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -34,7 +34,7 @@ class ShellContentBrowserClient : public ContentBrowserClient } virtual void CreateBrowserMainParts( - const MainFunctionParams& parameters, + const content::MainFunctionParams& parameters, std::vector<BrowserMainParts*>* parts_list) OVERRIDE; virtual RenderWidgetHostView* CreateViewForWidget( RenderWidgetHost* widget) OVERRIDE; diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc index 05c50fb..fb79904 100644 --- a/content/shell/shell_main_delegate.cc +++ b/content/shell/shell_main_delegate.cc @@ -35,7 +35,7 @@ void ShellMainDelegate::SandboxInitialized(const std::string& process_type) { int ShellMainDelegate::RunProcess( const std::string& process_type, - const MainFunctionParams& main_function_params) { + const content::MainFunctionParams& main_function_params) { NOTREACHED(); return -1; } diff --git a/content/shell/shell_main_delegate.h b/content/shell/shell_main_delegate.h index 316d0b7..ee5922b 100644 --- a/content/shell/shell_main_delegate.h +++ b/content/shell/shell_main_delegate.h @@ -28,7 +28,7 @@ class ShellMainDelegate : public content::ContentMainDelegate { virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; virtual int RunProcess( const std::string& process_type, - const MainFunctionParams& main_function_params) OVERRIDE; + const content::MainFunctionParams& main_function_params) OVERRIDE; virtual void ProcessExiting(const std::string& process_type) OVERRIDE; #if defined(OS_MACOSX) virtual bool ProcessRegistersWithSystemProcess( diff --git a/content/test/browser_test_base.cc b/content/test/browser_test_base.cc index d1f89f8..a6a3092 100644 --- a/content/test/browser_test_base.cc +++ b/content/test/browser_test_base.cc @@ -6,7 +6,7 @@ #include "base/command_line.h" #include "base/task.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #include "sandbox/src/dep.h" #if defined(OS_MACOSX) @@ -14,7 +14,7 @@ #include "base/system_monitor/system_monitor.h" #endif -extern int BrowserMain(const MainFunctionParams&); +extern int BrowserMain(const content::MainFunctionParams&); BrowserTestBase::BrowserTestBase() { #if defined(OS_MACOSX) @@ -27,7 +27,7 @@ BrowserTestBase::~BrowserTestBase() { } void BrowserTestBase::SetUp() { - MainFunctionParams params(*CommandLine::ForCurrentProcess()); + content::MainFunctionParams params(*CommandLine::ForCurrentProcess()); params.ui_task = NewRunnableMethod(this, &BrowserTestBase::ProxyRunTestOnMainThreadLoop); diff --git a/content/test/render_view_test.cc b/content/test/render_view_test.cc index eacb390..224733b 100644 --- a/content/test/render_view_test.cc +++ b/content/test/render_view_test.cc @@ -97,7 +97,7 @@ void RenderViewTest::SetUp() { render_thread_->set_routing_id(kRouteId); command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); - params_.reset(new MainFunctionParams(*command_line_)); + params_.reset(new content::MainFunctionParams(*command_line_)); platform_.reset(new RendererMainPlatformDelegate(*params_)); platform_->PlatformInitialize(); diff --git a/content/test/render_view_test.h b/content/test/render_view_test.h index e2b995a..436d594 100644 --- a/content/test/render_view_test.h +++ b/content/test/render_view_test.h @@ -11,8 +11,8 @@ #include "base/command_line.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" -#include "content/common/main_function_params.h" #include "content/public/browser/native_web_keyboard_event.h" +#include "content/public/common/main_function_params.h" #include "content/renderer/mock_content_renderer_client.h" #include "content/renderer/renderer_webkitplatformsupport_impl.h" #include "content/test/mock_keyboard.h" @@ -123,7 +123,7 @@ class RenderViewTest : public testing::Test { // Used to setup the process so renderers can run. scoped_ptr<RendererMainPlatformDelegate> platform_; - scoped_ptr<MainFunctionParams> params_; + scoped_ptr<content::MainFunctionParams> params_; scoped_ptr<CommandLine> command_line_; }; diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc index ccbdc65..acbd799 100644 --- a/content/utility/utility_main.cc +++ b/content/utility/utility_main.cc @@ -8,8 +8,8 @@ #include "base/threading/platform_thread.h" #include "content/common/child_process.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" #include "content/public/common/content_switches.h" +#include "content/public/common/main_function_params.h" #include "content/utility/utility_thread_impl.h" #if defined(OS_WIN) @@ -17,7 +17,7 @@ #endif // Mainline routine for running as the utility process. -int UtilityMain(const MainFunctionParams& parameters) { +int UtilityMain(const content::MainFunctionParams& parameters) { // The main message loop of the utility process. MessageLoop main_message_loop; base::PlatformThread::SetName("CrUtilityMain"); diff --git a/content/worker/worker_main.cc b/content/worker/worker_main.cc index 8182a23..47c7a58 100644 --- a/content/worker/worker_main.cc +++ b/content/worker/worker_main.cc @@ -10,7 +10,7 @@ #include "base/threading/platform_thread.h" #include "content/common/child_process.h" #include "content/common/hi_res_timer_manager.h" -#include "content/common/main_function_params.h" +#include "content/public/common/main_function_params.h" #include "content/worker/worker_thread.h" #if defined(OS_WIN) @@ -19,7 +19,7 @@ #endif // Mainline routine for running as the worker process. -int WorkerMain(const MainFunctionParams& parameters) { +int WorkerMain(const content::MainFunctionParams& parameters) { // The main message loop of the worker process. MessageLoop main_message_loop; base::PlatformThread::SetName("CrWorkerMain"); |