diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 20:16:19 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 20:16:19 +0000 |
commit | eb398193640924b8e55c6b2d00077838146ea8eb (patch) | |
tree | fc832fdabf40bad4ea19253b19216f1111fdc166 /content/common | |
parent | f6b218e0969ab52a1a623260a8242030f8aeef31 (diff) | |
download | chromium_src-eb398193640924b8e55c6b2d00077838146ea8eb.zip chromium_src-eb398193640924b8e55c6b2d00077838146ea8eb.tar.gz chromium_src-eb398193640924b8e55c6b2d00077838146ea8eb.tar.bz2 |
Move a bunch of code in content\common (as well as a few left in renderer) to the content namespace.
Review URL: https://codereview.chromium.org/11227033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
82 files changed, 399 insertions, 133 deletions
diff --git a/content/common/appcache/appcache_backend_proxy.cc b/content/common/appcache/appcache_backend_proxy.cc index 688b221..911bb6d 100644 --- a/content/common/appcache/appcache_backend_proxy.cc +++ b/content/common/appcache/appcache_backend_proxy.cc @@ -6,6 +6,8 @@ #include "content/common/appcache_messages.h" +namespace content { + void AppCacheBackendProxy::RegisterHost(int host_id) { sender_->Send(new AppCacheHostMsg_RegisterHost(host_id)); } @@ -74,3 +76,5 @@ void AppCacheBackendProxy::GetResourceList( int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { sender_->Send(new AppCacheHostMsg_GetResourceList(host_id, resource_infos)); } + +} // namespace content diff --git a/content/common/appcache/appcache_backend_proxy.h b/content/common/appcache/appcache_backend_proxy.h index 7c00090..6803ee6 100644 --- a/content/common/appcache/appcache_backend_proxy.h +++ b/content/common/appcache/appcache_backend_proxy.h @@ -8,6 +8,8 @@ #include "ipc/ipc_sender.h" #include "webkit/appcache/appcache_interfaces.h" +namespace content { + // Sends appcache related messages to the main process. class AppCacheBackendProxy : public appcache::AppCacheBackend { public: @@ -45,4 +47,6 @@ class AppCacheBackendProxy : public appcache::AppCacheBackend { IPC::Sender* sender_; }; +} // namespace content + #endif // CONTENT_COMMON_APPCACHE_APPCACHE_BACKEND_PROXY_H_ diff --git a/content/common/appcache/appcache_dispatcher.cc b/content/common/appcache/appcache_dispatcher.cc index 6504770..c337925 100644 --- a/content/common/appcache/appcache_dispatcher.cc +++ b/content/common/appcache/appcache_dispatcher.cc @@ -7,6 +7,8 @@ #include "content/common/appcache_messages.h" #include "webkit/appcache/web_application_cache_host_impl.h" +namespace content { + bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg) @@ -59,3 +61,5 @@ void AppCacheDispatcher::OnContentBlocked(int host_id, const GURL& manifest_url) { frontend_impl_.OnContentBlocked(host_id, manifest_url); } + +} // namespace content diff --git a/content/common/appcache/appcache_dispatcher.h b/content/common/appcache/appcache_dispatcher.h index ed58ba9..f0324f4 100644 --- a/content/common/appcache/appcache_dispatcher.h +++ b/content/common/appcache/appcache_dispatcher.h @@ -12,6 +12,8 @@ #include "ipc/ipc_listener.h" #include "webkit/appcache/appcache_frontend_impl.h" +namespace content { + // Dispatches appcache related messages sent to a child process from the // main browser process. There is one instance per child process. Messages // are dispatched on the main child thread. The ChildThread base class @@ -44,4 +46,6 @@ class AppCacheDispatcher : public IPC::Listener { appcache::AppCacheFrontendImpl frontend_impl_; }; +} // namespace content + #endif // CONTENT_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_ diff --git a/content/common/child_process.cc b/content/common/child_process.cc index d70bd1b..f0dfdc5 100644 --- a/content/common/child_process.cc +++ b/content/common/child_process.cc @@ -24,6 +24,8 @@ static void SigUSR1Handler(int signal) { } #endif +namespace content { + ChildProcess* ChildProcess::child_process_; ChildProcess::ChildProcess() @@ -124,3 +126,5 @@ void ChildProcess::WaitForDebugger(const std::string& label) { #endif // defined(OS_ANDROID) #endif // defined(OS_POSIX) } + +} // namespace content diff --git a/content/common/child_process.h b/content/common/child_process.h index 3842b39..09e97d9 100644 --- a/content/common/child_process.h +++ b/content/common/child_process.h @@ -11,6 +11,7 @@ #include "base/synchronization/waitable_event.h" #include "content/common/content_export.h" +namespace content { class ChildThread; // Base class for child processes of the browser process (i.e. renderer and @@ -76,4 +77,6 @@ class CONTENT_EXPORT ChildProcess { DISALLOW_COPY_AND_ASSIGN(ChildProcess); }; +} // namespace content + #endif // CONTENT_COMMON_CHILD_PROCESS_H_ diff --git a/content/common/child_thread.cc b/content/common/child_thread.cc index 7182796..17e201d 100644 --- a/content/common/child_thread.cc +++ b/content/common/child_thread.cc @@ -30,9 +30,9 @@ #include "content/common/handle_enumerator_win.h" #endif -using content::ResourceDispatcher; using tracked_objects::ThreadData; +namespace content { namespace { // How long to wait for a connection to the browser process before giving up. @@ -111,7 +111,7 @@ void ChildThread::Init() { sync_message_filter_ = new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); - histogram_message_filter_ = new content::ChildHistogramMessageFilter(); + histogram_message_filter_ = new ChildHistogramMessageFilter(); channel_->AddFilter(histogram_message_filter_.get()); channel_->AddFilter(sync_message_filter_.get()); @@ -306,8 +306,8 @@ void ChildThread::OnGetChildProfilerData(int sequence_number) { void ChildThread::OnDumpHandles() { #if defined(OS_WIN) - scoped_refptr<content::HandleEnumerator> handle_enum( - new content::HandleEnumerator( + scoped_refptr<HandleEnumerator> handle_enum( + new HandleEnumerator( CommandLine::ForCurrentProcess()->HasSwitch( switches::kAuditAllHandles))); handle_enum->EnumerateHandles(); @@ -356,3 +356,5 @@ void ChildThread::EnsureConnected() { LOG(INFO) << "ChildThread::EnsureConnected()"; base::KillProcess(base::GetCurrentProcessHandle(), 0, false); } + +} // namespace content diff --git a/content/common/child_thread.h b/content/common/child_thread.h index 086e72f..6531e76 100644 --- a/content/common/child_thread.h +++ b/content/common/child_thread.h @@ -15,15 +15,7 @@ #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. #include "webkit/glue/resource_loader_bridge.h" -class FileSystemDispatcher; class MessageLoop; -class QuotaDispatcher; -class SocketStreamDispatcher; - -namespace content { -class ChildHistogramMessageFilter; -class ResourceDispatcher; -} namespace IPC { class SyncChannel; @@ -34,6 +26,13 @@ namespace WebKit { class WebFrame; } +namespace content { +class ChildHistogramMessageFilter; +class FileSystemDispatcher; +class QuotaDispatcher; +class ResourceDispatcher; +class SocketStreamDispatcher; + // The main thread of a child process derives from this class. class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { public: @@ -65,7 +64,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { // but on windows the child process directly allocates the block. base::SharedMemory* AllocateSharedMemory(size_t buf_size); - content::ResourceDispatcher* resource_dispatcher(); + ResourceDispatcher* resource_dispatcher(); SocketStreamDispatcher* socket_stream_dispatcher() { return socket_stream_dispatcher_.get(); @@ -83,7 +82,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { // lifetime is less than the main thread. IPC::SyncMessageFilter* sync_message_filter(); - content::ChildHistogramMessageFilter* child_histogram_message_filter() const { + ChildHistogramMessageFilter* child_histogram_message_filter() const { return histogram_message_filter_.get(); } @@ -138,7 +137,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { MessageRouter router_; // Handles resource loads for this process. - scoped_ptr<content::ResourceDispatcher> resource_dispatcher_; + scoped_ptr<ResourceDispatcher> resource_dispatcher_; // Handles SocketStream for this process. scoped_ptr<SocketStreamDispatcher> socket_stream_dispatcher_; @@ -153,11 +152,13 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { scoped_ptr<QuotaDispatcher> quota_dispatcher_; - scoped_refptr<content::ChildHistogramMessageFilter> histogram_message_filter_; + scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; base::WeakPtrFactory<ChildThread> channel_connected_factory_; DISALLOW_COPY_AND_ASSIGN(ChildThread); }; +} // namespace content + #endif // CONTENT_COMMON_CHILD_THREAD_H_ diff --git a/content/common/child_trace_message_filter.cc b/content/common/child_trace_message_filter.cc index 6ca3031..d3f4341 100644 --- a/content/common/child_trace_message_filter.cc +++ b/content/common/child_trace_message_filter.cc @@ -12,6 +12,8 @@ using base::debug::TraceLog; +namespace content { + ChildTraceMessageFilter::ChildTraceMessageFilter() : channel_(NULL) {} void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) { @@ -103,3 +105,5 @@ void ChildTraceMessageFilter::OnTraceNotification(int notification) { channel_->Send(new ChildProcessHostMsg_TraceNotification(notification)); } + +} // namespace content diff --git a/content/common/child_trace_message_filter.h b/content/common/child_trace_message_filter.h index 946344a..061a6eb 100644 --- a/content/common/child_trace_message_filter.h +++ b/content/common/child_trace_message_filter.h @@ -11,6 +11,8 @@ #include "base/process.h" #include "ipc/ipc_channel_proxy.h" +namespace content { + // This class sends and receives trace messages on child processes. class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter { public: @@ -44,6 +46,6 @@ class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter { DISALLOW_COPY_AND_ASSIGN(ChildTraceMessageFilter); }; +} // namespace content #endif // CONTENT_COMMON_CHILD_TRACE_MESSAGE_FILTER_H_ - diff --git a/content/common/database_util.cc b/content/common/database_util.cc index d305df9..42d19a2 100644 --- a/content/common/database_util.cc +++ b/content/common/database_util.cc @@ -13,6 +13,8 @@ using WebKit::WebKitPlatformSupport; using WebKit::WebString; +namespace content { + WebKitPlatformSupport::FileHandle DatabaseUtil::DatabaseOpenFile( const WebString& vfs_file_name, int desired_flags) { IPC::PlatformFileForTransit file_handle = @@ -60,3 +62,5 @@ long long DatabaseUtil::DatabaseGetSpaceAvailable( filter->Send(new DatabaseHostMsg_GetSpaceAvailable(origin_identifier, &rv)); return rv; } + +} // namespace content diff --git a/content/common/database_util.h b/content/common/database_util.h index 4ae1a6d..f068962 100644 --- a/content/common/database_util.h +++ b/content/common/database_util.h @@ -7,6 +7,7 @@ #include "webkit/glue/webkitplatformsupport_impl.h" +namespace content { // A class of utility functions used by RendererWebKitPlatformSupportImpl and // WorkerWebKitPlatformSupportImpl to handle database file accesses. class DatabaseUtil { @@ -23,4 +24,6 @@ class DatabaseUtil { const WebKit::WebString& origin_identifier); }; +} // namespace content + #endif // CONTENT_COMMON_DATABASE_UTIL_H_ diff --git a/content/common/fileapi/file_system_dispatcher.cc b/content/common/fileapi/file_system_dispatcher.cc index 2c929fe..d48a82e 100644 --- a/content/common/fileapi/file_system_dispatcher.cc +++ b/content/common/fileapi/file_system_dispatcher.cc @@ -9,6 +9,8 @@ #include "content/common/child_thread.h" #include "content/common/fileapi/file_system_messages.h" +namespace content { + FileSystemDispatcher::FileSystemDispatcher() { } @@ -329,3 +331,5 @@ void FileSystemDispatcher::OnDidOpenFile( dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file)); dispatchers_.Remove(request_id); } + +} // namespace content diff --git a/content/common/fileapi/file_system_dispatcher.h b/content/common/fileapi/file_system_dispatcher.h index c2e4ce3..c5a38df 100644 --- a/content/common/fileapi/file_system_dispatcher.h +++ b/content/common/fileapi/file_system_dispatcher.h @@ -24,6 +24,8 @@ struct PlatformFileInfo; class FilePath; class GURL; +namespace content { + // Dispatches and sends file system related messages sent to/from a child // process from/to the main browser process. There is one instance // per child process. Messages are dispatched on the main child thread. @@ -116,4 +118,6 @@ class FileSystemDispatcher : public IPC::Listener { DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); }; +} // namespace content + #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ diff --git a/content/common/fileapi/webblobregistry_impl.cc b/content/common/fileapi/webblobregistry_impl.cc index d561802..0a587c7 100644 --- a/content/common/fileapi/webblobregistry_impl.cc +++ b/content/common/fileapi/webblobregistry_impl.cc @@ -18,6 +18,8 @@ using WebKit::WebBlobData; using WebKit::WebString; using WebKit::WebURL; +namespace content { + WebBlobRegistryImpl::WebBlobRegistryImpl(ChildThread* child_thread) : child_thread_(child_thread) { } @@ -112,3 +114,5 @@ void WebBlobRegistryImpl::registerBlobURL( void WebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) { child_thread_->Send(new BlobHostMsg_RemoveBlob(url)); } + +} // namespace content diff --git a/content/common/fileapi/webblobregistry_impl.h b/content/common/fileapi/webblobregistry_impl.h index cacffb2..34fd7c1 100644 --- a/content/common/fileapi/webblobregistry_impl.h +++ b/content/common/fileapi/webblobregistry_impl.h @@ -7,13 +7,14 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegistry.h" -class ChildThread; - namespace WebKit { class WebBlobData; class WebURL; } +namespace content { +class ChildThread; + class WebBlobRegistryImpl : public WebKit::WebBlobRegistry { public: explicit WebBlobRegistryImpl(ChildThread* child_thread); @@ -30,4 +31,6 @@ class WebBlobRegistryImpl : public WebKit::WebBlobRegistry { ChildThread* child_thread_; }; +} // namespace content + #endif // CONTENT_COMMON_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ diff --git a/content/common/fileapi/webfilesystem_callback_dispatcher.cc b/content/common/fileapi/webfilesystem_callback_dispatcher.cc index a73ef9e..8a3ae52 100644 --- a/content/common/fileapi/webfilesystem_callback_dispatcher.cc +++ b/content/common/fileapi/webfilesystem_callback_dispatcher.cc @@ -24,6 +24,8 @@ using WebKit::WebFileSystemEntry; using WebKit::WebString; using WebKit::WebVector; +namespace content { + WebFileSystemCallbackDispatcher::WebFileSystemCallbackDispatcher( WebFileSystemCallbacks* callbacks) : callbacks_(callbacks) { @@ -67,3 +69,5 @@ void WebFileSystemCallbackDispatcher::DidFail( void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) { NOTREACHED(); } + +} // namespace content diff --git a/content/common/fileapi/webfilesystem_callback_dispatcher.h b/content/common/fileapi/webfilesystem_callback_dispatcher.h index ab9ed48..22a12c9 100644 --- a/content/common/fileapi/webfilesystem_callback_dispatcher.h +++ b/content/common/fileapi/webfilesystem_callback_dispatcher.h @@ -15,6 +15,8 @@ namespace WebKit { class WebFileSystemCallbacks; } +namespace content { + class WebFileSystemCallbackDispatcher : public fileapi::FileSystemCallbackDispatcher { public: @@ -38,4 +40,6 @@ class WebFileSystemCallbackDispatcher WebKit::WebFileSystemCallbacks* callbacks_; }; +} // namespace content + #endif // CONTENT_COMMON_FILEAPI_WEBFILESYSTEM_CALLBACK_DISPATCHER_H_ diff --git a/content/common/fileapi/webfilesystem_impl.cc b/content/common/fileapi/webfilesystem_impl.cc index 0a3f57d..8808ce2 100644 --- a/content/common/fileapi/webfilesystem_impl.cc +++ b/content/common/fileapi/webfilesystem_impl.cc @@ -21,6 +21,8 @@ using WebKit::WebString; using WebKit::WebURL; using WebKit::WebVector; +namespace content { + WebFileSystemImpl::WebFileSystemImpl() { } @@ -127,3 +129,5 @@ void WebFileSystemImpl::createSnapshotFileAndReadMetadata( GURL(blobURL), GURL(path), new WebFileSystemCallbackDispatcher(callbacks)); } + +} // namespace content diff --git a/content/common/fileapi/webfilesystem_impl.h b/content/common/fileapi/webfilesystem_impl.h index 3d4fdbb..31b435b 100644 --- a/content/common/fileapi/webfilesystem_impl.h +++ b/content/common/fileapi/webfilesystem_impl.h @@ -15,6 +15,8 @@ class WebFileWriter; class WebFileWriterClient; } +namespace content { + class WebFileSystemImpl : public WebKit::WebFileSystem { public: WebFileSystemImpl(); @@ -63,4 +65,6 @@ class WebFileSystemImpl : public WebKit::WebFileSystem { WebKit::WebFileSystemCallbacks*) OVERRIDE; }; +} // namespace content + #endif // CONTENT_COMMON_FILEAPI_WEBFILESYSTEM_IMPL_H_ diff --git a/content/common/fileapi/webfilewriter_impl.cc b/content/common/fileapi/webfilewriter_impl.cc index 2b30f36..c6a4d25 100644 --- a/content/common/fileapi/webfilewriter_impl.cc +++ b/content/common/fileapi/webfilewriter_impl.cc @@ -7,6 +7,7 @@ #include "content/common/child_thread.h" #include "content/common/fileapi/file_system_dispatcher.h" +namespace content { namespace { inline FileSystemDispatcher* GetFileSystemDispatcher() { @@ -78,3 +79,5 @@ void WebFileWriterImpl::DoCancel() { GetFileSystemDispatcher()->Cancel(request_id_, new CallbackDispatcher(AsWeakPtr())); } + +} // namespace content diff --git a/content/common/fileapi/webfilewriter_impl.h b/content/common/fileapi/webfilewriter_impl.h index f009a57..77550bf 100644 --- a/content/common/fileapi/webfilewriter_impl.h +++ b/content/common/fileapi/webfilewriter_impl.h @@ -9,6 +9,8 @@ #include "base/memory/weak_ptr.h" #include "webkit/fileapi/webfilewriter_base.h" +namespace content { + // An implementation of WebFileWriter for use in chrome renderers and workers. class WebFileWriterImpl : public fileapi::WebFileWriterBase, public base::SupportsWeakPtr<WebFileWriterImpl> { @@ -28,4 +30,6 @@ class WebFileWriterImpl : public fileapi::WebFileWriterBase, int request_id_; }; +} // namespace content + #endif // CONTENT_COMMON_FILEAPI_WEBFILEWRITER_IMPL_H_ diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc index f261597..c17ea27 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.cc +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc @@ -26,6 +26,8 @@ using gpu::Buffer; +namespace content { + CommandBufferProxyImpl::CommandBufferProxyImpl( GpuChannelHost* channel, int route_id) @@ -261,8 +263,8 @@ int32 CommandBufferProxyImpl::CreateTransferBuffer( base::SharedMemoryHandle handle = shm->handle(); #if defined(OS_WIN) // Windows needs to explicitly duplicate the handle out to another process. - if (!content::BrokerDuplicateHandle(handle, channel_->gpu_pid(), - &handle, FILE_MAP_WRITE, 0)) { + if (!BrokerDuplicateHandle(handle, channel_->gpu_pid(), &handle, + FILE_MAP_WRITE, 0)) { return -1; } #elif defined(OS_POSIX) @@ -292,8 +294,8 @@ int32 CommandBufferProxyImpl::RegisterTransferBuffer( base::SharedMemoryHandle handle = shared_memory->handle(); #if defined(OS_WIN) // Windows needs to explicitly duplicate the handle out to another process. - if (!content::BrokerDuplicateHandle(handle, channel_->gpu_pid(), - &handle, FILE_MAP_WRITE, 0)) { + if (!BrokerDuplicateHandle(handle, channel_->gpu_pid(), &handle, + FILE_MAP_WRITE, 0)) { return -1; } #endif @@ -561,3 +563,5 @@ void CommandBufferProxyImpl::TryUpdateState() { if (last_state_.error == gpu::error::kNoError) shared_state_->Read(&last_state_); } + +} // namespace content diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h index 8a7a6b4..856159d 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.h +++ b/content/common/gpu/client/command_buffer_proxy_impl.h @@ -23,14 +23,16 @@ #include "gpu/command_buffer/common/command_buffer_shared.h" #include "ipc/ipc_listener.h" -class GpuChannelHost; struct GPUCommandBufferConsoleMessage; -struct GpuMemoryAllocationForRenderer; namespace base { class SharedMemory; } +namespace content { +class GpuChannelHost; +struct GpuMemoryAllocationForRenderer; + // Client side proxy that forwards messages synchronously to a // CommandBufferStub. class CommandBufferProxyImpl @@ -169,6 +171,8 @@ class CommandBufferProxyImpl DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); }; +} // namespace content + #endif // ENABLE_GPU #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc index 59c73e3..aa556c8 100644 --- a/content/common/gpu/client/gpu_channel_host.cc +++ b/content/common/gpu/client/gpu_channel_host.cc @@ -17,6 +17,8 @@ using base::AutoLock; using base::MessageLoopProxy; +namespace content { + GpuListenerInfo::GpuListenerInfo() {} GpuListenerInfo::~GpuListenerInfo() {} @@ -57,7 +59,7 @@ void GpuChannelHost::Connect( state_ = kConnected; } -void GpuChannelHost::set_gpu_info(const content::GPUInfo& gpu_info) { +void GpuChannelHost::set_gpu_info(const GPUInfo& gpu_info) { gpu_info_ = gpu_info; } @@ -65,7 +67,7 @@ void GpuChannelHost::SetStateLost() { state_ = kLost; } -const content::GPUInfo& GpuChannelHost::gpu_info() const { +const GPUInfo& GpuChannelHost::gpu_info() const { return gpu_info_; } @@ -215,7 +217,7 @@ void GpuChannelHost::DestroyCommandBuffer( } bool GpuChannelHost::CollectRenderingStatsForSurface( - int surface_id, content::GpuRenderingStats* stats) { + int surface_id, GpuRenderingStats* stats) { TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats"); return Send(new GpuChannelMsg_CollectRenderingStatsForSurface(surface_id, @@ -315,4 +317,4 @@ void GpuChannelHost::MessageFilter::OnChannelError() { listeners_.clear(); } - +} // namespace content diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h index e2567c6..8b68626 100644 --- a/content/common/gpu/client/gpu_channel_host.h +++ b/content/common/gpu/client/gpu_channel_host.h @@ -28,24 +28,23 @@ #include "ui/gl/gpu_preference.h" class CommandBufferProxy; -class CommandBufferProxyImpl; -struct GPUCreateCommandBufferConfig; class GURL; -class TransportTextureService; class MessageLoop; +class TransportTextureService; +struct GPUCreateCommandBufferConfig; namespace base { class MessageLoopProxy; } -namespace content { -struct GpuRenderingStats; -} - namespace IPC { class SyncMessageFilter; } +namespace content { +class CommandBufferProxyImpl; +struct GpuRenderingStats; + struct GpuListenerInfo { GpuListenerInfo(); ~GpuListenerInfo(); @@ -68,8 +67,7 @@ class CONTENT_EXPORT GpuChannelHostFactory { virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0; virtual int32 CreateViewCommandBuffer( int32 surface_id, const GPUCreateCommandBufferConfig& init_params) = 0; - virtual GpuChannelHost* EstablishGpuChannelSync( - content::CauseForGpuLaunch) = 0; + virtual GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch) = 0; virtual void CreateImage( gfx::PluginWindowHandle window, int32 image_id, @@ -106,8 +104,8 @@ class GpuChannelHost : public IPC::Sender, void SetStateLost(); // The GPU stats reported by the GPU process. - void set_gpu_info(const content::GPUInfo& gpu_info); - const content::GPUInfo& gpu_info() const; + void set_gpu_info(const GPUInfo& gpu_info); + const GPUInfo& gpu_info() const; void OnChannelError(); @@ -144,7 +142,7 @@ class GpuChannelHost : public IPC::Sender, // Collect rendering stats from GPU process. bool CollectRenderingStatsForSurface( - int surface_id, content::GpuRenderingStats* stats); + int surface_id, GpuRenderingStats* stats); // Add a route for the current message loop. void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); @@ -189,7 +187,7 @@ class GpuChannelHost : public IPC::Sender, State state_; - content::GPUInfo gpu_info_; + GPUInfo gpu_info_; scoped_ptr<IPC::SyncChannel> channel_; scoped_refptr<MessageFilter> channel_filter_; @@ -208,4 +206,6 @@ class GpuChannelHost : public IPC::Sender, DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc index 387327b..349585a 100644 --- a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc +++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc @@ -18,6 +18,7 @@ #endif // OS_WIN using media::VideoDecodeAccelerator; +namespace content { GpuVideoDecodeAcceleratorHost::GpuVideoDecodeAcceleratorHost( GpuChannelHost* channel, @@ -69,10 +70,10 @@ void GpuVideoDecodeAcceleratorHost::Decode( DCHECK(CalledOnValidThread()); base::SharedMemoryHandle buffer_handle = bitstream_buffer.handle(); #if defined(OS_WIN) - if (!content::BrokerDuplicateHandle(bitstream_buffer.handle(), - channel_->gpu_pid(), - &buffer_handle, 0, - DUPLICATE_SAME_ACCESS)) { + if (!BrokerDuplicateHandle(bitstream_buffer.handle(), + channel_->gpu_pid(), + &buffer_handle, 0, + DUPLICATE_SAME_ACCESS)) { NOTREACHED() << "Failed to duplicate buffer handler"; return; } @@ -203,3 +204,5 @@ void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { static_cast<media::VideoDecodeAccelerator::Error>(error)); client_ = NULL; } + +} // namespace content diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.h b/content/common/gpu/client/gpu_video_decode_accelerator_host.h index b46310a..8b13cb2 100644 --- a/content/common/gpu/client/gpu_video_decode_accelerator_host.h +++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.h @@ -12,6 +12,7 @@ #include "ipc/ipc_listener.h" #include "media/video/video_decode_accelerator.h" +namespace content { class GpuChannelHost; // This class is used to talk to VideoDecodeAccelerator in the Gpu process @@ -71,4 +72,6 @@ class GpuVideoDecodeAcceleratorHost DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 9a21f10..581ac6f 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -37,6 +37,7 @@ #include "gpu/ipc/command_buffer_proxy.h" #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" +namespace content { static base::LazyInstance<base::Lock>::Leaky g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > @@ -151,7 +152,7 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl( use_echo_for_swap_ack_(true) { #if defined(OS_MACOSX) || defined(OS_WIN) // Get ViewMsg_SwapBuffers_ACK from browser for single-threaded path. - use_echo_for_swap_ack_ = content::IsThreadedCompositingEnabled(); + use_echo_for_swap_ack_ = IsThreadedCompositingEnabled(); #endif } @@ -181,7 +182,7 @@ void WebGraphicsContext3DCommandBufferImpl::InitializeWithCommandBuffer( bool WebGraphicsContext3DCommandBufferImpl::Initialize( const WebGraphicsContext3D::Attributes& attributes, bool bind_generates_resources, - content::CauseForGpuLaunch cause) { + CauseForGpuLaunch cause) { TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::initialize"); attributes_ = attributes; @@ -1453,7 +1454,7 @@ WebGraphicsContext3DCommandBufferImpl::CreateViewContext( const WebGraphicsContext3D::Attributes& attributes, bool bind_generates_resources, const GURL& active_url, - content::CauseForGpuLaunch cause) { + CauseForGpuLaunch cause) { WebGraphicsContext3DCommandBufferImpl* context = new WebGraphicsContext3DCommandBufferImpl( surface_id, @@ -1480,8 +1481,8 @@ WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( new WebGraphicsContext3DCommandBufferImpl( 0, active_url, factory, null_client)); - content::CauseForGpuLaunch cause = - content::CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; + CauseForGpuLaunch cause = + CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; if (context->Initialize(attributes, false, cause)) return context.release(); return NULL; @@ -1603,3 +1604,5 @@ void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( error_message_callback_->onErrorMessage(str, id); } } + +} // namespace content diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h index c8cde90..d25eb53 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h @@ -24,11 +24,6 @@ #endif class CommandBufferProxy; -class GpuChannelHost; -class GpuChannelHostFactory; -struct GpuMemoryAllocationForRenderer; - - namespace gpu { class TransferBuffer; @@ -54,6 +49,11 @@ using WebKit::WGC3Dclampf; using WebKit::WGC3Dintptr; using WebKit::WGC3Dsizeiptr; +namespace content { +class GpuChannelHost; +class GpuChannelHostFactory; +struct GpuMemoryAllocationForRenderer; + // TODO(piman): move this logic to the compositor and remove it from the // context... class WebGraphicsContext3DSwapBuffersClient { @@ -87,7 +87,7 @@ class WebGraphicsContext3DCommandBufferImpl bool Initialize(const Attributes& attributes, bool bind_generates_resources, - content::CauseForGpuLaunch cause); + CauseForGpuLaunch cause); // The following 3 IDs let one uniquely identify this context. // Gets the GPU process ID for this context. @@ -127,7 +127,7 @@ class WebGraphicsContext3DCommandBufferImpl const WebGraphicsContext3D::Attributes& attributes, bool bind_generates_resources, const GURL& active_url, - content::CauseForGpuLaunch cause); + CauseForGpuLaunch cause); // Create & initialize a WebGraphicsContext3DCommandBufferImpl. Return NULL // on any failure. @@ -729,4 +729,6 @@ class WebGraphicsContext3DCommandBufferImpl bool use_echo_for_swap_ack_; }; +} // namespace content + #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 106e922..a139650 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -36,6 +36,7 @@ #include "content/common/gpu/stream_texture_manager_android.h" #endif +namespace content { namespace { // This filter does two things: // - it counts the number of messages coming in on the channel @@ -170,7 +171,7 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, disallowed_features_.multisampling = command_line->HasSwitch(switches::kDisableGLMultisampling); #if defined(OS_ANDROID) - stream_texture_manager_.reset(new content::StreamTextureManagerAndroid(this)); + stream_texture_manager_.reset(new StreamTextureManagerAndroid(this)); #endif } @@ -571,7 +572,7 @@ void GpuChannel::OnRegisterStreamTextureProxy( } void GpuChannel::OnEstablishStreamTexture( - int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type, + int32 stream_id, SurfaceTexturePeer::SurfaceTextureTarget type, int32 primary_id, int32 secondary_id) { stream_texture_manager_->EstablishStreamTexture( stream_id, type, primary_id, secondary_id); @@ -580,7 +581,7 @@ void GpuChannel::OnEstablishStreamTexture( void GpuChannel::OnCollectRenderingStatsForSurface( int32 surface_id, IPC::Message* reply_message) { - content::GpuRenderingStats stats; + GpuRenderingStats stats; for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); !it.IsAtEnd(); it.Advance()) { @@ -607,3 +608,5 @@ void GpuChannel::OnCollectRenderingStatsForSurface( stats); Send(reply_message); } + +} // namespace content diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h index fc43820..c790454 100644 --- a/content/common/gpu/gpu_channel.h +++ b/content/common/gpu/gpu_channel.h @@ -28,9 +28,7 @@ #include "content/common/android/surface_texture_peer.h" #endif -class GpuChannelManager; struct GPUCreateCommandBufferConfig; -class GpuWatchdog; namespace base { class MessageLoopProxy; @@ -50,6 +48,10 @@ class StreamTextureManagerAndroid; } #endif +namespace content { +class GpuChannelManager; +class GpuWatchdog; + // Encapsulates an IPC channel between the GPU process and one renderer // process. On the renderer side there's a corresponding GpuChannelHost. class GpuChannel : public IPC::Listener, @@ -135,7 +137,7 @@ class GpuChannel : public IPC::Listener, scoped_refptr<gpu::RefCountedCounter> preempt_by_counter); #if defined(OS_ANDROID) - content::StreamTextureManagerAndroid* stream_texture_manager() { + StreamTextureManagerAndroid* stream_texture_manager() { return stream_texture_manager_.get(); } #endif @@ -168,7 +170,7 @@ class GpuChannel : public IPC::Listener, // Create a java surface texture object and send it to the renderer process // through binder thread. void OnEstablishStreamTexture( - int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type, + int32 stream_id, SurfaceTexturePeer::SurfaceTextureTarget type, int32 primary_id, int32 secondary_id); #endif @@ -222,7 +224,7 @@ class GpuChannel : public IPC::Listener, bool processed_get_state_fast_; #if defined(OS_ANDROID) - scoped_ptr<content::StreamTextureManagerAndroid> stream_texture_manager_; + scoped_ptr<StreamTextureManagerAndroid> stream_texture_manager_; #endif base::WeakPtrFactory<GpuChannel> weak_factory_; @@ -230,4 +232,6 @@ class GpuChannel : public IPC::Listener, DISALLOW_COPY_AND_ASSIGN(GpuChannel); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc index 4b92daf..d39736a 100644 --- a/content/common/gpu/gpu_channel_manager.cc +++ b/content/common/gpu/gpu_channel_manager.cc @@ -18,6 +18,8 @@ #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_share_group.h" +namespace content { + GpuChannelManager::ImageOperation::ImageOperation( int32 sync_point, base::Closure callback) : sync_point(sync_point), @@ -274,3 +276,5 @@ gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { } return default_offscreen_surface_.get(); } + +} // namespace content diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h index 78b5079..9aaeda0 100644 --- a/content/common/gpu/gpu_channel_manager.h +++ b/content/common/gpu/gpu_channel_manager.h @@ -39,10 +39,12 @@ namespace IPC { struct ChannelHandle; } +struct GPUCreateCommandBufferConfig; + +namespace content { class ChildThread; class GpuChannel; class GpuWatchdog; -struct GPUCreateCommandBufferConfig; class SyncPointManager; // A GpuChannelManager is a thread responsible for issuing rendering commands @@ -149,4 +151,6 @@ class GpuChannelManager : public IPC::Listener, DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 32aa0dc..404d732 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -37,6 +37,7 @@ #include "content/common/gpu/stream_texture_manager_android.h" #endif +namespace content { namespace { // The GpuCommandBufferMemoryTracker class provides a bridge between the @@ -75,7 +76,7 @@ void FastSetActiveURL(const GURL& url, size_t url_hash) { static size_t g_last_url_hash = 0; if (url_hash != g_last_url_hash) { g_last_url_hash = url_hash; - content::GetContentClient()->SetActiveURL(url); + GetContentClient()->SetActiveURL(url); } } @@ -645,7 +646,7 @@ void GpuCommandBufferStub::OnGetTransferBuffer( if (buffer.shared_memory) { #if defined(OS_WIN) transfer_buffer = NULL; - content::BrokerDuplicateHandle(buffer.shared_memory->handle(), + BrokerDuplicateHandle(buffer.shared_memory->handle(), channel_->renderer_pid(), &transfer_buffer, FILE_MAP_READ | FILE_MAP_WRITE, 0); DCHECK(transfer_buffer != NULL); @@ -844,4 +845,6 @@ void GpuCommandBufferStub::SetMemoryAllocation( surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); } +} // namespace content + #endif // defined(ENABLE_GPU) diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 2bb79b6c..79ec479 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -33,11 +33,6 @@ #include "ui/surface/accelerated_surface_mac.h" #endif -class GpuChannel; -struct GpuMemoryAllocation; -class GpuVideoDecodeAccelerator; -class GpuWatchdog; - namespace gpu { namespace gles2 { class ImageManager; @@ -45,6 +40,13 @@ class MailboxManager; } } +namespace content { + +class GpuChannel; +class GpuVideoDecodeAccelerator; +class GpuWatchdog; +struct GpuMemoryAllocation; + // This Base class is used to expose methods of GpuCommandBufferStub used for // testability. class CONTENT_EXPORT GpuCommandBufferStubBase { @@ -298,4 +300,6 @@ class GpuCommandBufferStub DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ diff --git a/content/common/gpu/gpu_memory_allocation.h b/content/common/gpu/gpu_memory_allocation.h index fcf31e7..0a748d4 100644 --- a/content/common/gpu/gpu_memory_allocation.h +++ b/content/common/gpu/gpu_memory_allocation.h @@ -7,6 +7,8 @@ #include "base/basictypes.h" +namespace content { + // These are per context memory allocation limits set by the GpuMemoryManager // and assigned to the browser and renderer context. // They will change over time, given memory availability, and browser state. @@ -122,4 +124,6 @@ struct GpuMemoryAllocationRequest { } }; +} // namespace content + #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc index 3b9ffbd..46fa430 100644 --- a/content/common/gpu/gpu_memory_manager.cc +++ b/content/common/gpu/gpu_memory_manager.cc @@ -19,6 +19,7 @@ #include "content/common/gpu/gpu_memory_tracking.h" #include "gpu/command_buffer/service/gpu_switches.h" +namespace content { namespace { const int kDelayedScheduleManageTimeoutMs = 67; @@ -203,7 +204,7 @@ void GpuMemoryManager::RemoveTrackingGroup( } void GpuMemoryManager::GetVideoMemoryUsageStats( - content::GPUVideoMemoryUsageStats& video_memory_usage_stats) const { + GPUVideoMemoryUsageStats& video_memory_usage_stats) const { // For each context group, assign its memory usage to its PID video_memory_usage_stats.process_map.clear(); for (std::set<GpuMemoryTrackingGroup*>::const_iterator i = @@ -406,4 +407,6 @@ void GpuMemoryManager::Manage() { false); } +} // namespace content + #endif diff --git a/content/common/gpu/gpu_memory_manager.h b/content/common/gpu/gpu_memory_manager.h index a3a65cc..1256bb7 100644 --- a/content/common/gpu/gpu_memory_manager.h +++ b/content/common/gpu/gpu_memory_manager.h @@ -19,20 +19,24 @@ #include "content/public/common/gpu_memory_stats.h" #include "ui/gfx/size.h" +namespace content { class GpuCommandBufferStubBase; -class GpuMemoryTrackingGroup; +} #if defined(COMPILER_GCC) namespace BASE_HASH_NAMESPACE { template<> -struct hash<GpuCommandBufferStubBase*> { - size_t operator()(GpuCommandBufferStubBase* ptr) const { +struct hash<content::GpuCommandBufferStubBase*> { + size_t operator()(content::GpuCommandBufferStubBase* ptr) const { return hash<size_t>()(reinterpret_cast<size_t>(ptr)); } }; } // namespace BASE_HASH_NAMESPACE #endif // COMPILER +namespace content { +class GpuMemoryTrackingGroup; + class CONTENT_EXPORT GpuMemoryManagerClient { public: virtual ~GpuMemoryManagerClient() {} @@ -176,6 +180,8 @@ size_t GetMaximumTabAllocation() const { DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); }; +} // namespace content + #endif #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ diff --git a/content/common/gpu/gpu_memory_manager_unittest.cc b/content/common/gpu/gpu_memory_manager_unittest.cc index 549a246..bb57f30 100644 --- a/content/common/gpu/gpu_memory_manager_unittest.cc +++ b/content/common/gpu/gpu_memory_manager_unittest.cc @@ -9,6 +9,8 @@ #include "testing/gtest/include/gtest/gtest.h" +namespace content { + class FakeCommandBufferStub : public GpuCommandBufferStubBase { public: MemoryManagerState memory_manager_state_; @@ -682,3 +684,5 @@ TEST_F(GpuMemoryManagerTest, StubMemoryStatsForLastManageTests) { stub3allocation3 != GetMaximumTabAllocation()) EXPECT_GT(stub3allocation4, stub3allocation3); } + +} // namespace content diff --git a/content/common/gpu/gpu_memory_tracking.h b/content/common/gpu/gpu_memory_tracking.h index c20ad85..c8c7148 100644 --- a/content/common/gpu/gpu_memory_tracking.h +++ b/content/common/gpu/gpu_memory_tracking.h @@ -10,6 +10,8 @@ #include "base/basictypes.h" #include "content/common/gpu/gpu_memory_manager.h" +namespace content { + // All decoders in a context group point to a single GpuMemoryTrackingGroup, // which tracks GPU resource consumption for the entire context group. class GpuMemoryTrackingGroup { @@ -48,6 +50,8 @@ class GpuMemoryTrackingGroup { GpuMemoryManager* memory_manager_; }; +} // namespace content + #endif #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index e731d98..8645531 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -174,7 +174,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats) IPC_STRUCT_TRAITS_MEMBER(process_map) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(GpuMemoryAllocationForRenderer) +IPC_STRUCT_TRAITS_BEGIN(content::GpuMemoryAllocationForRenderer) IPC_STRUCT_TRAITS_MEMBER(gpu_resource_size_in_bytes) IPC_STRUCT_TRAITS_MEMBER(suggest_have_backbuffer) IPC_STRUCT_TRAITS_END() @@ -554,7 +554,7 @@ IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_EnsureBackbuffer) // Sent to proxy when the gpu memory manager changes its memory allocation. IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetMemoryAllocation, - GpuMemoryAllocationForRenderer /* allocation */) + content::GpuMemoryAllocationForRenderer /* allocation */) // Sent to stub when proxy is assigned a memory allocation changed callback. IPC_MESSAGE_ROUTED1( diff --git a/content/common/gpu/gpu_watchdog.h b/content/common/gpu/gpu_watchdog.h index bc421ce..3f42513 100644 --- a/content/common/gpu/gpu_watchdog.h +++ b/content/common/gpu/gpu_watchdog.h @@ -5,6 +5,8 @@ #ifndef CONTENT_COMMON_GPU_GPU_WATCHDOG_H_ #define CONTENT_COMMON_GPU_GPU_WATCHDOG_H_ +namespace content { + // Interface for objects that monitor the a GPUProcessor's progress. The // GPUProcessor will regularly invoke CheckArmed. class GpuWatchdog { @@ -19,4 +21,6 @@ class GpuWatchdog { DISALLOW_COPY_AND_ASSIGN(GpuWatchdog); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_GPU_WATCHDOG_H_ diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc index 1b1428b..8c1241d 100644 --- a/content/common/gpu/image_transport_surface.cc +++ b/content/common/gpu/image_transport_surface.cc @@ -18,6 +18,8 @@ #include "ui/gl/gl_switches.h" #include "ui/gl/gl_implementation.h" +namespace content { + ImageTransportSurface::ImageTransportSurface() {} ImageTransportSurface::~ImageTransportSurface() {} @@ -337,4 +339,6 @@ gfx::Size PassThroughImageTransportSurface::GetSize() { PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} +} // namespace content + #endif // defined(ENABLE_GPU) diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h index 348b5f6..3a9849e 100644 --- a/content/common/gpu/image_transport_surface.h +++ b/content/common/gpu/image_transport_surface.h @@ -22,9 +22,6 @@ #include "ui/gl/gl_surface.h" #include "ui/surface/transport_dib.h" -class GpuChannelManager; -class GpuCommandBufferStub; - struct GpuHostMsg_AcceleratedSurfaceNew_Params; struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; @@ -42,6 +39,10 @@ class GLES2Decoder; } } +namespace content { +class GpuChannelManager; +class GpuCommandBufferStub; + // The GPU process is agnostic as to how it displays results. On some platforms // it renders directly to window. On others it renders offscreen and transports // the results to the browser process to display. This file provides a simple @@ -193,6 +194,8 @@ class PassThroughImageTransportSurface DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); }; +} // namespace content + #endif // defined(ENABLE_GPU) #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc index 3aa190c..045a4c8 100644 --- a/content/common/gpu/image_transport_surface_android.cc +++ b/content/common/gpu/image_transport_surface_android.cc @@ -9,6 +9,8 @@ #include "content/common/gpu/texture_image_transport_surface.h" #include "ui/gl/gl_surface_egl.h" +namespace content { + // static scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( GpuChannelManager* manager, @@ -41,3 +43,5 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( return NULL; } } + +} // namespace content diff --git a/content/common/gpu/image_transport_surface_linux.cc b/content/common/gpu/image_transport_surface_linux.cc index 7957984..ffa2b5a 100644 --- a/content/common/gpu/image_transport_surface_linux.cc +++ b/content/common/gpu/image_transport_surface_linux.cc @@ -6,6 +6,8 @@ #include "content/common/gpu/texture_image_transport_surface.h" +namespace content { + // static scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( GpuChannelManager* manager, @@ -31,3 +33,5 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( else return NULL; } + +} // namespace content diff --git a/content/common/gpu/image_transport_surface_mac.cc b/content/common/gpu/image_transport_surface_mac.cc index 729068b..bb9defe 100644 --- a/content/common/gpu/image_transport_surface_mac.cc +++ b/content/common/gpu/image_transport_surface_mac.cc @@ -16,6 +16,7 @@ #include "ui/gl/gl_surface_cgl.h" #include "ui/surface/io_surface_support_mac.h" +namespace content { namespace { // IOSurface dimensions will be rounded up to a multiple of this value in order @@ -438,4 +439,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( return NULL; } +} // namespace content + #endif // defined(USE_GPU) diff --git a/content/common/gpu/image_transport_surface_win.cc b/content/common/gpu/image_transport_surface_win.cc index 1510f90..bc4953a 100644 --- a/content/common/gpu/image_transport_surface_win.cc +++ b/content/common/gpu/image_transport_surface_win.cc @@ -24,6 +24,7 @@ #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_surface_egl.h" +namespace content { namespace { // We are backed by an Pbuffer offscreen surface through which ANGLE provides @@ -285,4 +286,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( return NULL; } +} // namespace content + #endif // ENABLE_GPU diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index cc1e247..cf869ad 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc @@ -36,6 +36,8 @@ using gpu::gles2::TextureManager; +namespace content { + static bool MakeDecoderContextCurrent( const base::WeakPtr<GpuCommandBufferStub> stub) { if (!stub) { @@ -304,3 +306,5 @@ bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { DCHECK(sender_); return sender_->Send(message); } + +} // namespace content diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.h b/content/common/gpu/media/gpu_video_decode_accelerator.h index 6f7566c..1574b96 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.h +++ b/content/common/gpu/media/gpu_video_decode_accelerator.h @@ -15,6 +15,8 @@ #include "ipc/ipc_sender.h" #include "media/video/video_decode_accelerator.h" +namespace content { + class GpuVideoDecodeAccelerator : public IPC::Listener, public IPC::Sender, @@ -94,4 +96,6 @@ class GpuVideoDecodeAccelerator DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ diff --git a/content/common/gpu/stream_texture_manager_android.h b/content/common/gpu/stream_texture_manager_android.h index f0529d3..342ff40 100644 --- a/content/common/gpu/stream_texture_manager_android.h +++ b/content/common/gpu/stream_texture_manager_android.h @@ -13,7 +13,6 @@ #include "gpu/command_buffer/service/stream_texture.h" #include "gpu/command_buffer/service/stream_texture_manager.h" -class GpuChannel; struct GpuStreamTextureMsg_MatrixChanged_Params; namespace gfx { @@ -21,6 +20,7 @@ class Size; } namespace content { +class GpuChannel; class SurfaceTextureBridge; diff --git a/content/common/gpu/sync_point_manager.cc b/content/common/gpu/sync_point_manager.cc index 299d499..917871c 100644 --- a/content/common/gpu/sync_point_manager.cc +++ b/content/common/gpu/sync_point_manager.cc @@ -6,6 +6,8 @@ #include "base/logging.h" +namespace content { + SyncPointManager::SyncPointManager() : next_sync_point_(1) { } @@ -54,3 +56,5 @@ void SyncPointManager::AddSyncPointCallback(uint32 sync_point, } callback.Run(); } + +} // namespace content diff --git a/content/common/gpu/sync_point_manager.h b/content/common/gpu/sync_point_manager.h index fde3373..ea33ff3 100644 --- a/content/common/gpu/sync_point_manager.h +++ b/content/common/gpu/sync_point_manager.h @@ -13,6 +13,8 @@ #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" +namespace content { + // This class manages the sync points, which allow cross-channel // synchronization. class SyncPointManager : public base::RefCountedThreadSafe<SyncPointManager> { @@ -51,4 +53,6 @@ class SyncPointManager : public base::RefCountedThreadSafe<SyncPointManager> { DISALLOW_COPY_AND_ASSIGN(SyncPointManager); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_SYNC_POINT_MANAGER_H_ diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc index 7078a3e..ab0a276 100644 --- a/content/common/gpu/texture_image_transport_surface.cc +++ b/content/common/gpu/texture_image_transport_surface.cc @@ -22,6 +22,8 @@ using gpu::gles2::ContextGroup; using gpu::gles2::TextureManager; typedef TextureManager::TextureInfo TextureInfo; +namespace content { + TextureImageTransportSurface::Texture::Texture() : client_id(0), sent_to_client(false) { @@ -305,13 +307,13 @@ bool TextureImageTransportSurface::PostSubBuffer( std::vector<gfx::Rect> regions_to_copy; GetRegionsToCopy(previous_damage_rect_, new_damage_rect, ®ions_to_copy); - content::ScopedFrameBufferBinder fbo_binder(fbo_id_); + ScopedFrameBufferBinder fbo_binder(fbo_id_); glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, front_texture_service_id, 0); - content::ScopedTextureBinder texture_binder(back_texture_service_id); + ScopedTextureBinder texture_binder(back_texture_service_id); for (size_t i = 0; i < regions_to_copy.size(); ++i) { const gfx::Rect& region_to_copy = regions_to_copy[i]; @@ -445,7 +447,7 @@ void TextureImageTransportSurface::ReleaseTexture(int id) { info->SetServiceId(0); { - content::ScopedFrameBufferBinder fbo_binder(fbo_id_); + ScopedFrameBufferBinder fbo_binder(fbo_id_); glDeleteTextures(1, &service_id); } glFlush(); @@ -488,7 +490,7 @@ void TextureImageTransportSurface::CreateBackTexture(const gfx::Size& size) { } { - content::ScopedTextureBinder texture_binder(service_id); + ScopedTextureBinder texture_binder(service_id); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -515,7 +517,7 @@ void TextureImageTransportSurface::AttachBackTextureToFBO() { TextureInfo* info = textures_[back()].info; DCHECK(info); - content::ScopedFrameBufferBinder fbo_binder(fbo_id_); + ScopedFrameBufferBinder fbo_binder(fbo_id_); glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, @@ -546,3 +548,5 @@ void TextureImageTransportSurface::ReleaseParentStub() { } parent_stub_ = NULL; } + +} // namespace content diff --git a/content/common/gpu/texture_image_transport_surface.h b/content/common/gpu/texture_image_transport_surface.h index 66964c9..0d19d0f 100644 --- a/content/common/gpu/texture_image_transport_surface.h +++ b/content/common/gpu/texture_image_transport_surface.h @@ -12,6 +12,7 @@ #include "gpu/command_buffer/service/texture_manager.h" #include "ui/gl/gl_surface.h" +namespace content { class GpuChannelManager; class TextureImageTransportSurface : @@ -124,4 +125,6 @@ class TextureImageTransportSurface : DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); }; +} // namespace content + #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc index ae1e157..aa2d39c 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.cc +++ b/content/common/indexed_db/indexed_db_dispatcher.cc @@ -21,10 +21,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyRange.h" using base::ThreadLocalPointer; -using content::IndexedDBKey; -using content::IndexedDBKeyPath; -using content::IndexedDBKeyRange; -using content::SerializedScriptValue; using WebKit::WebDOMStringList; using WebKit::WebExceptionCode; using WebKit::WebFrame; @@ -37,6 +33,7 @@ using WebKit::WebIDBTransaction; using WebKit::WebIDBTransactionCallbacks; using webkit_glue::WorkerTaskRunner; +namespace content { static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher> >::Leaky g_idb_dispatcher_tls = LAZY_INSTANCE_INITIALIZER; @@ -419,7 +416,7 @@ void IndexedDBDispatcher::RequestIDBObjectStorePut( for (size_t i = 0; i < index_keys.size(); ++i) { params.index_keys[i].resize(index_keys[i].size()); for (size_t j = 0; j < index_keys[i].size(); ++j) { - params.index_keys[i][j] = content::IndexedDBKey(index_keys[i][j]); + params.index_keys[i][j] = IndexedDBKey(index_keys[i][j]); } } Send(new IndexedDBHostMsg_ObjectStorePut(params)); @@ -777,3 +774,5 @@ void IndexedDBDispatcher::ResetCursorPrefetchCaches(int32 exception_cursor_id) { i->second->ResetPrefetchCache(); } } + +} // namespace content diff --git a/content/common/indexed_db/indexed_db_dispatcher.h b/content/common/indexed_db/indexed_db_dispatcher.h index e55e9d6..6701cea 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.h +++ b/content/common/indexed_db/indexed_db_dispatcher.h @@ -25,12 +25,6 @@ struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; -class RendererWebIDBCursorImpl; -class RendererWebIDBDatabaseImpl; - -namespace IPC { -class Message; -} namespace WebKit { class WebFrame; @@ -41,8 +35,9 @@ namespace content { class IndexedDBKey; class IndexedDBKeyPath; class IndexedDBKeyRange; +class RendererWebIDBCursorImpl; +class RendererWebIDBDatabaseImpl; class SerializedScriptValue; -} CONTENT_EXPORT extern const size_t kMaxIDBValueSizeInBytes; @@ -91,7 +86,7 @@ class CONTENT_EXPORT IndexedDBDispatcher WebKit::WebExceptionCode* ec); void RequestIDBCursorContinue( - const content::IndexedDBKey& key, + const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks_ptr, int32 idb_cursor_id, WebKit::WebExceptionCode* ec); @@ -143,29 +138,29 @@ class CONTENT_EXPORT IndexedDBDispatcher WebKit::WebExceptionCode* ec); void RequestIDBIndexGetObject( - const content::IndexedDBKeyRange& key_range, + const IndexedDBKeyRange& key_range, WebKit::WebIDBCallbacks* callbacks, int32 idb_index_id, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode* ec); void RequestIDBIndexGetKey( - const content::IndexedDBKeyRange& key_range, + const IndexedDBKeyRange& key_range, WebKit::WebIDBCallbacks* callbacks, int32 idb_index_id, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode* ec); void RequestIDBObjectStoreGet( - const content::IndexedDBKeyRange& key_range, + const IndexedDBKeyRange& key_range, WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode* ec); void RequestIDBObjectStorePut( - const content::SerializedScriptValue& value, - const content::IndexedDBKey& key, + const SerializedScriptValue& value, + const IndexedDBKey& key, WebKit::WebIDBObjectStore::PutMode putMode, WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id, @@ -175,7 +170,7 @@ class CONTENT_EXPORT IndexedDBDispatcher WebKit::WebExceptionCode* ec); void RequestIDBObjectStoreDelete( - const content::IndexedDBKeyRange& key_range, + const IndexedDBKeyRange& key_range, WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id, const WebKit::WebIDBTransaction& transaction, @@ -221,7 +216,7 @@ class CONTENT_EXPORT IndexedDBDispatcher int32 object_id); void OnSuccessIndexedDBKey(int32 thread_id, int32 response_id, - const content::IndexedDBKey& key); + const IndexedDBKey& key); void OnSuccessIDBTransaction(int32 thread_id, int32 response_id, int32 object_id); @@ -237,13 +232,13 @@ class CONTENT_EXPORT IndexedDBDispatcher void OnSuccessSerializedScriptValue( int32 thread_id, int32 response_id, - const content::SerializedScriptValue& value); + const SerializedScriptValue& value); void OnSuccessSerializedScriptValueWithKey( int32 thread_id, int32 response_id, - const content::SerializedScriptValue& value, - const content::IndexedDBKey& primary_key, - const content::IndexedDBKeyPath& key_path); + const SerializedScriptValue& value, + const IndexedDBKey& primary_key, + const IndexedDBKeyPath& key_path); void OnSuccessInteger( int32 thread_id, int32 response_id, @@ -295,4 +290,6 @@ class CONTENT_EXPORT IndexedDBDispatcher DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ diff --git a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc index c9b48f5..36f52ca 100644 --- a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc +++ b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc @@ -12,11 +12,11 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" -using content::IndexedDBKey; -using content::SerializedScriptValue; using WebKit::WebVector; using WebKit::WebString; +namespace content { + class FakeWebIDBTransaction : public WebKit::WebIDBTransaction { public: FakeWebIDBTransaction() {} @@ -48,3 +48,5 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) { EXPECT_NE(ec, 0); } } + +} // namespace content diff --git a/content/common/indexed_db/indexed_db_message_filter.cc b/content/common/indexed_db/indexed_db_message_filter.cc index 1d90bd2..9f6672cb 100644 --- a/content/common/indexed_db/indexed_db_message_filter.cc +++ b/content/common/indexed_db/indexed_db_message_filter.cc @@ -13,6 +13,8 @@ using webkit_glue::WorkerTaskRunner; +namespace content { + IndexedDBMessageFilter::IndexedDBMessageFilter() : main_thread_loop_proxy_(base::MessageLoopProxy::current()) { } @@ -35,3 +37,5 @@ IndexedDBMessageFilter::~IndexedDBMessageFilter() {} void IndexedDBMessageFilter::DispatchMessage(const IPC::Message& msg) { IndexedDBDispatcher::ThreadSpecificInstance()->OnMessageReceived(msg); } + +} // namespace content diff --git a/content/common/indexed_db/indexed_db_message_filter.h b/content/common/indexed_db/indexed_db_message_filter.h index c599381..749564b 100644 --- a/content/common/indexed_db/indexed_db_message_filter.h +++ b/content/common/indexed_db/indexed_db_message_filter.h @@ -7,12 +7,13 @@ #include "ipc/ipc_channel_proxy.h" -class IndexedDBDispatcher; - namespace base { class MessageLoopProxy; } // namespace base +namespace content { +class IndexedDBDispatcher; + class IndexedDBMessageFilter : public IPC::ChannelProxy::MessageFilter { public: IndexedDBMessageFilter(); @@ -30,4 +31,6 @@ class IndexedDBMessageFilter : public IPC::ChannelProxy::MessageFilter { DISALLOW_COPY_AND_ASSIGN(IndexedDBMessageFilter); }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.cc b/content/common/indexed_db/proxy_webidbcursor_impl.cc index c5db1a2..1417ee6 100644 --- a/content/common/indexed_db/proxy_webidbcursor_impl.cc +++ b/content/common/indexed_db/proxy_webidbcursor_impl.cc @@ -10,13 +10,13 @@ #include "content/common/indexed_db/indexed_db_messages.h" #include "content/common/indexed_db/indexed_db_dispatcher.h" -using content::IndexedDBKey; -using content::SerializedScriptValue; using WebKit::WebExceptionCode; using WebKit::WebIDBCallbacks; using WebKit::WebIDBKey; using WebKit::WebSerializedScriptValue; +namespace content { + RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id) : idb_cursor_id_(idb_cursor_id), continue_count_(0), @@ -160,3 +160,5 @@ void RendererWebIDBCursorImpl::ResetPrefetchCache() { pending_onsuccess_callbacks_ = 0; } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.h b/content/common/indexed_db/proxy_webidbcursor_impl.h index f22e473..d19b233 100644 --- a/content/common/indexed_db/proxy_webidbcursor_impl.h +++ b/content/common/indexed_db/proxy_webidbcursor_impl.h @@ -16,6 +16,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h" +namespace content { + class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { public: explicit RendererWebIDBCursorImpl(int32 idb_cursor_id); @@ -32,9 +34,9 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { virtual void postSuccessHandlerCallback(); void SetPrefetchData( - const std::vector<content::IndexedDBKey>& keys, - const std::vector<content::IndexedDBKey>& primary_keys, - const std::vector<content::SerializedScriptValue>& values); + const std::vector<IndexedDBKey>& keys, + const std::vector<IndexedDBKey>& primary_keys, + const std::vector<SerializedScriptValue>& values); void CachedContinue(WebKit::WebIDBCallbacks* callbacks); void ResetPrefetchCache(); @@ -43,9 +45,9 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { int32 idb_cursor_id_; // Prefetch cache. - std::deque<content::IndexedDBKey> prefetch_keys_; - std::deque<content::IndexedDBKey> prefetch_primary_keys_; - std::deque<content::SerializedScriptValue> prefetch_values_; + std::deque<IndexedDBKey> prefetch_keys_; + std::deque<IndexedDBKey> prefetch_primary_keys_; + std::deque<SerializedScriptValue> prefetch_values_; // Number of continue calls that would qualify for a pre-fetch. int continue_count_; @@ -64,4 +66,6 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { enum { kMaxPrefetchAmount = 100 }; }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ diff --git a/content/common/indexed_db/proxy_webidbdatabase_impl.cc b/content/common/indexed_db/proxy_webidbdatabase_impl.cc index b396a21..b7f3695 100644 --- a/content/common/indexed_db/proxy_webidbdatabase_impl.cc +++ b/content/common/indexed_db/proxy_webidbdatabase_impl.cc @@ -29,6 +29,8 @@ using WebKit::WebString; using WebKit::WebVector; using webkit_glue::WorkerTaskRunner; +namespace content { + RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) : idb_database_id_(idb_database_id) { } @@ -97,7 +99,7 @@ WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( IndexedDBHostMsg_DatabaseCreateObjectStore_Params params; params.id = id; params.name = name; - params.key_path = content::IndexedDBKeyPath(key_path); + params.key_path = IndexedDBKeyPath(key_path); params.auto_increment = auto_increment; params.transaction_id = IndexedDBDispatcher::TransactionId(transaction); params.idb_database_id = idb_database_id_; @@ -154,3 +156,5 @@ void RendererWebIDBDatabaseImpl::close() { IndexedDBDispatcher::ThreadSpecificInstance(); dispatcher->RequestIDBDatabaseClose(idb_database_id_); } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbdatabase_impl.h b/content/common/indexed_db/proxy_webidbdatabase_impl.h index 50d44da..9be5196 100644 --- a/content/common/indexed_db/proxy_webidbdatabase_impl.h +++ b/content/common/indexed_db/proxy_webidbdatabase_impl.h @@ -15,6 +15,8 @@ class WebString; class WebIDBTransaction; } +namespace content { + class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { public: explicit RendererWebIDBDatabaseImpl(int32 idb_database_id); @@ -50,4 +52,6 @@ class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { int32 idb_database_id_; }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBDATABASE_IMPL_H_ diff --git a/content/common/indexed_db/proxy_webidbfactory_impl.cc b/content/common/indexed_db/proxy_webidbfactory_impl.cc index a9cbc07..ebbeb37 100644 --- a/content/common/indexed_db/proxy_webidbfactory_impl.cc +++ b/content/common/indexed_db/proxy_webidbfactory_impl.cc @@ -17,6 +17,8 @@ using WebKit::WebIDBDatabaseCallbacks; using WebKit::WebSecurityOrigin; using WebKit::WebString; +namespace content { + RendererWebIDBFactoryImpl::RendererWebIDBFactoryImpl() { } @@ -64,3 +66,5 @@ void RendererWebIDBFactoryImpl::deleteDatabase( dispatcher->RequestIDBFactoryDeleteDatabase( name, callbacks, origin.databaseIdentifier(), web_frame); } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbfactory_impl.h b/content/common/indexed_db/proxy_webidbfactory_impl.h index ff839cd..a03c0d2 100644 --- a/content/common/indexed_db/proxy_webidbfactory_impl.h +++ b/content/common/indexed_db/proxy_webidbfactory_impl.h @@ -16,6 +16,8 @@ class WebSecurityOrigin; class WebString; } +namespace content { + class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { public: RendererWebIDBFactoryImpl(); @@ -43,4 +45,6 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { const WebKit::WebString& data_dir); }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBFACTORY_IMPL_H_ diff --git a/content/common/indexed_db/proxy_webidbindex_impl.cc b/content/common/indexed_db/proxy_webidbindex_impl.cc index 3a2e05d..7d21b2a 100644 --- a/content/common/indexed_db/proxy_webidbindex_impl.cc +++ b/content/common/indexed_db/proxy_webidbindex_impl.cc @@ -12,14 +12,14 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" -using content::IndexedDBKeyPath; -using content::IndexedDBKeyRange; using WebKit::WebExceptionCode; using WebKit::WebDOMStringList; using WebKit::WebIDBKeyPath; using WebKit::WebString; using WebKit::WebVector; +namespace content { + RendererWebIDBIndexImpl::RendererWebIDBIndexImpl(int32 idb_index_id) : idb_index_id_(idb_index_id) { } @@ -91,3 +91,5 @@ void RendererWebIDBIndexImpl::getKey( IndexedDBKeyRange(key_range), callbacks, idb_index_id_, transaction, &ec); } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbindex_impl.h b/content/common/indexed_db/proxy_webidbindex_impl.h index 7551a60..e9ae696 100644 --- a/content/common/indexed_db/proxy_webidbindex_impl.h +++ b/content/common/indexed_db/proxy_webidbindex_impl.h @@ -9,6 +9,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBIndex.h" +namespace content { + class RendererWebIDBIndexImpl : public WebKit::WebIDBIndex { public: explicit RendererWebIDBIndexImpl(int32 idb_index_id); @@ -42,4 +44,7 @@ class RendererWebIDBIndexImpl : public WebKit::WebIDBIndex { int32 idb_index_id_; }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBINDEX_IMPL_H_ + diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc index 8d76dca..9b76dd9 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc @@ -20,9 +20,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -using content::IndexedDBKey; -using content::IndexedDBKeyPath; -using content::IndexedDBKeyRange; using content::SerializedScriptValue; using WebKit::WebDOMStringList; using WebKit::WebExceptionCode; @@ -37,6 +34,8 @@ using WebKit::WebSerializedScriptValue; using WebKit::WebString; using WebKit::WebVector; +namespace content { + RendererWebIDBObjectStoreImpl::RendererWebIDBObjectStoreImpl( int32 idb_object_store_id) : idb_object_store_id_(idb_object_store_id) { @@ -214,3 +213,5 @@ void RendererWebIDBObjectStoreImpl::count( idb_key_range, callbacks, idb_object_store_id_, transaction, &ec); } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.h b/content/common/indexed_db/proxy_webidbobjectstore_impl.h index 451a3cb..9499bc3 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.h +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.h @@ -17,6 +17,8 @@ class WebIDBKeyRange; class WebString; } +namespace content { + class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { public: explicit RendererWebIDBObjectStoreImpl(int32 idb_object_store_id); @@ -86,4 +88,6 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { int32 idb_object_store_id_; }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBOBJECTSTORE_IMPL_H_ diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.cc b/content/common/indexed_db/proxy_webidbtransaction_impl.cc index 8f04e3c..1f39c09 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.cc +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.cc @@ -16,6 +16,8 @@ using WebKit::WebIDBObjectStore; using WebKit::WebIDBTransactionCallbacks; using WebKit::WebString; +namespace content { + RendererWebIDBTransactionImpl::RendererWebIDBTransactionImpl( int32 idb_transaction_id) : idb_transaction_id_(idb_transaction_id) { @@ -65,3 +67,5 @@ void RendererWebIDBTransactionImpl::setCallbacks( dispatcher->RegisterWebIDBTransactionCallbacks(callbacks, idb_transaction_id_); } + +} // namespace content diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.h b/content/common/indexed_db/proxy_webidbtransaction_impl.h index 2b57b87..f5103c0 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.h +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.h @@ -14,6 +14,8 @@ class WebIDBTransactionCallbacks; class WebString; } +namespace content { + class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { public: explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id); @@ -32,4 +34,6 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { int32 idb_transaction_id_; }; +} // namespace content + #endif // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBTRANSACTION_IMPL_H_ diff --git a/content/common/net/url_request_user_data.cc b/content/common/net/url_request_user_data.cc index a2529f8..3394c58 100644 --- a/content/common/net/url_request_user_data.cc +++ b/content/common/net/url_request_user_data.cc @@ -4,6 +4,8 @@ #include "content/common/net/url_request_user_data.h" +namespace content { + URLRequestUserData::URLRequestUserData(int render_process_id, int render_view_id) : render_process_id_(render_process_id), @@ -14,3 +16,5 @@ URLRequestUserData::~URLRequestUserData() {} // static const void* URLRequestUserData::kUserDataKey = static_cast<const void*>(&URLRequestUserData::kUserDataKey); + +} // namespace content diff --git a/content/common/net/url_request_user_data.h b/content/common/net/url_request_user_data.h index 8845a01..c3e464f 100644 --- a/content/common/net/url_request_user_data.h +++ b/content/common/net/url_request_user_data.h @@ -7,6 +7,8 @@ #include "base/supports_user_data.h" +namespace content { + // Used to annotate all URLRequests for which the request can be associated // with a given render view. class URLRequestUserData : public base::SupportsUserData::Data { @@ -24,4 +26,6 @@ class URLRequestUserData : public base::SupportsUserData::Data { int render_view_id_; }; +} // namespace content + #endif // CONTENT_COMMON_NET_URL_REQUEST_USER_DATA_H_ diff --git a/content/common/quota_dispatcher.cc b/content/common/quota_dispatcher.cc index 6b7d830..ac45e1d 100644 --- a/content/common/quota_dispatcher.cc +++ b/content/common/quota_dispatcher.cc @@ -18,6 +18,7 @@ using WebKit::WebStorageQuotaCallbacks; using WebKit::WebStorageQuotaError; using WebKit::WebStorageQuotaType; +namespace content { namespace { // QuotaDispatcher::Callback implementation for WebStorageQuotaCallbacks. @@ -135,3 +136,5 @@ COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorNotSupported) == \ int(quota::kQuotaErrorNotSupported), mismatching_enums); COMPILE_ASSERT(int(WebKit::WebStorageQuotaErrorAbort) == \ int(quota::kQuotaErrorAbort), mismatching_enums); + +} // namespace content diff --git a/content/common/quota_dispatcher.h b/content/common/quota_dispatcher.h index f636623..465bb02 100644 --- a/content/common/quota_dispatcher.h +++ b/content/common/quota_dispatcher.h @@ -23,6 +23,8 @@ namespace WebKit { class WebStorageQuotaCallbacks; } +namespace content { + // Dispatches and sends quota related messages sent to/from a child // process from/to the main browser process. There is one instance // per child process. Messages are dispatched on the main child thread. @@ -69,4 +71,6 @@ class QuotaDispatcher : public IPC::Listener { DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); }; +} // namespace content + #endif // CONTENT_COMMON_QUOTA_DISPATCHER_H_ diff --git a/content/common/socket_stream_dispatcher.cc b/content/common/socket_stream_dispatcher.cc index f573329..d4bf448 100644 --- a/content/common/socket_stream_dispatcher.cc +++ b/content/common/socket_stream_dispatcher.cc @@ -19,6 +19,8 @@ #include "webkit/glue/websocketstreamhandle_bridge.h" #include "webkit/glue/websocketstreamhandle_delegate.h" +namespace content { + // IPCWebSocketStreamHandleBridge is owned by each SocketStreamHandle. // It communicates with the main browser process via SocketStreamDispatcher. class IPCWebSocketStreamHandleBridge @@ -231,3 +233,5 @@ void SocketStreamDispatcher::OnClosed(int socket_id) { else DLOG(ERROR) << "No SocketStreamHandleBridge for socket_id=" << socket_id; } + +} // namespace content diff --git a/content/common/socket_stream_dispatcher.h b/content/common/socket_stream_dispatcher.h index 3165c49..2a67f73 100644 --- a/content/common/socket_stream_dispatcher.h +++ b/content/common/socket_stream_dispatcher.h @@ -20,6 +20,8 @@ class WebSocketStreamHandleBridge; class WebSocketStreamHandleDelegate; } +namespace content { + // Dispatches socket stream related messages sent to a child process from the // main browser process. There is one instance per child process. Messages // are dispatched on the main child thread. The RenderThread class @@ -45,4 +47,6 @@ class SocketStreamDispatcher : public IPC::Listener { DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcher); }; +} // namespace content + #endif // CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_ diff --git a/content/common/webkitplatformsupport_impl.h b/content/common/webkitplatformsupport_impl.h index f579ce0..889fb75 100644 --- a/content/common/webkitplatformsupport_impl.h +++ b/content/common/webkitplatformsupport_impl.h @@ -10,9 +10,8 @@ #include "ui/base/layout.h" #include "webkit/glue/webkitplatformsupport_impl.h" -class GpuChannelHostFactory; - namespace content { +class GpuChannelHostFactory; // This is a specialization of WebKitPlatformSupportImpl that implements the // embedder functions in terms of ContentClient. diff --git a/content/common/webmessageportchannel_impl.cc b/content/common/webmessageportchannel_impl.cc index 8e8f8c1..6c6203f 100644 --- a/content/common/webmessageportchannel_impl.cc +++ b/content/common/webmessageportchannel_impl.cc @@ -16,6 +16,8 @@ using WebKit::WebMessagePortChannelArray; using WebKit::WebMessagePortChannelClient; using WebKit::WebString; +namespace content { + WebMessagePortChannelImpl::WebMessagePortChannelImpl() : client_(NULL), route_id_(MSG_ROUTING_NONE), @@ -248,3 +250,5 @@ void WebMessagePortChannelImpl::OnMessagedQueued() { WebMessagePortChannelImpl::Message::Message() {} WebMessagePortChannelImpl::Message::~Message() {} + +} // namespace content diff --git a/content/common/webmessageportchannel_impl.h b/content/common/webmessageportchannel_impl.h index f142731..edcac40 100644 --- a/content/common/webmessageportchannel_impl.h +++ b/content/common/webmessageportchannel_impl.h @@ -15,6 +15,8 @@ #include "ipc/ipc_listener.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h" +namespace content { + // This is thread safe. class WebMessagePortChannelImpl : public WebKit::WebMessagePortChannel, @@ -74,4 +76,6 @@ class WebMessagePortChannelImpl DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl); }; +} // namespace content + #endif // CONTENT_COMMON_WEBMESSAGEPORTCHANNEL_IMPL_H_ |