diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 00:26:19 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 00:26:19 +0000 |
commit | 130757671de6d0dc4b54dd3ef11c1b9eb5f039cc (patch) | |
tree | 0c92593a755e31425f69d8c3c345fff10287c4ce | |
parent | 375abf5c85ab185e3d659cde1e585aff2f8e6b3a (diff) | |
download | chromium_src-130757671de6d0dc4b54dd3ef11c1b9eb5f039cc.zip chromium_src-130757671de6d0dc4b54dd3ef11c1b9eb5f039cc.tar.gz chromium_src-130757671de6d0dc4b54dd3ef11c1b9eb5f039cc.tar.bz2 |
Move the remaning files in content\common to the content namespace.
Review URL: https://codereview.chromium.org/11235068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163732 0039d316-1c4b-4281-b951-d872f2087c98
62 files changed, 411 insertions, 330 deletions
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index c10d82db..8380e50 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc @@ -34,12 +34,7 @@ #include "content/browser/mach_broker_mac.h" #endif -using content::BrowserChildProcessHostDelegate; -using content::BrowserThread; -using content::ChildProcessData; -using content::ChildProcessHost; -using content::ChildProcessHostImpl; - +namespace content { namespace { static base::LazyInstance<BrowserChildProcessHostImpl::BrowserChildProcessList> @@ -49,15 +44,13 @@ static base::LazyInstance<BrowserChildProcessHostImpl::BrowserChildProcessList> // UI thread. void ChildNotificationHelper(int notification_type, const ChildProcessData& data) { - content::NotificationService::current()-> - Notify(notification_type, content::NotificationService::AllSources(), - content::Details<const ChildProcessData>(&data)); + NotificationService::current()->Notify( + notification_type, NotificationService::AllSources(), + Details<const ChildProcessData>(&data)); } } // namespace -namespace content { - BrowserChildProcessHost* BrowserChildProcessHost::Create( ProcessType type, BrowserChildProcessHostDelegate* delegate) { @@ -70,15 +63,13 @@ base::ProcessMetrics::PortProvider* BrowserChildProcessHost::GetPortProvider() { } #endif -} // namespace content - BrowserChildProcessHostImpl::BrowserChildProcessList* BrowserChildProcessHostImpl::GetIterator() { return g_child_process_list.Pointer(); } BrowserChildProcessHostImpl::BrowserChildProcessHostImpl( - content::ProcessType type, + ProcessType type, BrowserChildProcessHostDelegate* delegate) : data_(type), delegate_(delegate) { @@ -86,11 +77,11 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl( child_process_host_.reset(ChildProcessHost::Create(this)); child_process_host_->AddFilter(new TraceMessageFilter); - child_process_host_->AddFilter(new content::ProfilerMessageFilter(type)); - child_process_host_->AddFilter(new content::HistogramMessageFilter()); + child_process_host_->AddFilter(new ProfilerMessageFilter(type)); + child_process_host_->AddFilter(new HistogramMessageFilter()); g_child_process_list.Get().push_back(this); - content::GetContentClient()->browser()->BrowserChildProcessHostCreated(this); + GetContentClient()->browser()->BrowserChildProcessHostCreated(this); } BrowserChildProcessHostImpl::~BrowserChildProcessHostImpl() { @@ -119,7 +110,7 @@ void BrowserChildProcessHostImpl::Launch( CommandLine* cmd_line) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( + GetContentClient()->browser()->AppendExtraCommandLineSwitches( cmd_line, data_.id); const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); @@ -211,7 +202,7 @@ bool BrowserChildProcessHostImpl::OnMessageReceived( } void BrowserChildProcessHostImpl::OnChannelConnected(int32 peer_pid) { - Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED); + Notify(NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED); delegate_->OnChannelConnected(peer_pid); } @@ -232,10 +223,10 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() { case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { delegate_->OnProcessCrashed(exit_code); // Report that this child process crashed. - Notify(content::NOTIFICATION_CHILD_PROCESS_CRASHED); + Notify(NOTIFICATION_CHILD_PROCESS_CRASHED); UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed", data_.type, - content::PROCESS_TYPE_MAX); + PROCESS_TYPE_MAX); break; } case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { @@ -243,22 +234,22 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() { // Report that this child process was killed. UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed", data_.type, - content::PROCESS_TYPE_MAX); + PROCESS_TYPE_MAX); break; } case base::TERMINATION_STATUS_STILL_RUNNING: { UMA_HISTOGRAM_ENUMERATION("ChildProcess.DisconnectedAlive", data_.type, - content::PROCESS_TYPE_MAX); + PROCESS_TYPE_MAX); } default: break; } UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected", data_.type, - content::PROCESS_TYPE_MAX); + PROCESS_TYPE_MAX); // Notify in the main loop of the disconnection. - Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED); + Notify(NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED); delete delegate_; // Will delete us } @@ -274,3 +265,5 @@ void BrowserChildProcessHostImpl::OnProcessLaunched() { data_.handle = child_process_->GetHandle(); delegate_->OnProcessLaunched(); } + +} // namespace content diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index 3d628f0..317a808 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -17,19 +17,18 @@ namespace content { class BrowserChildProcessHostIterator; -} // Plugins/workers and other child processes that live on the IO thread use this // class. RenderProcessHostImpl is the main exception that doesn't use this /// class because it lives on the UI thread. class CONTENT_EXPORT BrowserChildProcessHostImpl - : public content::BrowserChildProcessHost, - public NON_EXPORTED_BASE(content::ChildProcessHostDelegate), + : public BrowserChildProcessHost, + public NON_EXPORTED_BASE(ChildProcessHostDelegate), public ChildProcessLauncher::Client { public: BrowserChildProcessHostImpl( - content::ProcessType type, - content::BrowserChildProcessHostDelegate* delegate); + ProcessType type, + BrowserChildProcessHostDelegate* delegate); virtual ~BrowserChildProcessHostImpl(); // Terminates all child processes and deletes each BrowserChildProcessHost @@ -46,8 +45,8 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl const base::EnvironmentVector& environ, #endif CommandLine* cmd_line) OVERRIDE; - virtual const content::ChildProcessData& GetData() const OVERRIDE; - virtual content::ChildProcessHost* GetHost() const OVERRIDE; + virtual const ChildProcessData& GetData() const OVERRIDE; + virtual ChildProcessHost* GetHost() const OVERRIDE; virtual base::TerminationStatus GetTerminationStatus(int* exit_code) OVERRIDE; virtual void SetName(const string16& name) OVERRIDE; virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; @@ -66,13 +65,12 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl // Sends the given notification on the UI thread. void Notify(int type); - content::BrowserChildProcessHostDelegate* delegate() const { - return delegate_; + BrowserChildProcessHostDelegate* delegate() const { return delegate_; } typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; private: - friend class content::BrowserChildProcessHostIterator; + friend class BrowserChildProcessHostIterator; static BrowserChildProcessList* GetIterator(); @@ -86,11 +84,13 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl // ChildProcessLauncher::Client implementation. virtual void OnProcessLaunched() OVERRIDE; - content::ChildProcessData data_; - content::BrowserChildProcessHostDelegate* delegate_; - scoped_ptr<content::ChildProcessHost> child_process_host_; + ChildProcessData data_; + BrowserChildProcessHostDelegate* delegate_; + scoped_ptr<ChildProcessHost> child_process_host_; scoped_ptr<ChildProcessLauncher> child_process_; }; +} // namespace content + #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 53501bf..cf59b5d 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -91,8 +91,7 @@ #undef DestroyAll #endif -using content::TraceControllerImpl; - +namespace content { namespace { #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) @@ -185,8 +184,6 @@ static void SetUpGLibLogHandler() { } // namespace -namespace content { - // The currently-running BrowserMainLoop. There can be one or zero. BrowserMainLoop* g_current_browser_main_loop = NULL; @@ -201,9 +198,9 @@ class BrowserShutdownImpl { #if defined(OS_WIN) // At this point the message loop is still running yet we've shut everything // down. If any messages are processed we'll likely crash. Exit now. - ExitProcess(content::RESULT_CODE_NORMAL_EXIT); + ExitProcess(RESULT_CODE_NORMAL_EXIT); #elif defined(OS_POSIX) && !defined(OS_MACOSX) - _exit(content::RESULT_CODE_NORMAL_EXIT); + _exit(RESULT_CODE_NORMAL_EXIT); #else NOTIMPLEMENTED(); #endif @@ -225,10 +222,10 @@ media_stream::MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { } // BrowserMainLoop construction / destruction ============================= -BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) +BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) : parameters_(parameters), parsed_command_line_(parameters.command_line), - result_code_(content::RESULT_CODE_NORMAL_EXIT) { + result_code_(RESULT_CODE_NORMAL_EXIT) { DCHECK(!g_current_browser_main_loop); g_current_browser_main_loop = this; } @@ -304,7 +301,7 @@ void BrowserMainLoop::EarlyInitialization() { switches::kRendererProcessLimit); size_t process_limit; if (base::StringToSizeT(limit_string, &process_limit)) { - content::RenderProcessHost::SetMaxRendererProcessCount(process_limit); + RenderProcessHost::SetMaxRendererProcessCount(process_limit); } } #endif // !defined(OS_IOS) @@ -460,7 +457,7 @@ void BrowserMainLoop::CreateThreads() { BrowserThread::IO, FROM_HERE, base::Bind( base::IgnoreResult(&GpuProcessHost::Get), GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, - content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); + CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); } #endif // !defined(OS_IOS) @@ -639,7 +636,7 @@ void BrowserMainLoop::BrowserThreadsStarted() { #if !defined(OS_IOS) HistogramSynchronizer::GetInstance(); - content::BrowserGpuChannelHostFactory::Initialize(); + BrowserGpuChannelHostFactory::Initialize(); #if defined(USE_AURA) ImageTransportFactory::Initialize(); #endif diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 4715904..82a0f2b 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -39,7 +39,7 @@ #include "base/global_descriptors_posix.h" #endif -using content::BrowserThread; +namespace content { // Having the functionality of ChildProcessLauncher be in an internal // ref counted object allows us to automatically terminate the process when the @@ -51,7 +51,7 @@ class ChildProcessLauncher::Context : client_(NULL), client_thread_id_(BrowserThread::UI), termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION), - exit_code_(content::RESULT_CODE_NORMAL_EXIT), + exit_code_(RESULT_CODE_NORMAL_EXIT), starting_(true) #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) , zygote_(false) @@ -167,15 +167,15 @@ class ChildProcessLauncher::Context #elif defined(OS_ANDROID) std::string process_type = cmd_line->GetSwitchValueASCII(switches::kProcessType); - std::vector<content::FileDescriptorInfo> files_to_register; + std::vector<FileDescriptorInfo> files_to_register; files_to_register.push_back( - content::FileDescriptorInfo(kPrimaryIPCChannel, + FileDescriptorInfo(kPrimaryIPCChannel, base::FileDescriptor(ipcfd, false))); - content::GetContentClient()->browser()-> + GetContentClient()->browser()-> GetAdditionalMappedFilesForChildProcess(*cmd_line, &files_to_register); - content::StartSandboxedProcess(cmd_line->argv(), files_to_register, + StartSandboxedProcess(cmd_line->argv(), files_to_register, base::Bind(&ChildProcessLauncher::Context::OnSandboxedProcessStarted, this_object, client_thread_id)); @@ -187,13 +187,13 @@ class ChildProcessLauncher::Context std::string process_type = cmd_line->GetSwitchValueASCII(switches::kProcessType); - std::vector<content::FileDescriptorInfo> files_to_register; + std::vector<FileDescriptorInfo> files_to_register; files_to_register.push_back( - content::FileDescriptorInfo(kPrimaryIPCChannel, + FileDescriptorInfo(kPrimaryIPCChannel, base::FileDescriptor(ipcfd, false))); #if !defined(OS_MACOSX) - content::GetContentClient()->browser()-> + GetContentClient()->browser()-> GetAdditionalMappedFilesForChildProcess(*cmd_line, &files_to_register); if (use_zygote) { handle = ZygoteHostImpl::GetInstance()->ForkRequest(cmd_line->argv(), @@ -205,9 +205,9 @@ class ChildProcessLauncher::Context { // Convert FD mapping to FileHandleMappingVector base::FileHandleMappingVector fds_to_map; - for (std::vector<content::FileDescriptorInfo>::const_iterator + for (std::vector<FileDescriptorInfo>::const_iterator i = files_to_register.begin(); i != files_to_register.end(); ++i) { - const content::FileDescriptorInfo& fd_info = *i; + const FileDescriptorInfo& fd_info = *i; fds_to_map.push_back(std::make_pair( fd_info.fd.fd, fd_info.id + base::GlobalDescriptors::kBaseDescriptor)); @@ -329,12 +329,12 @@ class ChildProcessLauncher::Context base::ProcessHandle handle) { #if defined(OS_ANDROID) LOG(INFO) << "ChromeProcess: Stopping process with handle " << handle; - content::StopSandboxedProcess(handle); + StopSandboxedProcess(handle); #else base::Process process(handle); // Client has gone away, so just kill the process. Using exit code 0 // means that UMA won't treat this as a crash. - process.Terminate(content::RESULT_CODE_NORMAL_EXIT); + process.Terminate(RESULT_CODE_NORMAL_EXIT); // On POSIX, we must additionally reap the child. #if defined(OS_POSIX) #if !defined(OS_MACOSX) @@ -456,3 +456,5 @@ void ChildProcessLauncher::SetTerminateChildOnShutdown( if (context_) context_->set_terminate_child_on_shutdown(terminate_on_shutdown); } + +} // namespace content diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index 8f610b2..efc1f74 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h @@ -12,6 +12,8 @@ class CommandLine; +namespace content { + // Launches a process asynchronously and notifies the client of the process // handle when it's available. It's used to avoid blocking the calling thread // on the OS since often it can take > 100 ms to create the process. @@ -72,4 +74,6 @@ class CONTENT_EXPORT ChildProcessLauncher { DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); }; +} // namespace content + #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index d03bb4a..5f964c0 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -46,6 +46,7 @@ #include "ui/surface/accelerated_surface_win.h" #endif +using content::BrowserChildProcessHostImpl; using content::BrowserThread; using content::ChildProcessHost; using content::GpuChildThread; diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index 1ecd7d3..457fd5f 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h @@ -28,7 +28,9 @@ struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; struct GpuHostMsg_AcceleratedSurfaceRelease_Params; +namespace content { class BrowserChildProcessHostImpl; +} namespace IPC { struct ChannelHandle; @@ -217,7 +219,7 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, static bool hardware_gpu_enabled_; - scoped_ptr<BrowserChildProcessHostImpl> process_; + scoped_ptr<content::BrowserChildProcessHostImpl> process_; DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); }; diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc index a0cd639..b852dd3 100644 --- a/content/browser/plugin_loader_posix.cc +++ b/content/browser/plugin_loader_posix.cc @@ -14,8 +14,7 @@ #include "content/public/browser/browser_thread.h" #include "webkit/plugins/npapi/plugin_list.h" -using content::BrowserThread; -using content::ChildProcessHost; +namespace content { PluginLoaderPosix::PluginLoaderPosix() : next_load_index_(0) { @@ -23,7 +22,7 @@ PluginLoaderPosix::PluginLoaderPosix() void PluginLoaderPosix::LoadPlugins( scoped_refptr<base::MessageLoopProxy> target_loop, - const content::PluginService::GetPluginsCallback& callback) { + const PluginService::GetPluginsCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); callbacks_.push_back(PendingCallback(target_loop, callback)); @@ -190,10 +189,12 @@ bool PluginLoaderPosix::MaybeRunPendingCallbacks() { PluginLoaderPosix::PendingCallback::PendingCallback( scoped_refptr<base::MessageLoopProxy> loop, - const content::PluginService::GetPluginsCallback& cb) + const PluginService::GetPluginsCallback& cb) : target_loop(loop), callback(cb) { } PluginLoaderPosix::PendingCallback::~PendingCallback() { } + +} // namespace content diff --git a/content/browser/plugin_loader_posix.h b/content/browser/plugin_loader_posix.h index ad9e9f1..dca29ef 100644 --- a/content/browser/plugin_loader_posix.h +++ b/content/browser/plugin_loader_posix.h @@ -23,7 +23,6 @@ class MessageLoopProxy; namespace content { class UtilityProcessHost; -} // This class is responsible for managing the out-of-process plugin loading on // POSIX systems. It primarily lives on the IO thread, but has a brief stay on @@ -47,7 +46,7 @@ class UtilityProcessHost; // end, after which the list of loaded plugins is set on the PluginList and // the completion callback is run. class CONTENT_EXPORT PluginLoaderPosix - : public NON_EXPORTED_BASE(content::UtilityProcessHostClient), + : public NON_EXPORTED_BASE(UtilityProcessHostClient), public IPC::Sender { public: PluginLoaderPosix(); @@ -55,7 +54,7 @@ class CONTENT_EXPORT PluginLoaderPosix // Must be called from the IO thread. void LoadPlugins( scoped_refptr<base::MessageLoopProxy> target_loop, - const content::PluginService::GetPluginsCallback& callback); + const PluginService::GetPluginsCallback& callback); // UtilityProcessHostClient: virtual void OnProcessCrashed(int exit_code) OVERRIDE; @@ -67,11 +66,11 @@ class CONTENT_EXPORT PluginLoaderPosix private: struct PendingCallback { PendingCallback(scoped_refptr<base::MessageLoopProxy> target_loop, - const content::PluginService::GetPluginsCallback& callback); + const PluginService::GetPluginsCallback& callback); ~PendingCallback(); scoped_refptr<base::MessageLoopProxy> target_loop; - content::PluginService::GetPluginsCallback callback; + PluginService::GetPluginsCallback callback; }; virtual ~PluginLoaderPosix(); @@ -96,7 +95,7 @@ class CONTENT_EXPORT PluginLoaderPosix bool MaybeRunPendingCallbacks(); // The process host for which this is a client. - base::WeakPtr<content::UtilityProcessHost> process_host_; + base::WeakPtr<UtilityProcessHost> process_host_; // A list of paths to plugins which will be loaded by the utility process, in // the order specified by this vector. @@ -123,4 +122,6 @@ class CONTENT_EXPORT PluginLoaderPosix DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); }; +} // namespace content + #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc index d81a99c..5c8e200 100644 --- a/content/browser/plugin_loader_posix_unittest.cc +++ b/content/browser/plugin_loader_posix_unittest.cc @@ -15,8 +15,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/plugins/webplugininfo.h" -using content::BrowserThread; -using content::BrowserThreadImpl; +namespace content { class MockPluginLoaderPosix : public PluginLoaderPosix { public: @@ -107,7 +106,7 @@ class PluginLoaderPosixTest : public testing::Test { TEST_F(PluginLoaderPosixTest, QueueRequests) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); EXPECT_EQ(0u, plugin_loader()->number_of_pending_callbacks()); @@ -141,7 +140,7 @@ TEST_F(PluginLoaderPosixTest, QueueRequests) { TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoads) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -182,7 +181,7 @@ TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoads) { TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoadsThenCrash) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -225,7 +224,7 @@ TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoadsThenCrash) { TEST_F(PluginLoaderPosixTest, TwoFailures) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -264,7 +263,7 @@ TEST_F(PluginLoaderPosixTest, TwoFailures) { TEST_F(PluginLoaderPosixTest, CrashedProcess) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -297,7 +296,7 @@ TEST_F(PluginLoaderPosixTest, CrashedProcess) { TEST_F(PluginLoaderPosixTest, InternalPlugin) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -346,7 +345,7 @@ TEST_F(PluginLoaderPosixTest, InternalPlugin) { TEST_F(PluginLoaderPosixTest, AllCrashed) { int did_callback = 0; - content::PluginService::GetPluginsCallback callback = + PluginService::GetPluginsCallback callback = base::Bind(&VerifyCallback, base::Unretained(&did_callback)); plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback); @@ -376,3 +375,5 @@ TEST_F(PluginLoaderPosixTest, AllCrashed) { EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); } + +} // namespace content diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index 7d8b89f..f95577d 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -39,10 +39,6 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gl/gl_switches.h" -using content::BrowserThread; -using content::ChildProcessData; -using content::ChildProcessHost; - #if defined(USE_X11) #include "ui/gfx/gtk_native_view_id_manager.h" #endif @@ -57,7 +53,11 @@ using content::ChildProcessHost; #include "base/win/windows_version.h" #include "webkit/plugins/npapi/plugin_constants_win.h" #include "webkit/plugins/npapi/webplugin_delegate_impl.h" +#endif + +namespace content { +#if defined(OS_WIN) void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) { // The window is destroyed at this point, we just care about its parent, which // is the intermediate window we created. @@ -91,8 +91,7 @@ PluginProcessHost::PluginProcessHost() : plugin_cursor_visible_(true) #endif { - process_.reset( - new BrowserChildProcessHostImpl(content::PROCESS_TYPE_PLUGIN, this)); + process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_PLUGIN, this)); } PluginProcessHost::~PluginProcessHost() { @@ -208,8 +207,7 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { if (!plugin_launcher.empty()) cmd_line->PrependWrapper(plugin_launcher); - std::string locale = - content::GetContentClient()->browser()->GetApplicationLocale(); + std::string locale = GetContentClient()->browser()->GetApplicationLocale(); if (!locale.empty()) { // Pass on the locale so the null plugin will use the right language in the // prompt to install the desired plugin. @@ -222,21 +220,18 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { base::EnvironmentVector env; #if defined(OS_MACOSX) && !defined(__LP64__) if (!browser_command_line.HasSwitch(switches::kDisableCarbonInterposing)) { - std::string interpose_list = - content::GetContentClient()->GetCarbonInterposePath(); + std::string interpose_list = GetContentClient()->GetCarbonInterposePath(); if (!interpose_list.empty()) { // Add our interposing library for Carbon. This is stripped back out in // plugin_main.cc, so changes here should be reflected there. - const char* existing_list = - getenv(plugin_interpose_strings::kDYLDInsertLibrariesKey); + const char* existing_list = getenv(kDYLDInsertLibrariesKey); if (existing_list) { interpose_list.insert(0, ":"); interpose_list.insert(0, existing_list); } } env.push_back(std::pair<std::string, std::string>( - plugin_interpose_strings::kDYLDInsertLibrariesKey, - interpose_list)); + kDYLDInsertLibrariesKey, interpose_list)); } #endif #endif @@ -333,7 +328,7 @@ void PluginProcessHost::CancelRequests() { // static void PluginProcessHost::CancelPendingRequestsForResourceContext( - content::ResourceContext* context) { + ResourceContext* context) { for (PluginProcessHostIterator host_it; !host_it.Done(); ++host_it) { PluginProcessHost* host = *host_it; for (size_t i = 0; i < host->pending_requests_.size(); ++i) { @@ -347,7 +342,7 @@ void PluginProcessHost::CancelPendingRequestsForResourceContext( } void PluginProcessHost::OpenChannelToPlugin(Client* client) { - process_->Notify(content::NOTIFICATION_CHILD_INSTANCE_CREATED); + process_->Notify(NOTIFICATION_CHILD_INSTANCE_CREATED); client->SetPluginInfo(info_); if (process_->GetHost()->IsChannelOpening()) { // The channel is already in the process of being opened. Put @@ -412,3 +407,5 @@ void PluginProcessHost::OnChannelCreated( client->OnChannelOpened(channel_handle); sent_requests_.pop_front(); } + +} // namespace content diff --git a/content/browser/plugin_process_host.h b/content/browser/plugin_process_host.h index 12e391d..3795df3 100644 --- a/content/browser/plugin_process_host.h +++ b/content/browser/plugin_process_host.h @@ -22,12 +22,6 @@ #include "webkit/plugins/webplugininfo.h" #include "ui/gfx/native_widget_types.h" -class BrowserChildProcessHostImpl; - -namespace content { -class ResourceContext; -} - namespace gfx { class Rect; } @@ -36,6 +30,10 @@ namespace IPC { struct ChannelHandle; } +namespace content { +class BrowserChildProcessHostImpl; +class ResourceContext; + // Represents the browser side of the browser <--> plugin communication // channel. Different plugins run in their own process, but multiple instances // of the same plugin run in the same process. There will be one @@ -44,9 +42,8 @@ struct ChannelHandle; // starting the plugin process when a plugin is created that doesn't already // have a process. After that, most of the communication is directly between // the renderer and plugin processes. -class CONTENT_EXPORT PluginProcessHost - : public content::BrowserChildProcessHostDelegate, - public IPC::Sender { +class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate, + public IPC::Sender { public: class Client { public: @@ -54,7 +51,7 @@ class CONTENT_EXPORT PluginProcessHost // the channel. virtual int ID() = 0; // Returns the resource context for the renderer requesting the channel. - virtual content::ResourceContext* GetResourceContext() = 0; + virtual ResourceContext* GetResourceContext() = 0; virtual bool OffTheRecord() = 0; virtual void SetPluginInfo(const webkit::WebPluginInfo& info) = 0; virtual void OnFoundPluginProcessHost(PluginProcessHost* host) = 0; @@ -90,8 +87,7 @@ class CONTENT_EXPORT PluginProcessHost void OpenChannelToPlugin(Client* client); // Cancels all pending channel requests for the given resource context. - static void CancelPendingRequestsForResourceContext( - content::ResourceContext* context); + static void CancelPendingRequestsForResourceContext(ResourceContext* context); // This function is called to cancel pending requests to open new channels. void CancelPendingRequest(Client* client); @@ -183,11 +179,13 @@ class CONTENT_EXPORT PluginProcessHost }; class PluginProcessHostIterator - : public content::BrowserChildProcessHostTypeIterator<PluginProcessHost> { + : public BrowserChildProcessHostTypeIterator<PluginProcessHost> { public: PluginProcessHostIterator() - : content::BrowserChildProcessHostTypeIterator<PluginProcessHost>( - content::PROCESS_TYPE_PLUGIN) {} + : BrowserChildProcessHostTypeIterator<PluginProcessHost>( + PROCESS_TYPE_PLUGIN) {} }; +} // namespace content + #endif // CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ diff --git a/content/browser/plugin_process_host_mac.cc b/content/browser/plugin_process_host_mac.cc index 2638f46..5c7916a 100644 --- a/content/browser/plugin_process_host_mac.cc +++ b/content/browser/plugin_process_host_mac.cc @@ -19,7 +19,7 @@ #include "content/public/browser/child_process_data.h" #include "ui/gfx/rect.h" -using content::BrowserThread; +namespace content { void PluginProcessHost::OnPluginSelectWindow(uint32 window_id, gfx::Rect window_rect, @@ -112,3 +112,5 @@ void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) { visible)); } } + +} // namespace content diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 6d8d7af..2f81ed0 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -44,11 +44,7 @@ using ::base::files::FilePathWatcher; #endif -using content::BrowserThread; -using content::PepperPluginRegistry; -using content::PluginService; -using content::PluginServiceFilter; - +namespace content { namespace { // Callback set on the PluginList to assert that plugin loading happens on the @@ -84,8 +80,8 @@ class PluginDirWatcherDelegate : public FilePathWatcher::Delegate { webkit::npapi::PluginList::Singleton()->RefreshPlugins(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&content::PluginService::PurgePluginListCache, - static_cast<content::BrowserContext*>(NULL), false)); + base::Bind(&PluginService::PurgePluginListCache, + static_cast<BrowserContext*>(NULL), false)); } virtual void OnFilePathError(const FilePath& path) OVERRIDE { @@ -99,7 +95,6 @@ class PluginDirWatcherDelegate : public FilePathWatcher::Delegate { }; #endif -namespace content { // static PluginService* PluginService::GetInstance() { return PluginServiceImpl::GetInstance(); @@ -115,8 +110,6 @@ void PluginService::PurgePluginListCache(BrowserContext* browser_context, } } -} // namespace content - // static PluginServiceImpl* PluginServiceImpl::GetInstance() { return Singleton<PluginServiceImpl>::get(); @@ -155,7 +148,7 @@ void PluginServiceImpl::Init() { RegisterPepperPlugins(); - content::GetContentClient()->AddNPAPIPlugins(plugin_list_); + GetContentClient()->AddNPAPIPlugins(plugin_list_); // Load any specified on the command line as well. const CommandLine* command_line = CommandLine::ForCurrentProcess(); @@ -283,7 +276,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( return plugin_host; // Validate that the plugin is actually registered. - content::PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); + PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); if (!info) return NULL; @@ -302,7 +295,7 @@ PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( return plugin_host; // Validate that the plugin is actually registered. - content::PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); + PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); if (!info) return NULL; @@ -387,7 +380,7 @@ void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( const GURL& page_url, const std::string& mime_type, PluginProcessHost::Client* client, - content::ResourceContext* resource_context) { + ResourceContext* resource_context) { webkit::WebPluginInfo info; bool allow_wildcard = true; bool found = GetPluginInfo( @@ -438,7 +431,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_view_id, - content::ResourceContext* context, + ResourceContext* context, const GURL& url, const GURL& page_url, const std::string& mime_type, @@ -575,9 +568,9 @@ void PluginServiceImpl::RegisterPepperPlugins() { } // There should generally be very few plugins so a brute-force search is fine. -content::PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( +PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( const FilePath& plugin_path) { - content::PepperPluginInfo* info = NULL; + PepperPluginInfo* info = NULL; for (size_t i = 0; i < ppapi_plugins_.size(); i++) { if (ppapi_plugins_[i].path == plugin_path) { info = &ppapi_plugins_[i]; @@ -594,7 +587,7 @@ content::PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( webkit::WebPluginInfo webplugin_info; if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) return NULL; - content::PepperPluginInfo new_pepper_info; + PepperPluginInfo new_pepper_info; if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) return NULL; ppapi_plugins_.push_back(new_pepper_info); @@ -612,11 +605,11 @@ void PluginServiceImpl::RegisterFilePathWatcher( } #endif -void PluginServiceImpl::SetFilter(content::PluginServiceFilter* filter) { +void PluginServiceImpl::SetFilter(PluginServiceFilter* filter) { filter_ = filter; } -content::PluginServiceFilter* PluginServiceImpl::GetFilter() { +PluginServiceFilter* PluginServiceImpl::GetFilter() { return filter_; } @@ -715,3 +708,5 @@ void PluginServiceImpl::GetInternalPlugins( webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { return plugin_list_; } + +} // namespace content diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index a185fec..6bca392 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -36,43 +36,41 @@ #include "base/files/file_path_watcher.h" #endif -class PluginDirWatcherDelegate; -class PluginLoaderPosix; - namespace base { class MessageLoopProxy; } -namespace content { -class BrowserContext; -class PluginServiceFilter; -class ResourceContext; -struct PepperPluginInfo; -} - namespace webkit { namespace npapi { class PluginList; } } +namespace content { +class BrowserContext; +class PluginDirWatcherDelegate; +class PluginLoaderPosix; +class PluginServiceFilter; +class ResourceContext; +struct PepperPluginInfo; + // base::Bind() has limited arity, and the filter-related methods tend to // surpass that limit. struct PluginServiceFilterParams { int render_process_id; int render_view_id; GURL page_url; - content::ResourceContext* resource_context; + ResourceContext* resource_context; }; class CONTENT_EXPORT PluginServiceImpl - : NON_EXPORTED_BASE(public content::PluginService), + : NON_EXPORTED_BASE(public PluginService), public base::WaitableEventWatcher::Delegate { public: // Returns the PluginServiceImpl singleton. static PluginServiceImpl* GetInstance(); - // content::PluginService implementation: + // PluginService implementation: virtual void Init() OVERRIDE; virtual void StartWatchingPlugins() OVERRIDE; virtual bool GetPluginInfoArray( @@ -83,7 +81,7 @@ class CONTENT_EXPORT PluginServiceImpl std::vector<std::string>* actual_mime_types) OVERRIDE; virtual bool GetPluginInfo(int render_process_id, int render_view_id, - content::ResourceContext* context, + ResourceContext* context, const GURL& url, const GURL& page_url, const std::string& mime_type, @@ -95,10 +93,10 @@ class CONTENT_EXPORT PluginServiceImpl webkit::WebPluginInfo* info) OVERRIDE; virtual string16 GetPluginDisplayNameByPath(const FilePath& path) OVERRIDE; virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; - virtual content::PepperPluginInfo* GetRegisteredPpapiPluginInfo( + virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( const FilePath& plugin_path) OVERRIDE; - virtual void SetFilter(content::PluginServiceFilter* filter) OVERRIDE; - virtual content::PluginServiceFilter* GetFilter() OVERRIDE; + virtual void SetFilter(PluginServiceFilter* filter) OVERRIDE; + virtual PluginServiceFilter* GetFilter() OVERRIDE; virtual void ForcePluginShutdown(const FilePath& plugin_path) OVERRIDE; virtual bool IsPluginUnstable(const FilePath& plugin_path) OVERRIDE; virtual void RefreshPlugins() OVERRIDE; @@ -196,7 +194,7 @@ class CONTENT_EXPORT PluginServiceImpl const GURL& page_url, const std::string& mime_type, PluginProcessHost::Client* client, - content::ResourceContext* resource_context); + ResourceContext* resource_context); // Helper so we can finish opening the channel after looking up the // plugin. @@ -230,10 +228,10 @@ class CONTENT_EXPORT PluginServiceImpl scoped_refptr<PluginDirWatcherDelegate> file_watcher_delegate_; #endif - std::vector<content::PepperPluginInfo> ppapi_plugins_; + std::vector<PepperPluginInfo> ppapi_plugins_; // Weak pointer; outlives us. - content::PluginServiceFilter* filter_; + PluginServiceFilter* filter_; std::set<PluginProcessHost::Client*> pending_plugin_clients_; @@ -251,4 +249,6 @@ class CONTENT_EXPORT PluginServiceImpl DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); }; +} // namespace content + #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 4669da0..07a42b6 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -26,8 +26,7 @@ #include "ui/base/ui_base_switches.h" #include "webkit/plugins/plugin_switches.h" -using content::ChildProcessHost; -using content::ChildProcessHostImpl; +namespace content { class PpapiPluginProcessHost::PluginNetworkObserver : public net::NetworkChangeNotifier::IPAddressObserver, @@ -74,7 +73,7 @@ PpapiPluginProcessHost::~PpapiPluginProcessHost() { // static PpapiPluginProcessHost* PpapiPluginProcessHost::CreatePluginHost( - const content::PepperPluginInfo& info, + const PepperPluginInfo& info, const FilePath& profile_data_directory, net::HostResolver* host_resolver) { PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost( @@ -88,7 +87,7 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreatePluginHost( // static PpapiPluginProcessHost* PpapiPluginProcessHost::CreateBrokerHost( - const content::PepperPluginInfo& info) { + const PepperPluginInfo& info) { PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost(); if (plugin_host->Init(info)) @@ -158,7 +157,7 @@ void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) { } PpapiPluginProcessHost::PpapiPluginProcessHost( - const content::PepperPluginInfo& info, + const PepperPluginInfo& info, const FilePath& profile_data_directory, net::HostResolver* host_resolver) : permissions_( @@ -167,12 +166,12 @@ PpapiPluginProcessHost::PpapiPluginProcessHost( profile_data_directory_(profile_data_directory), is_broker_(false) { process_.reset(new BrowserChildProcessHostImpl( - content::PROCESS_TYPE_PPAPI_PLUGIN, this)); + PROCESS_TYPE_PPAPI_PLUGIN, this)); filter_ = new PepperMessageFilter(PepperMessageFilter::PLUGIN, host_resolver); - host_impl_ = new content::BrowserPpapiHostImpl(this, permissions_); + host_impl_ = new BrowserPpapiHostImpl(this, permissions_); file_filter_ = new PepperTrustedFileMessageFilter( process_->GetData().id, info.name, profile_data_directory); @@ -181,19 +180,19 @@ PpapiPluginProcessHost::PpapiPluginProcessHost( process_->GetHost()->AddFilter(file_filter_.get()); process_->GetHost()->AddFilter(host_impl_.get()); - content::GetContentClient()->browser()->DidCreatePpapiPlugin(host_impl_); + GetContentClient()->browser()->DidCreatePpapiPlugin(host_impl_); } PpapiPluginProcessHost::PpapiPluginProcessHost() : is_broker_(true) { process_.reset(new BrowserChildProcessHostImpl( - content::PROCESS_TYPE_PPAPI_BROKER, this)); + PROCESS_TYPE_PPAPI_BROKER, this)); ppapi::PpapiPermissions permissions; // No permissions. - host_impl_ = new content::BrowserPpapiHostImpl(this, permissions); + host_impl_ = new BrowserPpapiHostImpl(this, permissions); } -bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { +bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { plugin_path_ = info.path; if (info.name.empty()) { process_->SetName(plugin_path_.BaseName().LossyDisplayName()); @@ -248,8 +247,7 @@ bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { arraysize(kPluginForwardSwitches)); } - std::string locale = - content::GetContentClient()->browser()->GetApplicationLocale(); + std::string locale = GetContentClient()->browser()->GetApplicationLocale(); if (!locale.empty()) { // Pass on the locale so the plugin will know what language we're using. cmd_line->AppendSwitchASCII(switches::kLang, locale); @@ -366,3 +364,5 @@ void PpapiPluginProcessHost::OnRendererPluginChannelCreated( client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); } + +} // namespace content diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h index b19536e..e472c11 100644 --- a/content/browser/ppapi_plugin_process_host.h +++ b/content/browser/ppapi_plugin_process_host.h @@ -20,20 +20,18 @@ #include "ipc/ipc_sender.h" #include "ppapi/shared_impl/ppapi_permissions.h" -class BrowserChildProcessHostImpl; - -namespace content { -struct PepperPluginInfo; -class ResourceContext; -} - namespace net { class HostResolver; } +namespace content { +class BrowserChildProcessHostImpl; +class ResourceContext; +struct PepperPluginInfo; + // Process host for PPAPI plugin and broker processes. // When used for the broker, interpret all references to "plugin" with "broker". -class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, +class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, public IPC::Sender { public: class Client { @@ -61,7 +59,7 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, class PluginClient : public Client { public: // Returns the resource context for the renderer requesting the channel. - virtual content::ResourceContext* GetResourceContext() = 0; + virtual ResourceContext* GetResourceContext() = 0; protected: virtual ~PluginClient() {} @@ -75,11 +73,11 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, virtual ~PpapiPluginProcessHost(); static PpapiPluginProcessHost* CreatePluginHost( - const content::PepperPluginInfo& info, + const PepperPluginInfo& info, const FilePath& profile_data_directory, net::HostResolver* host_resolver); static PpapiPluginProcessHost* CreateBrokerHost( - const content::PepperPluginInfo& info); + const PepperPluginInfo& info); // Notification that a PP_Instance has been created for the given // RenderView/Process pair for the given plugin. This is necessary so that @@ -113,14 +111,14 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, // Constructors for plugin and broker process hosts, respectively. // You must call Init before doing anything else. - PpapiPluginProcessHost(const content::PepperPluginInfo& info, + PpapiPluginProcessHost(const PepperPluginInfo& info, const FilePath& profile_data_directory, net::HostResolver* host_resolver); PpapiPluginProcessHost(); // Actually launches the process with the given plugin info. Returns true // on success (the process was spawned). - bool Init(const content::PepperPluginInfo& info); + bool Init(const PepperPluginInfo& info); void RequestPluginChannel(Client* client); @@ -140,7 +138,7 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, scoped_refptr<PepperMessageFilter> filter_; ppapi::PpapiPermissions permissions_; - scoped_refptr<content::BrowserPpapiHostImpl> host_impl_; + scoped_refptr<BrowserPpapiHostImpl> host_impl_; // Handles filesystem requests from flash plugins. May be NULL. scoped_refptr<PepperFileMessageFilter> file_filter_; @@ -170,22 +168,24 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, }; class PpapiPluginProcessHostIterator - : public content::BrowserChildProcessHostTypeIterator< + : public BrowserChildProcessHostTypeIterator< PpapiPluginProcessHost> { public: PpapiPluginProcessHostIterator() - : content::BrowserChildProcessHostTypeIterator< - PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {} + : BrowserChildProcessHostTypeIterator< + PpapiPluginProcessHost>(PROCESS_TYPE_PPAPI_PLUGIN) {} }; class PpapiBrokerProcessHostIterator - : public content::BrowserChildProcessHostTypeIterator< + : public BrowserChildProcessHostTypeIterator< PpapiPluginProcessHost> { public: PpapiBrokerProcessHostIterator() - : content::BrowserChildProcessHostTypeIterator< - PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} + : BrowserChildProcessHostTypeIterator< + PpapiPluginProcessHost>(PROCESS_TYPE_PPAPI_BROKER) {} }; +} // namespace content + #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ diff --git a/content/browser/renderer_host/java/java_bridge_channel_host.h b/content/browser/renderer_host/java/java_bridge_channel_host.h index 6c64437..503d554 100644 --- a/content/browser/renderer_host/java/java_bridge_channel_host.h +++ b/content/browser/renderer_host/java/java_bridge_channel_host.h @@ -7,7 +7,7 @@ #include "content/common/np_channel_base.h" -class JavaBridgeChannelHost : public NPChannelBase { +class JavaBridgeChannelHost : public content::NPChannelBase { public: static JavaBridgeChannelHost* GetJavaBridgeChannelHost( int renderer_id, diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc index 65cd52e..c6b8640 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc @@ -18,6 +18,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" using content::BrowserThread; +using content::NPObjectStub; +using content::NPVariant_Param; using content::RenderViewHost; namespace { @@ -114,7 +116,7 @@ void JavaBridgeDispatcherHost::CreateNPVariantParam(NPObject* object, // Create an NPVariantParam suitable for serialization over IPC from our // NPVariant. See CreateNPVariantParam() in npobject_utils. - param->type = NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID; + param->type = content::NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID; int route_id = JavaBridgeChannelHost::ThreadsafeGenerateRouteID(); param->npobject_routing_id = route_id; diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h index 5be526b..eb71b5a 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h @@ -9,13 +9,13 @@ #include "base/string16.h" #include "content/public/browser/render_view_host_observer.h" -class NPChannelBase; class RouteIDGenerator; struct NPObject; -struct NPVariant_Param; namespace content { +class NPChannelBase; class RenderViewHost; +struct NPVariant_Param; } // This class handles injecting Java objects into a single RenderView. The Java @@ -58,10 +58,10 @@ class JavaBridgeDispatcherHost void OnGetChannelHandle(IPC::Message* reply_msg); void GetChannelHandle(IPC::Message* reply_msg); - void CreateNPVariantParam(NPObject* object, NPVariant_Param* param); + void CreateNPVariantParam(NPObject* object, content::NPVariant_Param* param); void CreateObjectStub(NPObject* object, int route_id); - scoped_refptr<NPChannelBase> channel_; + scoped_refptr<content::NPChannelBase> channel_; bool is_renderer_initialized_; DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 7e3afc3..a1205ca 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -31,7 +31,6 @@ #endif class DOMStorageContextImpl; -class PluginServiceImpl; struct FontDescriptor; struct ViewHostMsg_CreateWindow_Params; @@ -63,6 +62,7 @@ struct WebPluginInfo; namespace content { class BrowserContext; class MediaObserver; +class PluginServiceImpl; class RenderWidgetHelper; class ResourceContext; class ResourceDispatcherHostImpl; diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc index 0249836..47fe315 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -36,11 +36,12 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontInfo.h" #include "ui/gfx/font_render_params_linux.h" -using content::LinuxSandbox; using WebKit::WebCString; using WebKit::WebFontInfo; using WebKit::WebUChar; +namespace content { + // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC // BEWARE: code in this file run across *processes* (not just threads). @@ -668,7 +669,7 @@ class SandboxIPCProcess { const int browser_socket_; scoped_ptr<FontConfigDirect> font_config_; std::vector<std::string> sandbox_cmd_; - scoped_ptr<content::WebKitPlatformSupportImpl> webkit_platform_support_; + scoped_ptr<WebKitPlatformSupportImpl> webkit_platform_support_; }; SandboxIPCProcess::~SandboxIPCProcess() { @@ -679,7 +680,7 @@ SandboxIPCProcess::~SandboxIPCProcess() { void SandboxIPCProcess::EnsureWebKitInitialized() { if (webkit_platform_support_.get()) return; - webkit_platform_support_.reset(new content::WebKitPlatformSupportImpl); + webkit_platform_support_.reset(new WebKitPlatformSupportImpl); WebKit::initializeWithoutV8(webkit_platform_support_.get()); } @@ -747,3 +748,5 @@ RenderSandboxHostLinux::~RenderSandboxHostLinux() { PLOG(ERROR) << "close"; } } + +} // namespace content diff --git a/content/browser/renderer_host/render_sandbox_host_linux.h b/content/browser/renderer_host/render_sandbox_host_linux.h index 87667cf..d9f7edb 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.h +++ b/content/browser/renderer_host/render_sandbox_host_linux.h @@ -14,6 +14,8 @@ template <typename T> struct DefaultSingletonTraits; +namespace content { + // This is a singleton object which handles sandbox requests from the // renderers. class CONTENT_EXPORT RenderSandboxHostLinux { @@ -49,4 +51,6 @@ class CONTENT_EXPORT RenderSandboxHostLinux { DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux); }; +} // namespace content + #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 82c3c53..5707aad 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -19,10 +19,6 @@ #include "ui/base/ui_base_switches.h" #include "webkit/plugins/plugin_switches.h" -using content::BrowserThread; -using content::ChildProcessHost; -using content::UtilityProcessHostClient; - namespace content { UtilityProcessHost* UtilityProcessHost::Create( @@ -31,8 +27,6 @@ UtilityProcessHost* UtilityProcessHost::Create( return new UtilityProcessHostImpl(client, client_thread_id); } -} // namespace content - UtilityProcessHostImpl::UtilityProcessHostImpl( UtilityProcessHostClient* client, BrowserThread::ID client_thread_id) @@ -47,8 +41,7 @@ UtilityProcessHostImpl::UtilityProcessHostImpl( #endif use_linux_zygote_(false), started_(false) { - process_.reset( - new BrowserChildProcessHostImpl(content::PROCESS_TYPE_UTILITY, this)); + process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_UTILITY, this)); } UtilityProcessHostImpl::~UtilityProcessHostImpl() { @@ -137,8 +130,7 @@ bool UtilityProcessHostImpl::StartProcess() { cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); - std::string locale = - content::GetContentClient()->browser()->GetApplicationLocale(); + std::string locale = GetContentClient()->browser()->GetApplicationLocale(); cmd_line->AppendSwitchASCII(switches::kLang, locale); if (browser_command_line.HasSwitch(switches::kChromeFrame)) @@ -198,3 +190,5 @@ void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), exit_code)); } + +} // namespace content diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h index e449412..4007881 100644 --- a/content/browser/utility_process_host_impl.h +++ b/content/browser/utility_process_host_impl.h @@ -15,14 +15,15 @@ #include "content/public/browser/browser_child_process_host_delegate.h" #include "content/public/browser/utility_process_host.h" +namespace content { class BrowserChildProcessHostImpl; class CONTENT_EXPORT UtilityProcessHostImpl - : public NON_EXPORTED_BASE(content::UtilityProcessHost), - public content::BrowserChildProcessHostDelegate { + : public NON_EXPORTED_BASE(UtilityProcessHost), + public BrowserChildProcessHostDelegate { public: - UtilityProcessHostImpl(content::UtilityProcessHostClient* client, - content::BrowserThread::ID client_thread_id); + UtilityProcessHostImpl(UtilityProcessHostClient* client, + BrowserThread::ID client_thread_id); virtual ~UtilityProcessHostImpl(); // UtilityProcessHost implementation: @@ -48,8 +49,8 @@ class CONTENT_EXPORT UtilityProcessHostImpl virtual void OnProcessCrashed(int exit_code) OVERRIDE; // A pointer to our client interface, who will be informed of progress. - scoped_refptr<content::UtilityProcessHostClient> client_; - content::BrowserThread::ID client_thread_id_; + scoped_refptr<UtilityProcessHostClient> client_; + BrowserThread::ID client_thread_id_; // True when running in batch mode, i.e., StartBatchMode() has been called // and the utility process will run until EndBatchMode(). bool is_batch_mode_; @@ -74,4 +75,6 @@ class CONTENT_EXPORT UtilityProcessHostImpl DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); }; +} // namespace content + #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ diff --git a/content/browser/worker_host/worker_process_host.h b/content/browser/worker_host/worker_process_host.h index 1fde05a..c1f5aad 100644 --- a/content/browser/worker_host/worker_process_host.h +++ b/content/browser/worker_host/worker_process_host.h @@ -20,7 +20,6 @@ #include "googleurl/src/gurl.h" #include "ipc/ipc_sender.h" -class BrowserChildProcessHostImpl; class ChromeAppCacheService; class IndexedDBContextImpl; @@ -33,6 +32,7 @@ class DatabaseTracker; } // namespace webkit_database namespace content { +class BrowserChildProcessHostImpl; class ResourceContext; class WorkerServiceImpl; diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index 647d902..bbe1efe 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc @@ -39,8 +39,10 @@ #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" #endif +namespace content { + // static -content::ZygoteHost* content::ZygoteHost::GetInstance() { +ZygoteHost* ZygoteHost::GetInstance() { return ZygoteHostImpl::GetInstance(); } @@ -82,7 +84,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); #endif base::FileHandleMappingVector fds_to_map; - fds_to_map.push_back(std::make_pair(fds[1], content::kZygoteSocketPairFd)); + fds_to_map.push_back(std::make_pair(fds[1], kZygoteSocketPairFd)); const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kZygoteCmdPrefix)) { @@ -117,8 +119,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { cmd_line.CopySwitchesFrom(browser_command_line, kForwardSwitches, arraysize(kForwardSwitches)); - content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( - &cmd_line, -1); + GetContentClient()->browser()->AppendExtraCommandLineSwitches(&cmd_line, -1); sandbox_binary_ = sandbox_cmd.c_str(); @@ -154,13 +155,13 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { // Start up the sandbox host process and get the file descriptor for the // renderers to talk to it. const int sfd = RenderSandboxHostLinux::GetInstance()->GetRendererSocket(); - fds_to_map.push_back(std::make_pair(sfd, content::kZygoteRendererSocketFd)); + fds_to_map.push_back(std::make_pair(sfd, kZygoteRendererSocketFd)); int dummy_fd = -1; if (using_suid_sandbox_) { dummy_fd = socket(PF_UNIX, SOCK_DGRAM, 0); CHECK(dummy_fd >= 0); - fds_to_map.push_back(std::make_pair(dummy_fd, content::kZygoteIdFd)); + fds_to_map.push_back(std::make_pair(dummy_fd, kZygoteIdFd)); } base::ProcessHandle process = -1; @@ -175,12 +176,12 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { // But first, wait for the zygote to tell us it's running. // The sending code is in content/browser/zygote_main_linux.cc. std::vector<int> fds_vec; - const int kExpectedLength = sizeof(content::kZygoteHelloMessage); + const int kExpectedLength = sizeof(kZygoteHelloMessage); char buf[kExpectedLength]; const ssize_t len = UnixDomainSocket::RecvMsg(fds[0], buf, sizeof(buf), &fds_vec); CHECK(len == kExpectedLength) << "Incorrect zygote magic length"; - CHECK(0 == strcmp(buf, content::kZygoteHelloMessage)) + CHECK(0 == strcmp(buf, kZygoteHelloMessage)) << "Incorrect zygote hello"; std::string inode_output; @@ -214,7 +215,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { control_fd_ = fds[0]; Pickle pickle; - pickle.WriteInt(content::kZygoteCommandGetSandboxStatus); + pickle.WriteInt(kZygoteCommandGetSandboxStatus); if (!SendMessage(pickle, NULL)) LOG(FATAL) << "Cannot communicate with zygote"; // We don't wait for the reply. We'll read it in ReadReply. @@ -222,9 +223,9 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { bool ZygoteHostImpl::SendMessage(const Pickle& data, const std::vector<int>* fds) { - CHECK(data.size() <= content::kZygoteMaxMessageLength) + CHECK(data.size() <= kZygoteMaxMessageLength) << "Trying to send too-large message to zygote (sending " << data.size() - << " bytes, max is " << content::kZygoteMaxMessageLength << ")"; + << " bytes, max is " << kZygoteMaxMessageLength << ")"; CHECK(!fds || fds->size() <= UnixDomainSocket::kMaxFileDescriptors) << "Trying to send message with too many file descriptors to zygote " << "(sending " << fds->size() << ", max is " @@ -253,12 +254,12 @@ ssize_t ZygoteHostImpl::ReadReply(void* buf, size_t buf_len) { pid_t ZygoteHostImpl::ForkRequest( const std::vector<std::string>& argv, - const std::vector<content::FileDescriptorInfo>& mapping, + const std::vector<FileDescriptorInfo>& mapping, const std::string& process_type) { DCHECK(init_); Pickle pickle; - pickle.WriteInt(content::kZygoteCommandFork); + pickle.WriteInt(kZygoteCommandFork); pickle.WriteString(process_type); pickle.WriteInt(argv.size()); for (std::vector<std::string>::const_iterator @@ -271,7 +272,7 @@ pid_t ZygoteHostImpl::ForkRequest( // Scoped pointers cannot be stored in containers, so we have to use a // linked_ptr. std::vector<linked_ptr<file_util::ScopedFD> > autodelete_fds; - for (std::vector<content::FileDescriptorInfo>::const_iterator + for (std::vector<FileDescriptorInfo>::const_iterator i = mapping.begin(); i != mapping.end(); ++i) { pickle.WriteUInt32(i->id); fds.push_back(i->fd.fd); @@ -446,7 +447,7 @@ void ZygoteHostImpl::EnsureProcessTerminated(pid_t process) { DCHECK(init_); Pickle pickle; - pickle.WriteInt(content::kZygoteCommandReap); + pickle.WriteInt(kZygoteCommandReap); pickle.WriteInt(process); if (!SendMessage(pickle, NULL)) LOG(ERROR) << "Failed to send Reap message to zygote"; @@ -457,12 +458,12 @@ base::TerminationStatus ZygoteHostImpl::GetTerminationStatus( int* exit_code) { DCHECK(init_); Pickle pickle; - pickle.WriteInt(content::kZygoteCommandGetTerminationStatus); + pickle.WriteInt(kZygoteCommandGetTerminationStatus); pickle.WriteInt(handle); // Set this now to handle the early termination cases. if (exit_code) - *exit_code = content::RESULT_CODE_NORMAL_EXIT; + *exit_code = RESULT_CODE_NORMAL_EXIT; static const unsigned kMaxMessageLength = 128; char buf[kMaxMessageLength]; @@ -510,3 +511,5 @@ int ZygoteHostImpl::GetSandboxStatus() const { return sandbox_status_; return 0; } + +} // namespace content diff --git a/content/browser/zygote_host/zygote_host_impl_linux.h b/content/browser/zygote_host/zygote_host_impl_linux.h index 8548a2b..8a6c778 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.h +++ b/content/browser/zygote_host/zygote_host_impl_linux.h @@ -17,7 +17,9 @@ template<typename Type> struct DefaultSingletonTraits; -class CONTENT_EXPORT ZygoteHostImpl : public content::ZygoteHost { +namespace content { + +class CONTENT_EXPORT ZygoteHostImpl : public ZygoteHost { public: // Returns the singleton instance. static ZygoteHostImpl* GetInstance(); @@ -28,7 +30,7 @@ class CONTENT_EXPORT ZygoteHostImpl : public content::ZygoteHost { // Returns its pid on success, otherwise // base::kNullProcessHandle; pid_t ForkRequest(const std::vector<std::string>& command_line, - const std::vector<content::FileDescriptorInfo>& mapping, + const std::vector<FileDescriptorInfo>& mapping, const std::string& process_type); void EnsureProcessTerminated(pid_t process); @@ -72,4 +74,6 @@ class CONTENT_EXPORT ZygoteHostImpl : public content::ZygoteHost { int sandbox_status_; }; +} // namespace content + #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ diff --git a/content/common/content_param_traits.cc b/content/common/content_param_traits.cc index a48ccc5..df91adb 100644 --- a/content/common/content_param_traits.cc +++ b/content/common/content_param_traits.cc @@ -11,6 +11,8 @@ #include "webkit/plugins/npapi/plugin_host.h" #include "ui/base/range/range.h" +namespace content { + NPIdentifier_Param::NPIdentifier_Param() : identifier() { } @@ -29,6 +31,11 @@ NPVariant_Param::NPVariant_Param() NPVariant_Param::~NPVariant_Param() { } +} // namespace content + +using content::NPIdentifier_Param; +using content::NPVariant_Param; + namespace IPC { void ParamTraits<net::IPEndPoint>::Write(Message* m, const param_type& p) { @@ -52,22 +59,23 @@ void ParamTraits<net::IPEndPoint>::Log(const param_type& p, std::string* l) { void ParamTraits<NPVariant_Param>::Write(Message* m, const param_type& p) { WriteParam(m, static_cast<int>(p.type)); - if (p.type == NPVARIANT_PARAM_BOOL) { + if (p.type == content::NPVARIANT_PARAM_BOOL) { WriteParam(m, p.bool_value); - } else if (p.type == NPVARIANT_PARAM_INT) { + } else if (p.type == content::NPVARIANT_PARAM_INT) { WriteParam(m, p.int_value); - } else if (p.type == NPVARIANT_PARAM_DOUBLE) { + } else if (p.type == content::NPVARIANT_PARAM_DOUBLE) { WriteParam(m, p.double_value); - } else if (p.type == NPVARIANT_PARAM_STRING) { + } else if (p.type == content::NPVARIANT_PARAM_STRING) { WriteParam(m, p.string_value); - } else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || - p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { + } else if (p.type == content::NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || + p.type == content::NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { // This is the routing id used to connect NPObjectProxy in the other // process with NPObjectStub in this process or to identify the raw // npobject pointer to be used in the callee process. WriteParam(m, p.npobject_routing_id); } else { - DCHECK(p.type == NPVARIANT_PARAM_VOID || p.type == NPVARIANT_PARAM_NULL); + DCHECK(p.type == content::NPVARIANT_PARAM_VOID || + p.type == content::NPVARIANT_PARAM_NULL); } } @@ -79,20 +87,20 @@ bool ParamTraits<NPVariant_Param>::Read(const Message* m, return false; bool result = false; - r->type = static_cast<NPVariant_ParamEnum>(type); - if (r->type == NPVARIANT_PARAM_BOOL) { + r->type = static_cast<content::NPVariant_ParamEnum>(type); + if (r->type == content::NPVARIANT_PARAM_BOOL) { result = ReadParam(m, iter, &r->bool_value); - } else if (r->type == NPVARIANT_PARAM_INT) { + } else if (r->type == content::NPVARIANT_PARAM_INT) { result = ReadParam(m, iter, &r->int_value); - } else if (r->type == NPVARIANT_PARAM_DOUBLE) { + } else if (r->type == content::NPVARIANT_PARAM_DOUBLE) { result = ReadParam(m, iter, &r->double_value); - } else if (r->type == NPVARIANT_PARAM_STRING) { + } else if (r->type == content::NPVARIANT_PARAM_STRING) { result = ReadParam(m, iter, &r->string_value); - } else if (r->type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || - r->type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { + } else if (r->type == content::NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || + r->type == content::NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { result = ReadParam(m, iter, &r->npobject_routing_id); - } else if ((r->type == NPVARIANT_PARAM_VOID) || - (r->type == NPVARIANT_PARAM_NULL)) { + } else if ((r->type == content::NPVARIANT_PARAM_VOID) || + (r->type == content::NPVARIANT_PARAM_NULL)) { result = true; } else { NOTREACHED(); @@ -103,16 +111,16 @@ bool ParamTraits<NPVariant_Param>::Read(const Message* m, void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) { l->append(StringPrintf("NPVariant_Param(%d, ", static_cast<int>(p.type))); - if (p.type == NPVARIANT_PARAM_BOOL) { + if (p.type == content::NPVARIANT_PARAM_BOOL) { LogParam(p.bool_value, l); - } else if (p.type == NPVARIANT_PARAM_INT) { + } else if (p.type == content::NPVARIANT_PARAM_INT) { LogParam(p.int_value, l); - } else if (p.type == NPVARIANT_PARAM_DOUBLE) { + } else if (p.type == content::NPVARIANT_PARAM_DOUBLE) { LogParam(p.double_value, l); - } else if (p.type == NPVARIANT_PARAM_STRING) { + } else if (p.type == content::NPVARIANT_PARAM_STRING) { LogParam(p.string_value, l); - } else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || - p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { + } else if (p.type == content::NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || + p.type == content::NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { LogParam(p.npobject_routing_id, l); } else { l->append("<none>"); diff --git a/content/common/content_param_traits.h b/content/common/content_param_traits.h index 9e7bd44..a6fe0bad 100644 --- a/content/common/content_param_traits.h +++ b/content/common/content_param_traits.h @@ -27,6 +27,8 @@ namespace ui { class Range; } +namespace content { + // Define the NPVariant_Param struct and its enum here since it needs manual // serialization code. enum NPVariant_ParamEnum { @@ -64,6 +66,8 @@ struct NPIdentifier_Param { NPIdentifier identifier; }; +} // namespace content + namespace IPC { template <> @@ -75,16 +79,16 @@ struct ParamTraits<net::IPEndPoint> { }; template <> -struct ParamTraits<NPVariant_Param> { - typedef NPVariant_Param param_type; +struct ParamTraits<content::NPVariant_Param> { + typedef content::NPVariant_Param param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); }; template <> -struct ParamTraits<NPIdentifier_Param> { - typedef NPIdentifier_Param param_type; +struct ParamTraits<content::NPIdentifier_Param> { + typedef content::NPIdentifier_Param param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); diff --git a/content/common/debug_flags.cc b/content/common/debug_flags.cc index a64edd4..9057fbc 100644 --- a/content/common/debug_flags.cc +++ b/content/common/debug_flags.cc @@ -10,9 +10,11 @@ #include "content/public/common/content_switches.h" #include "ipc/ipc_switches.h" -bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, - content::ProcessType type, - bool is_in_sandbox) { +namespace content { + +bool ProcessDebugFlags(CommandLine* command_line, + ProcessType type, + bool is_in_sandbox) { bool should_help_child = false; const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); if (current_cmd_line.HasSwitch(switches::kDebugChildren)) { @@ -20,11 +22,11 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, std::string value = current_cmd_line.GetSwitchValueASCII( switches::kDebugChildren); if (value.empty() || - (type == content::PROCESS_TYPE_WORKER && + (type == PROCESS_TYPE_WORKER && value == switches::kWorkerProcess) || - (type == content::PROCESS_TYPE_RENDERER && + (type == PROCESS_TYPE_RENDERER && value == switches::kRendererProcess) || - (type == content::PROCESS_TYPE_PLUGIN && + (type == PROCESS_TYPE_PLUGIN && value == switches::kPluginProcess)) { command_line->AppendSwitch(switches::kDebugOnStart); should_help_child = true; @@ -35,11 +37,11 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, std::string value = current_cmd_line.GetSwitchValueASCII( switches::kWaitForDebuggerChildren); if (value.empty() || - (type == content::PROCESS_TYPE_WORKER && + (type == PROCESS_TYPE_WORKER && value == switches::kWorkerProcess) || - (type == content::PROCESS_TYPE_RENDERER && + (type == PROCESS_TYPE_RENDERER && value == switches::kRendererProcess) || - (type == content::PROCESS_TYPE_PLUGIN && + (type == PROCESS_TYPE_PLUGIN && value == switches::kPluginProcess)) { command_line->AppendSwitch(switches::kWaitForDebugger); } @@ -47,3 +49,5 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, } return should_help_child; } + +} // namespace content diff --git a/content/common/debug_flags.h b/content/common/debug_flags.h index f9efc22..ba2cf6b 100644 --- a/content/common/debug_flags.h +++ b/content/common/debug_flags.h @@ -5,25 +5,24 @@ #ifndef CONTENT_COMMON_DEBUG_FLAGS_H_ #define CONTENT_COMMON_DEBUG_FLAGS_H_ -#include "content/common/content_export.h" #include "content/public/common/process_type.h" class CommandLine; -class CONTENT_EXPORT DebugFlags { - public: +namespace content { - // Updates the command line arguments with debug-related flags. If - // debug flags have been used with this process, they will be - // filtered and added to command_line as needed. is_in_sandbox must - // be true if the child process will be in a sandbox. - // - // Returns true if the caller should "help" the child process by - // calling the JIT debugger on it. It may only happen if - // is_in_sandbox is true. - static bool ProcessDebugFlags(CommandLine* command_line, - content::ProcessType type, - bool is_in_sandbox); -}; +// Updates the command line arguments with debug-related flags. If +// debug flags have been used with this process, they will be +// filtered and added to command_line as needed. is_in_sandbox must +// be true if the child process will be in a sandbox. +// +// Returns true if the caller should "help" the child process by +// calling the JIT debugger on it. It may only happen if +// is_in_sandbox is true. +bool ProcessDebugFlags(CommandLine* command_line, + ProcessType type, + bool is_in_sandbox); + +}; // namespace content #endif // CONTENT_COMMON_DEBUG_FLAGS_H_ diff --git a/content/common/font_cache_dispatcher_win.cc b/content/common/font_cache_dispatcher_win.cc index eaf3ad7..f2c9ebe 100644 --- a/content/common/font_cache_dispatcher_win.cc +++ b/content/common/font_cache_dispatcher_win.cc @@ -11,6 +11,7 @@ #include "base/string16.h" #include "content/common/child_process_messages.h" +namespace content { namespace { typedef std::vector<string16> FontNameVector; typedef std::map<FontCacheDispatcher*, FontNameVector> DispatcherToFontNames; @@ -189,3 +190,5 @@ void FontCacheDispatcher::OnReleaseCachedFonts() { // count. When ref count is zero, the handles are released. FontCache::GetInstance()->ReleaseCachedFonts(this); } + +} // namespace content diff --git a/content/common/font_cache_dispatcher_win.h b/content/common/font_cache_dispatcher_win.h index 69f1870..2ae8132 100644 --- a/content/common/font_cache_dispatcher_win.h +++ b/content/common/font_cache_dispatcher_win.h @@ -11,6 +11,8 @@ #include "base/memory/singleton.h" #include "ipc/ipc_channel_proxy.h" +namespace content { + // Dispatches messages used for font caching on Windows. This is needed because // Windows can't load fonts into its kernel cache in sandboxed processes. So the // sandboxed process asks the browser process to do this for it. @@ -38,4 +40,6 @@ class FontCacheDispatcher : public IPC::ChannelProxy::MessageFilter, DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher); }; +} // namespace content + #endif // CONTENT_COMMON_FONT_CACHE_DISPATCHER_WIN_H_ diff --git a/content/common/font_config_ipc_linux.cc b/content/common/font_config_ipc_linux.cc index e6c0291..5388abbc 100644 --- a/content/common/font_config_ipc_linux.cc +++ b/content/common/font_config_ipc_linux.cc @@ -13,6 +13,8 @@ #include "base/pickle.h" #include "base/posix/unix_domain_socket.h" +namespace content { + FontConfigIPC::FontConfigIPC(int fd) : fd_(fd) { } @@ -109,3 +111,5 @@ int FontConfigIPC::Open(unsigned filefaceid) { return result_fd; } + +} // namespace content diff --git a/content/common/font_config_ipc_linux.h b/content/common/font_config_ipc_linux.h index a36a994..2ba3375 100644 --- a/content/common/font_config_ipc_linux.h +++ b/content/common/font_config_ipc_linux.h @@ -10,6 +10,8 @@ #include <string> +namespace content { + // FontConfig implementation for Skia that proxies out of process to get out // of the sandbox. See http://code.google.com/p/chromium/wiki/LinuxSandboxIPC class FontConfigIPC : public FontConfigInterface { @@ -37,4 +39,6 @@ class FontConfigIPC : public FontConfigInterface { const int fd_; }; +} // namespace content + #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ diff --git a/content/common/java_bridge_messages.h b/content/common/java_bridge_messages.h index 2d0d480..de9f234 100644 --- a/content/common/java_bridge_messages.h +++ b/content/common/java_bridge_messages.h @@ -20,7 +20,7 @@ IPC_MESSAGE_ROUTED0(JavaBridgeMsg_Init) // Sent from browser to renderer to add a Java object with the given name. IPC_MESSAGE_ROUTED2(JavaBridgeMsg_AddNamedObject, string16 /* name */, - NPVariant_Param) /* object */ + content::NPVariant_Param) /* object */ // Sent from browser to renderer to remove a Java object with the given name. IPC_MESSAGE_ROUTED1(JavaBridgeMsg_RemoveNamedObject, diff --git a/content/common/message_router.cc b/content/common/message_router.cc index 92523fae..d3eef77 100644 --- a/content/common/message_router.cc +++ b/content/common/message_router.cc @@ -6,6 +6,8 @@ #include "ipc/ipc_message.h" +namespace content { + MessageRouter::MessageRouter() { } @@ -51,3 +53,5 @@ bool MessageRouter::RouteMessage(const IPC::Message& msg) { IPC::Listener* MessageRouter::ResolveRoute(int32 routing_id) { return routes_.Lookup(routing_id); } + +} // namespace content diff --git a/content/common/message_router.h b/content/common/message_router.h index 9a4af43..0b34e0c 100644 --- a/content/common/message_router.h +++ b/content/common/message_router.h @@ -27,6 +27,8 @@ // The MessageRouter can be used as a concrete class provided its Send method // is not called and it does not receive any control messages. +namespace content { + class MessageRouter : public IPC::Listener, public IPC::Sender { public: MessageRouter(); @@ -59,4 +61,6 @@ class MessageRouter : public IPC::Listener, public IPC::Sender { DISALLOW_COPY_AND_ASSIGN(MessageRouter); }; +} // namespace content + #endif // CONTENT_COMMON_MESSAGE_ROUTER_H_ diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc index 509c341..2c24435 100644 --- a/content/common/np_channel_base.cc +++ b/content/common/np_channel_base.cc @@ -16,6 +16,8 @@ #include "ipc/ipc_channel_posix.h" #endif +namespace content { + typedef base::hash_map<std::string, scoped_refptr<NPChannelBase> > ChannelMap; static base::LazyInstance<ChannelMap>::Leaky g_channels = LAZY_INSTANCE_INITIALIZER; @@ -300,3 +302,5 @@ void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { proxy_map_.erase(route_id); } + +} // namespace content diff --git a/content/common/np_channel_base.h b/content/common/np_channel_base.h index 84efe94..4510486 100644 --- a/content/common/np_channel_base.h +++ b/content/common/np_channel_base.h @@ -44,6 +44,8 @@ inline size_t hash_value(NPObject* const& ptr) { } // namespace stdext #endif // COMPILER +namespace content { + // Encapsulates an IPC channel between a renderer and another process. Used to // proxy access to NP objects. class NPChannelBase : public IPC::Listener, @@ -198,4 +200,6 @@ class NPChannelBase : public IPC::Listener, DISALLOW_COPY_AND_ASSIGN(NPChannelBase); }; +} // namespace content + #endif // CONTENT_COMMON_NP_CHANNEL_BASE_H_ diff --git a/content/common/npobject_base.h b/content/common/npobject_base.h index f27941a..f91a847 100644 --- a/content/common/npobject_base.h +++ b/content/common/npobject_base.h @@ -13,6 +13,8 @@ struct NPObject; +namespace content { + class NPObjectBase { public: virtual ~NPObjectBase() {} @@ -24,4 +26,6 @@ class NPObjectBase { virtual IPC::Listener* GetChannelListener() = 0; }; +} // namespace content + #endif // CONTENT_COMMON_NPOBJECT_BASE_H_ diff --git a/content/common/npobject_proxy.cc b/content/common/npobject_proxy.cc index f2d93f5..5f4180f 100644 --- a/content/common/npobject_proxy.cc +++ b/content/common/npobject_proxy.cc @@ -14,6 +14,8 @@ using WebKit::WebBindings; +namespace content { + struct NPObjectWrapper { NPObject object; NPObjectProxy* proxy; @@ -496,3 +498,5 @@ bool NPObjectProxy::NPNEvaluate(NPP npp, result_param, channel.get(), result_var, containing_window, page_url); return true; } + +} // namespace content diff --git a/content/common/npobject_proxy.h b/content/common/npobject_proxy.h index d4d43a4e..df90ad8 100644 --- a/content/common/npobject_proxy.h +++ b/content/common/npobject_proxy.h @@ -16,9 +16,11 @@ #include "third_party/npapi/bindings/npruntime.h" #include "ui/gfx/native_widget_types.h" -class NPChannelBase; struct NPObject; +namespace content { +class NPChannelBase; + // When running a plugin in a different process from the renderer, we need to // proxy calls to NPObjects across process boundaries. This happens both ways, // as a plugin can get an NPObject for the window, and a page can get an @@ -120,4 +122,6 @@ class NPObjectProxy : public IPC::Listener, GURL page_url_; }; +} // namespace content + #endif // CONTENT_COMMON_NPOBJECT_PROXY_H_ diff --git a/content/common/npobject_stub.cc b/content/common/npobject_stub.cc index 9f8af3b..4314ab1 100644 --- a/content/common/npobject_stub.cc +++ b/content/common/npobject_stub.cc @@ -21,6 +21,8 @@ using WebKit::WebBindings; +namespace content { + NPObjectStub::NPObjectStub( NPObject* npobject, NPChannelBase* channel, @@ -73,7 +75,7 @@ IPC::Listener* NPObjectStub::GetChannelListener() { } bool NPObjectStub::OnMessageReceived(const IPC::Message& msg) { - content::GetContentClient()->SetActiveURL(page_url_); + GetContentClient()->SetActiveURL(page_url_); if (!npobject_) { if (msg.is_sync()) { // The object could be garbage because the frame has gone away, so @@ -401,3 +403,5 @@ void NPObjectStub::OnEvaluate(const std::string& script, NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); channel_->Send(reply_msg); } + +} // namespace content diff --git a/content/common/npobject_stub.h b/content/common/npobject_stub.h index 30ae77a..8118d761 100644 --- a/content/common/npobject_stub.h +++ b/content/common/npobject_stub.h @@ -18,9 +18,11 @@ #include "ipc/ipc_sender.h" #include "ui/gfx/native_widget_types.h" +struct NPObject; + +namespace content { class NPChannelBase; struct NPIdentifier_Param; -struct NPObject; struct NPVariant_Param; // This wraps an NPObject and converts IPC messages from NPObjectProxy to calls @@ -93,4 +95,6 @@ class NPObjectStub : public IPC::Listener, GURL page_url_; }; +} // namespace content + #endif // CONTENT_COMMON_NPOBJECT_STUB_H_ diff --git a/content/common/npobject_util.cc b/content/common/npobject_util.cc index 2da38b7..7fe78ef 100644 --- a/content/common/npobject_util.cc +++ b/content/common/npobject_util.cc @@ -15,6 +15,8 @@ using WebKit::WebBindings; +namespace content { + // true if the current process is a plugin process, false otherwise. static bool g_plugin_process; @@ -286,3 +288,5 @@ bool CreateNPVariant(const NPVariant_Param& param, } return true; } + +} // namespace content diff --git a/content/common/npobject_util.h b/content/common/npobject_util.h index 9bb2f4b..75d1076 100644 --- a/content/common/npobject_util.h +++ b/content/common/npobject_util.h @@ -16,15 +16,17 @@ #include "content/common/npobject_stub.h" class GURL; -class NPChannelBase; struct _NPVariant; -struct NPIdentifier_Param; -struct NPVariant_Param; typedef _NPVariant NPVariant; typedef void *NPIdentifier; +namespace content { +class NPChannelBase; +struct NPIdentifier_Param; +struct NPVariant_Param; + // Needs to be called early in the plugin process lifetime, before any // plugin instances are initialized. void PatchNPNFunctions(); @@ -67,4 +69,6 @@ bool CreateNPVariant(const NPVariant_Param& param, HANDLE GetMessageBoxEvent(HWND hwnd); #endif // defined(OS_WIN) +} // namespace content + #endif // CONTENT_COMMON_NPOBJECT_UTIL_H_ diff --git a/content/common/plugin_carbon_interpose_constants_mac.cc b/content/common/plugin_carbon_interpose_constants_mac.cc index ae7b43c..e187e98 100644 --- a/content/common/plugin_carbon_interpose_constants_mac.cc +++ b/content/common/plugin_carbon_interpose_constants_mac.cc @@ -6,10 +6,10 @@ #include "content/common/plugin_carbon_interpose_constants_mac.h" -namespace plugin_interpose_strings { +namespace content { const char kDYLDInsertLibrariesKey[] = "DYLD_INSERT_LIBRARIES"; -} // namespace plugin_interpose_strings +} // namespace content #endif // !__LP64__ diff --git a/content/common/plugin_carbon_interpose_constants_mac.h b/content/common/plugin_carbon_interpose_constants_mac.h index 00877fa..1ac9ee5 100644 --- a/content/common/plugin_carbon_interpose_constants_mac.h +++ b/content/common/plugin_carbon_interpose_constants_mac.h @@ -8,11 +8,11 @@ #if !defined(__LP64__) // Strings used in setting up Carbon interposing for the plugin process. -namespace plugin_interpose_strings { +namespace content { extern const char kDYLDInsertLibrariesKey[]; -} // namespace plugin_interpose_strings +} // namespace content #endif // !__LP64__ diff --git a/content/common/plugin_messages.h b/content/common/plugin_messages.h index c884bc4..00799b1 100644 --- a/content/common/plugin_messages.h +++ b/content/common/plugin_messages.h @@ -472,47 +472,47 @@ IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse, IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, - NPIdentifier_Param /* name */, + content::NPIdentifier_Param /* name */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke, bool /* is_default */, - NPIdentifier_Param /* method */, - std::vector<NPVariant_Param> /* args */, - NPVariant_Param /* result_param */, + content::NPIdentifier_Param /* method */, + std::vector<content::NPVariant_Param> /* args */, + content::NPVariant_Param /* result_param */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty, - NPIdentifier_Param /* name */, + content::NPIdentifier_Param /* name */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty, - NPIdentifier_Param /* name */, - NPVariant_Param /* property */, + content::NPIdentifier_Param /* name */, + content::NPVariant_Param /* property */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty, - NPIdentifier_Param /* name */, - NPVariant_Param /* property */, + content::NPIdentifier_Param /* name */, + content::NPVariant_Param /* property */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty, - NPIdentifier_Param /* name */, + content::NPIdentifier_Param /* name */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate) IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration, - std::vector<NPIdentifier_Param> /* value */, + std::vector<content::NPIdentifier_Param> /* value */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, - std::vector<NPVariant_Param> /* args */, - NPVariant_Param /* result_param */, + std::vector<content::NPVariant_Param> /* args */, + content::NPVariant_Param /* result_param */, bool /* result */) IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, std::string /* script */, bool /* popups_allowed */, - NPVariant_Param /* result_param */, + content::NPVariant_Param /* result_param */, bool /* result */) diff --git a/content/common/request_extra_data.cc b/content/common/request_extra_data.cc index 5a2f098..81101a1 100644 --- a/content/common/request_extra_data.cc +++ b/content/common/request_extra_data.cc @@ -7,6 +7,8 @@ using WebKit::WebReferrerPolicy; using WebKit::WebString; +namespace content { + RequestExtraData::RequestExtraData(WebReferrerPolicy referrer_policy, const WebString& custom_user_agent, bool is_main_frame, @@ -14,7 +16,7 @@ RequestExtraData::RequestExtraData(WebReferrerPolicy referrer_policy, bool parent_is_main_frame, int64 parent_frame_id, bool allow_download, - content::PageTransition transition_type, + PageTransition transition_type, int transferred_request_child_id, int transferred_request_request_id) : webkit_glue::WebURLRequestExtraDataImpl(referrer_policy, @@ -31,3 +33,5 @@ RequestExtraData::RequestExtraData(WebReferrerPolicy referrer_policy, RequestExtraData::~RequestExtraData() { } + +} // namespace content diff --git a/content/common/request_extra_data.h b/content/common/request_extra_data.h index 025ff96..ed8e7f5 100644 --- a/content/common/request_extra_data.h +++ b/content/common/request_extra_data.h @@ -10,6 +10,8 @@ #include "content/public/common/page_transition_types.h" #include "webkit/glue/weburlrequest_extradata_impl.h" +namespace content { + // The RenderView stores an instance of this class in the "extra data" of each // ResourceRequest (see RenderView::willSendRequest). class CONTENT_EXPORT RequestExtraData @@ -22,7 +24,7 @@ class CONTENT_EXPORT RequestExtraData bool parent_is_main_frame, int64 parent_frame_id, bool allow_download, - content::PageTransition transition_type, + PageTransition transition_type, int transferred_request_child_id, int transferred_request_request_id); virtual ~RequestExtraData(); @@ -32,7 +34,7 @@ class CONTENT_EXPORT RequestExtraData bool parent_is_main_frame() const { return parent_is_main_frame_; } int64 parent_frame_id() const { return parent_frame_id_; } bool allow_download() const { return allow_download_; } - content::PageTransition transition_type() const { return transition_type_; } + PageTransition transition_type() const { return transition_type_; } int transferred_request_child_id() const { return transferred_request_child_id_; } @@ -46,11 +48,13 @@ class CONTENT_EXPORT RequestExtraData bool parent_is_main_frame_; int64 parent_frame_id_; bool allow_download_; - content::PageTransition transition_type_; + PageTransition transition_type_; int transferred_request_child_id_; int transferred_request_request_id_; DISALLOW_COPY_AND_ASSIGN(RequestExtraData); }; +} // namespace content + #endif // CONTENT_COMMON_REQUEST_EXTRA_DATA_H_ diff --git a/content/common/sandbox_policy.cc b/content/common/sandbox_policy.cc index 4953c0d..8d82c55 100644 --- a/content/common/sandbox_policy.cc +++ b/content/common/sandbox_policy.cc @@ -729,8 +729,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, cmd_line->AppendSwitch(switches::kAllowNoSandboxJob); } - bool child_needs_help = - DebugFlags::ProcessDebugFlags(cmd_line, type, in_sandbox); + bool child_needs_help = ProcessDebugFlags(cmd_line, type, in_sandbox); // Prefetch hints on windows: // Using a different prefetch profile per process type will allow Windows diff --git a/content/plugin/plugin_main_mac.mm b/content/plugin/plugin_main_mac.mm index c8dddfd..2ee85fa 100644 --- a/content/plugin/plugin_main_mac.mm +++ b/content/plugin/plugin_main_mac.mm @@ -18,8 +18,7 @@ void TrimInterposeEnvironment() { scoped_ptr<base::Environment> env(base::Environment::Create()); std::string interpose_list; - if (!env->GetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey, - &interpose_list)) { + if (!env->GetVar(kDYLDInsertLibrariesKey, &interpose_list)) { LOG(INFO) << "No Carbon Interpose library found."; return; } @@ -35,12 +34,11 @@ void TrimInterposeEnvironment() { size_t suffix_offset = interpose_list.size() - interpose_library_path.size(); if (suffix_offset == 0 && interpose_list == interpose_library_path) { - env->UnSetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey); + env->UnSetVar(kDYLDInsertLibrariesKey); } else if (suffix_offset > 0 && interpose_list[suffix_offset - 1] == ':' && interpose_list.substr(suffix_offset) == interpose_library_path) { std::string trimmed_list = interpose_list.substr(0, suffix_offset - 1); - env->SetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey, - trimmed_list.c_str()); + env->SetVar(kDYLDInsertLibrariesKey, trimmed_list.c_str()); } else { NOTREACHED() << "Missing Carbon interposing library"; } diff --git a/content/public/browser/browser_child_process_host_iterator.h b/content/public/browser/browser_child_process_host_iterator.h index a6494b5..5a0f4f8 100644 --- a/content/public/browser/browser_child_process_host_iterator.h +++ b/content/public/browser/browser_child_process_host_iterator.h @@ -10,15 +10,13 @@ #include "content/common/content_export.h" #include "content/public/common/process_type.h" -class BrowserChildProcessHostImpl; - namespace IPC { class Message; } namespace content { - class BrowserChildProcessHostDelegate; +class BrowserChildProcessHostImpl; struct ChildProcessData; // This class allows iteration through either all child processes, or ones of a diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index a861b70..731f897 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -24,7 +24,6 @@ class CommandLine; class FilePath; class GURL; -class PluginProcessHost; namespace webkit_glue { struct WebPreferences; diff --git a/content/public/browser/plugin_service.h b/content/public/browser/plugin_service.h index 8358f11..7364195 100644 --- a/content/public/browser/plugin_service.h +++ b/content/public/browser/plugin_service.h @@ -14,7 +14,6 @@ class FilePath; class GURL; -class PluginProcessHost; namespace webkit { struct WebPluginInfo; @@ -26,6 +25,7 @@ class PluginList; namespace content { class BrowserContext; +class PluginProcessHost; class PluginServiceFilter; class ResourceContext; struct PepperPluginInfo; diff --git a/content/renderer/java/java_bridge_channel.h b/content/renderer/java/java_bridge_channel.h index 4789dcf..5151a69 100644 --- a/content/renderer/java/java_bridge_channel.h +++ b/content/renderer/java/java_bridge_channel.h @@ -10,7 +10,7 @@ namespace content { -class JavaBridgeChannel : public NPChannelBase { +class JavaBridgeChannel : public content::NPChannelBase { public: static JavaBridgeChannel* GetJavaBridgeChannel( const IPC::ChannelHandle& channel_handle, diff --git a/content/renderer/java/java_bridge_dispatcher.h b/content/renderer/java/java_bridge_dispatcher.h index 83dd36a..29a10374 100644 --- a/content/renderer/java/java_bridge_dispatcher.h +++ b/content/renderer/java/java_bridge_dispatcher.h @@ -12,10 +12,9 @@ #include "ipc/ipc_channel_handle.h" #include "third_party/npapi/bindings/npruntime.h" -struct NPVariant_Param; - namespace content { class JavaBridgeChannel; +struct NPVariant_Param; // This class handles injecting Java objects into the main frame of a // RenderView. The 'add' and 'remove' messages received from the browser diff --git a/content/renderer/plugin_channel_host.h b/content/renderer/plugin_channel_host.h index ff121dd..7ff180b 100644 --- a/content/renderer/plugin_channel_host.h +++ b/content/renderer/plugin_channel_host.h @@ -9,10 +9,9 @@ #include "content/common/np_channel_base.h" #include "ipc/ipc_channel_handle.h" -class NPObjectBase; - namespace content { class IsListeningFilter; +class NPObjectBase; // Encapsulates an IPC channel between the renderer and one plugin process. // On the plugin side there's a corresponding PluginChannel. diff --git a/content/renderer/webplugin_delegate_proxy.h b/content/renderer/webplugin_delegate_proxy.h index cc4f748..c3dc470 100644 --- a/content/renderer/webplugin_delegate_proxy.h +++ b/content/renderer/webplugin_delegate_proxy.h @@ -27,7 +27,6 @@ #endif struct NPObject; -class NPObjectStub; struct PluginHostMsg_URLRequest_Params; class SkBitmap; @@ -46,6 +45,7 @@ class WebPlugin; } namespace content { +class NPObjectStub; class PluginChannelHost; class RenderViewImpl; |