diff options
Diffstat (limited to 'chromium/content')
35 files changed, 238 insertions, 185 deletions
diff --git a/chromium/content/browser/browser_main_loop.cc b/chromium/content/browser/browser_main_loop.cc index c2787e08c72..1930bc083a7 100644 --- a/chromium/content/browser/browser_main_loop.cc +++ b/chromium/content/browser/browser_main_loop.cc @@ -654,7 +654,7 @@ int BrowserMainLoop::CreateThreads() { "BrowserMainLoop::CreateThreads:start", "Thread", "BrowserThread::FILE"); thread_to_start = &file_thread_; -#if defined(OS_WIN) && !defined(TOOLKIT_QT) +#if defined(OS_WIN) // On Windows, the FILE thread needs to be have a UI message loop // which pumps messages in such a way that Google Update can // communicate back to us. diff --git a/chromium/content/browser/devtools/worker_devtools_manager.cc b/chromium/content/browser/devtools/worker_devtools_manager.cc index 983c55cfb2b..f0608815f33 100644 --- a/chromium/content/browser/devtools/worker_devtools_manager.cc +++ b/chromium/content/browser/devtools/worker_devtools_manager.cc @@ -51,6 +51,19 @@ base::LazyInstance<AgentHosts>::Leaky g_orphan_map = LAZY_INSTANCE_INITIALIZER; } // namespace +struct WorkerDevToolsManager::TerminatedInspectedWorker { + TerminatedInspectedWorker(WorkerId id, + const GURL& url, + const base::string16& name) + : old_worker_id(id), + worker_url(url), + worker_name(name) {} + WorkerId old_worker_id; + GURL worker_url; + base::string16 worker_name; +}; + + class WorkerDevToolsManager::WorkerDevToolsAgentHost : public IPCDevToolsAgentHost { public: @@ -189,6 +202,19 @@ class WorkerDevToolsManager::DetachedClientHosts { } }; +struct WorkerDevToolsManager::InspectedWorker { + InspectedWorker(WorkerProcessHost* host, int route_id, const GURL& url, + const base::string16& name) + : host(host), + route_id(route_id), + worker_url(url), + worker_name(name) {} + WorkerProcessHost* const host; + int const route_id; + GURL worker_url; + base::string16 worker_name; +}; + // static WorkerDevToolsManager* WorkerDevToolsManager::GetInstance() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/chromium/content/browser/devtools/worker_devtools_manager.h b/chromium/content/browser/devtools/worker_devtools_manager.h index 955b1db5d47..8a9a7084226 100644 --- a/chromium/content/browser/devtools/worker_devtools_manager.h +++ b/chromium/content/browser/devtools/worker_devtools_manager.h @@ -54,20 +54,7 @@ class WorkerDevToolsManager { private: friend struct DefaultSingletonTraits<WorkerDevToolsManager>; class DetachedClientHosts; - - struct InspectedWorker { - InspectedWorker(WorkerProcessHost* host, int route_id, const GURL& url, - const base::string16& name) - : host(host), - route_id(route_id), - worker_url(url), - worker_name(name) {} - WorkerProcessHost* const host; - int const route_id; - GURL worker_url; - base::string16 worker_name; - }; - + struct InspectedWorker; typedef std::list<InspectedWorker> InspectedWorkersList; WorkerDevToolsManager(); @@ -97,16 +84,7 @@ class WorkerDevToolsManager { InspectedWorkersList inspected_workers_; - struct TerminatedInspectedWorker { - TerminatedInspectedWorker(WorkerId id, const GURL& url, const base::string16& name) - : old_worker_id(id), - worker_url(url), - worker_name(name) {} - WorkerId old_worker_id; - GURL worker_url; - base::string16 worker_name; - }; - + struct TerminatedInspectedWorker; typedef std::list<TerminatedInspectedWorker> TerminatedInspectedWorkers; // List of terminated workers for which there may be a devtools client on // the UI thread. Worker entry is added into this list when inspected worker diff --git a/chromium/content/browser/gpu/gpu_process_host.cc b/chromium/content/browser/gpu/gpu_process_host.cc index c28ba8b7499..1b7da1c8d7c 100644 --- a/chromium/content/browser/gpu/gpu_process_host.cc +++ b/chromium/content/browser/gpu/gpu_process_host.cc @@ -577,13 +577,7 @@ bool GpuProcessHost::Init() { switches::kDisableGpuWatchdog); in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); -#if defined(OS_WIN) && defined(TOOLKIT_QT) - base::Thread::Options options; - options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; - in_process_gpu_thread_->StartWithOptions(options); -#else in_process_gpu_thread_->Start(); -#endif OnProcessLaunched(); // Fake a callback that the process is ready. } else if (!LaunchGpuProcess(channel_id)) { diff --git a/chromium/content/browser/media/webrtc_identity_store_backend.cc b/chromium/content/browser/media/webrtc_identity_store_backend.cc index 697de93c927..d599dcda742 100644 --- a/chromium/content/browser/media/webrtc_identity_store_backend.cc +++ b/chromium/content/browser/media/webrtc_identity_store_backend.cc @@ -46,6 +46,43 @@ static bool InitDB(sql::Connection* db) { "creation_time INTEGER)"); } +struct WebRTCIdentityStoreBackend::IdentityKey { + IdentityKey(const GURL& origin, const std::string& identity_name) + : origin(origin), identity_name(identity_name) {} + + bool operator<(const IdentityKey& other) const { + return origin < other.origin || + (origin == other.origin && identity_name < other.identity_name); + } + + GURL origin; + std::string identity_name; +}; + +struct WebRTCIdentityStoreBackend::Identity { + Identity(const std::string& common_name, + const std::string& certificate, + const std::string& private_key) + : common_name(common_name), + certificate(certificate), + private_key(private_key), + creation_time(base::Time::Now().ToInternalValue()) {} + + Identity(const std::string& common_name, + const std::string& certificate, + const std::string& private_key, + int64 creation_time) + : common_name(common_name), + certificate(certificate), + private_key(private_key), + creation_time(creation_time) {} + + std::string common_name; + std::string certificate; + std::string private_key; + int64 creation_time; +}; + struct WebRTCIdentityStoreBackend::PendingFindRequest { PendingFindRequest(const GURL& origin, const std::string& identity_name, diff --git a/chromium/content/browser/media/webrtc_identity_store_backend.h b/chromium/content/browser/media/webrtc_identity_store_backend.h index 9be3fc2345e..92b68b62d67 100644 --- a/chromium/content/browser/media/webrtc_identity_store_backend.h +++ b/chromium/content/browser/media/webrtc_identity_store_backend.h @@ -11,7 +11,8 @@ #include "base/time/time.h" #include "sql/connection.h" #include "sql/meta_table.h" -#include "url/gurl.h" + +class GURL; namespace base { class FilePath; @@ -93,44 +94,7 @@ class WebRTCIdentityStoreBackend }; struct PendingFindRequest; struct IdentityKey; - - struct IdentityKey { - IdentityKey(const GURL& origin, const std::string& identity_name) - : origin(origin), identity_name(identity_name) {} - - bool operator<(const IdentityKey& other) const { - return origin < other.origin || - (origin == other.origin && identity_name < other.identity_name); - } - - GURL origin; - std::string identity_name; - }; - - struct Identity { - Identity(const std::string& common_name, - const std::string& certificate, - const std::string& private_key) - : common_name(common_name), - certificate(certificate), - private_key(private_key), - creation_time(base::Time::Now().ToInternalValue()) {} - - Identity(const std::string& common_name, - const std::string& certificate, - const std::string& private_key, - int64 creation_time) - : common_name(common_name), - certificate(certificate), - private_key(private_key), - creation_time(creation_time) {} - - std::string common_name; - std::string certificate; - std::string private_key; - int64 creation_time; - }; - + struct Identity; typedef std::map<IdentityKey, Identity> IdentityMap; ~WebRTCIdentityStoreBackend(); diff --git a/chromium/content/browser/message_port_service.cc b/chromium/content/browser/message_port_service.cc index 25c2b44200d..0d9f6084e86 100644 --- a/chromium/content/browser/message_port_service.cc +++ b/chromium/content/browser/message_port_service.cc @@ -9,6 +9,28 @@ namespace content { +struct MessagePortService::MessagePort { + // |filter| and |route_id| are what we need to send messages to the port. + // |filter| is just a weak pointer since we get notified when its process has + // gone away and remove it. + MessagePortMessageFilter* filter; + int route_id; + // A globally unique id for this message port. + int message_port_id; + // The globally unique id of the entangled message port. + int entangled_message_port_id; + // If true, all messages to this message port are queued and not delivered. + // This is needed so that when a message port is sent between processes all + // pending message get transferred. There are two possibilities for pending + // messages: either they are already received by the child process, or they're + // in-flight. This flag ensures that the latter type get flushed through the + // system. + // This flag should only be set to true in response to + // MessagePortHostMsg_QueueMessages. + bool queue_messages; + QueuedMessages queued_messages; +}; + MessagePortService* MessagePortService::GetInstance() { return Singleton<MessagePortService>::get(); } diff --git a/chromium/content/browser/message_port_service.h b/chromium/content/browser/message_port_service.h index 3e197a48aeb..668959167f7 100644 --- a/chromium/content/browser/message_port_service.h +++ b/chromium/content/browser/message_port_service.h @@ -64,28 +64,7 @@ class MessagePortService { // verify that the message port id exists. void Erase(int message_port_id); - struct MessagePort { - // |filter| and |route_id| are what we need to send messages to the port. - // |filter| is just a weak pointer since we get notified when its process has - // gone away and remove it. - MessagePortMessageFilter* filter; - int route_id; - // A globally unique id for this message port. - int message_port_id; - // The globally unique id of the entangled message port. - int entangled_message_port_id; - // If true, all messages to this message port are queued and not delivered. - // This is needed so that when a message port is sent between processes all - // pending message get transferred. There are two possibilities for pending - // messages: either they are already received by the child process, or they're - // in-flight. This flag ensures that the latter type get flushed through the - // system. - // This flag should only be set to true in response to - // MessagePortHostMsg_QueueMessages. - bool queue_messages; - QueuedMessages queued_messages; - }; - + struct MessagePort; typedef std::map<int, MessagePort> MessagePorts; MessagePorts message_ports_; diff --git a/chromium/content/browser/renderer_host/clipboard_message_filter.cc b/chromium/content/browser/renderer_host/clipboard_message_filter.cc index 6ba95f8f12c..bacce45dde4 100644 --- a/chromium/content/browser/renderer_host/clipboard_message_filter.cc +++ b/chromium/content/browser/renderer_host/clipboard_message_filter.cc @@ -31,6 +31,33 @@ void WriteObjectsOnUIThread(ui::Clipboard::ObjectMap* objects) { clipboard->WriteObjects(ui::CLIPBOARD_TYPE_COPY_PASTE, *objects); } +enum BitmapPolicy { + kFilterBitmap, + kAllowBitmap, +}; +void SanitizeObjectMap(ui::Clipboard::ObjectMap* objects, + BitmapPolicy bitmap_policy) { + if (bitmap_policy != kAllowBitmap) + objects->erase(ui::Clipboard::CBF_SMBITMAP); + + ui::Clipboard::ObjectMap::iterator data_it = + objects->find(ui::Clipboard::CBF_DATA); + if (data_it != objects->end()) { + const ui::Clipboard::FormatType& web_custom_format = + ui::Clipboard::GetWebCustomDataFormatType(); + if (data_it->second.size() != 2 || + !web_custom_format.Equals( + ui::Clipboard::FormatType::Deserialize(std::string( + &data_it->second[0].front(), + data_it->second[0].size())))) { + // CBF_DATA should always have two parameters associated with it, and the + // associated FormatType should always be web custom data. If not, then + // data is malformed and we'll ignore it. + objects->erase(ui::Clipboard::CBF_DATA); + } + } +} + } // namespace @@ -101,6 +128,7 @@ void ClipboardMessageFilter::OnWriteObjectsSync( // to the clipboard later. scoped_ptr<ui::Clipboard::ObjectMap> long_living_objects( new ui::Clipboard::ObjectMap(objects)); + SanitizeObjectMap(long_living_objects.get(), kAllowBitmap); // Splice the shared memory handle into the data. |long_living_objects| now // contains a heap-allocated SharedMemory object that references // |bitmap_handle|. This reference will keep the shared memory section alive @@ -123,7 +151,7 @@ void ClipboardMessageFilter::OnWriteObjectsAsync( // be removed otherwise we might dereference a rubbish pointer. scoped_ptr<ui::Clipboard::ObjectMap> sanitized_objects( new ui::Clipboard::ObjectMap(objects)); - sanitized_objects->erase(ui::Clipboard::CBF_SMBITMAP); + SanitizeObjectMap(sanitized_objects.get(), kFilterBitmap); #if defined(OS_WIN) // We cannot write directly from the IO thread, and cannot service the IPC diff --git a/chromium/content/browser/renderer_host/render_process_host_impl.cc b/chromium/content/browser/renderer_host/render_process_host_impl.cc index b5a5c497106..5d975e9119d 100644 --- a/chromium/content/browser/renderer_host/render_process_host_impl.cc +++ b/chromium/content/browser/renderer_host/render_process_host_impl.cc @@ -512,7 +512,7 @@ bool RenderProcessHostImpl::Init() { in_process_renderer_.reset(g_renderer_main_thread_factory(channel_id)); base::Thread::Options options; -#if defined(OS_WIN) && !defined(OS_MACOSX) && !defined(TOOLKIT_QT) +#if defined(OS_WIN) && !defined(OS_MACOSX) // In-process plugins require this to be a UI message loop. options.message_loop_type = base::MessageLoop::TYPE_UI; #else diff --git a/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc b/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc index f4e1cfc6e41..19cbc5b4b35 100644 --- a/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/chromium/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -709,7 +709,7 @@ void RenderSandboxHostLinux::Init(const std::string& sandbox_path) { childs_lifeline_fd_ = pipefds[1]; // We need to be monothreaded before we fork(). -#if !defined(TOOLKIT_GTK) && !defined(TOOLKIT_QT) +#if !defined(TOOLKIT_GTK) // Exclude gtk port as TestSuite in base/tests/test_suite.cc is calling // gtk_init. // TODO(oshima): Remove ifdef when above issues are resolved. diff --git a/chromium/content/browser/web_contents/web_contents_impl.cc b/chromium/content/browser/web_contents/web_contents_impl.cc index ee5b901ddc8..6b6cf00819e 100644 --- a/chromium/content/browser/web_contents/web_contents_impl.cc +++ b/chromium/content/browser/web_contents/web_contents_impl.cc @@ -1464,7 +1464,7 @@ void WebContentsImpl::CreateNewWidget(int render_process_id, // Save the created widget associated with the route so we can show it later. pending_widget_views_[route_id] = widget_view; -#if defined(OS_MACOSX) && !defined(TOOLKIT_QT) +#if defined(OS_MACOSX) // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it // to allow it to survive the trip without being hosted. base::mac::NSObjectRetain(widget_view->GetNativeView()); @@ -1529,7 +1529,7 @@ void WebContentsImpl::ShowCreatedWidget(int route_id, // used to implement Pepper Flash fullscreen. render_widget_host_impl->set_allow_privileged_mouse_lock(is_fullscreen); -#if defined(OS_MACOSX) && !defined(TOOLKIT_QT) +#if defined(OS_MACOSX) // A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's // properly embedded (or purposefully ignored) we can release the retain we // took in CreateNewWidget(). diff --git a/chromium/content/common/child_process_host_impl.cc b/chromium/content/common/child_process_host_impl.cc index 260749655a9..1467536ac91 100644 --- a/chromium/content/common/child_process_host_impl.cc +++ b/chromium/content/common/child_process_host_impl.cc @@ -107,7 +107,7 @@ base::FilePath ChildProcessHost::GetChildPath(int flags) { if (child_path.empty()) PathService::Get(CHILD_PROCESS_EXE, &child_path); -#if defined(OS_MACOSX) && 0 +#if defined(OS_MACOSX) DCHECK(!(flags & CHILD_NO_PIE && flags & CHILD_ALLOW_HEAP_EXECUTION)); // If needed, choose an executable with special flags set that inform the diff --git a/chromium/content/common/gpu/gpu_channel_manager.cc b/chromium/content/common/gpu/gpu_channel_manager.cc index fe3f7b34f12..8b466bd0b2b 100644 --- a/chromium/content/common/gpu/gpu_channel_manager.cc +++ b/chromium/content/common/gpu/gpu_channel_manager.cc @@ -11,7 +11,6 @@ #include "content/common/gpu/gpu_memory_manager.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/gpu/sync_point_manager.h" -#include "content/public/browser/content_browser_client.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/mailbox_manager.h" @@ -125,12 +124,7 @@ void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { DCHECK(!mailbox_manager_.get()); mailbox_manager_ = new gpu::gles2::MailboxManager; } - // Qt: Ask the browser client at the top to manage the context sharing. - // This can only work with --in-process-gpu or --single-process. - if (GetContentClient()->browser() && GetContentClient()->browser()->GetInProcessGpuShareGroup()) - share_group = GetContentClient()->browser()->GetInProcessGpuShareGroup(); - else - share_group = share_group_.get(); + share_group = share_group_.get(); mailbox_manager = mailbox_manager_.get(); } diff --git a/chromium/content/common/gpu/gpu_channel_manager.h b/chromium/content/common/gpu/gpu_channel_manager.h index 1ab04d94324..eb4d224d9b7 100644 --- a/chromium/content/common/gpu/gpu_channel_manager.h +++ b/chromium/content/common/gpu/gpu_channel_manager.h @@ -90,8 +90,6 @@ class GpuChannelManager : public IPC::Listener, gpu::gles2::ProgramCache* program_cache(); - gpu::gles2::MailboxManager* mailbox_manager() { return mailbox_manager_.get(); } - GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } GpuEventsDispatcher* gpu_devtools_events_dispatcher() { diff --git a/chromium/content/common/gpu/gpu_messages.h b/chromium/content/common/gpu/gpu_messages.h index 084b2d80676..936a8a020d3 100644 --- a/chromium/content/common/gpu/gpu_messages.h +++ b/chromium/content/common/gpu/gpu_messages.h @@ -116,12 +116,10 @@ IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params) IPC_STRUCT_END() #endif -#if defined(OS_WIN) -IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode) + IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode) IPC_STRUCT_TRAITS_MEMBER(values) IPC_STRUCT_TRAITS_MEMBER(children) IPC_STRUCT_TRAITS_END() -#endif IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPerformanceStats) IPC_STRUCT_TRAITS_MEMBER(graphics) diff --git a/chromium/content/common/plugin_list_posix.cc b/chromium/content/common/plugin_list_posix.cc index 0e822767c02..acd7830f738 100644 --- a/chromium/content/common/plugin_list_posix.cc +++ b/chromium/content/common/plugin_list_posix.cc @@ -151,7 +151,6 @@ bool IsUndesirablePlugin(const WebPluginInfo& info) { // http://code.google.com/p/chromium/issues/detail?id=38229 bool IsBlacklistedPlugin(const base::FilePath& path) { const char* kBlackListedPlugins[] = { - "skypebuttons.so", // Crash on dlopen since it uses Qt4 "nppdf.so", // Adobe PDF }; std::string filename = path.BaseName().value(); diff --git a/chromium/content/content_browser.gypi b/chromium/content/content_browser.gypi index 28878f77e47..99cc728c4ea 100644 --- a/chromium/content/content_browser.gypi +++ b/chromium/content/content_browser.gypi @@ -1323,7 +1323,6 @@ 'dependencies': [ 'browser/devtools/devtools_resources.gyp:devtools_resources', '../cc/cc.gyp:cc', - '../gpu/gpu.gyp:gpu_ipc', '../net/net.gyp:http_server', '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', '../ui/surface/surface.gyp:surface', @@ -1548,7 +1547,7 @@ ['exclude', '^browser/gamepad/gamepad_platform_data_fetcher_linux\\.cc$'], ], }], - ['use_aura!=1 and use_qt!=1 and OS!="win"', { + ['use_aura!=1 and OS!="win"', { 'sources!': [ 'browser/renderer_host/ui_events_helper.cc', 'browser/renderer_host/ui_events_helper.h', diff --git a/chromium/content/gpu/gpu_child_thread.cc b/chromium/content/gpu/gpu_child_thread.cc index a84a9e0a436..170b3648b56 100644 --- a/chromium/content/gpu/gpu_child_thread.cc +++ b/chromium/content/gpu/gpu_child_thread.cc @@ -40,8 +40,6 @@ bool GpuProcessLogMessageHandler(int severity, } // namespace -GpuChildThread* GpuChildThread::instance_ = 0; - GpuChildThread::GpuChildThread(GpuWatchdogThread* watchdog_thread, bool dead_on_arrival, const gpu::GPUInfo& gpu_info, @@ -55,8 +53,6 @@ GpuChildThread::GpuChildThread(GpuWatchdogThread* watchdog_thread, target_services_ = NULL; #endif g_thread_safe_sender.Get() = thread_safe_sender(); - - instance_ = this; } GpuChildThread::GpuChildThread(const std::string& channel_id) @@ -75,8 +71,6 @@ GpuChildThread::GpuChildThread(const std::string& channel_id) VLOG(1) << "gfx::GLSurface::InitializeOneOff()"; } g_thread_safe_sender.Get() = thread_safe_sender(); - - instance_ = this; } GpuChildThread::~GpuChildThread() { diff --git a/chromium/content/gpu/gpu_child_thread.h b/chromium/content/gpu/gpu_child_thread.h index 82bb32a67aa..ff0c9258cd1 100644 --- a/chromium/content/gpu/gpu_child_thread.h +++ b/chromium/content/gpu/gpu_child_thread.h @@ -56,10 +56,6 @@ class GpuChildThread : public ChildThread { virtual bool Send(IPC::Message* msg) OVERRIDE; virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; - GpuChannelManager* ChannelManager() const { return gpu_channel_manager_.get(); } - - static GpuChildThread* instance() { return instance_; } - private: // Message handlers. void OnInitialize(); @@ -98,8 +94,6 @@ class GpuChildThread : public ChildThread { // Whether the GPU thread is running in the browser process. bool in_browser_process_; - static GpuChildThread* instance_; - DISALLOW_COPY_AND_ASSIGN(GpuChildThread); }; diff --git a/chromium/content/public/browser/content_browser_client.h b/chromium/content/public/browser/content_browser_client.h index 639998fa5d9..8633105ed1a 100644 --- a/chromium/content/public/browser/content_browser_client.h +++ b/chromium/content/public/browser/content_browser_client.h @@ -45,7 +45,6 @@ class FilePath; } namespace gfx { -class GLShareGroup; class ImageSkia; } @@ -583,10 +582,6 @@ class CONTENT_EXPORT ContentBrowserClient { // information. virtual VibrationProvider* OverrideVibrationProvider(); - // Allow an embedder to provide a share group reimplementation to connect renderer - // GL contexts with the root compositor. - virtual gfx::GLShareGroup* GetInProcessGpuShareGroup() { return 0; } - #if defined(OS_POSIX) && !defined(OS_MACOSX) // Populates |mappings| with all files that need to be mapped before launching // a child process. diff --git a/chromium/content/renderer/gpu/mailbox_output_surface.cc b/chromium/content/renderer/gpu/mailbox_output_surface.cc index b23575da9ac..09e1ec0f7ac 100644 --- a/chromium/content/renderer/gpu/mailbox_output_surface.cc +++ b/chromium/content/renderer/gpu/mailbox_output_surface.cc @@ -5,7 +5,6 @@ #include "content/renderer/gpu/mailbox_output_surface.h" #include "base/logging.h" -#include "cc/base/util.h" #include "cc/output/compositor_frame.h" #include "cc/output/compositor_frame_ack.h" #include "cc/output/gl_frame_data.h" diff --git a/chromium/content/renderer/media/media_stream_dispatcher.cc b/chromium/content/renderer/media/media_stream_dispatcher.cc index 96f92fbfa9c..6890ffc5d6f 100644 --- a/chromium/content/renderer/media/media_stream_dispatcher.cc +++ b/chromium/content/renderer/media/media_stream_dispatcher.cc @@ -30,6 +30,37 @@ bool RemoveStreamDeviceFromArray(const StreamDeviceInfo device_info, } // namespace +// A request is identified by pair (request_id, handler), or ipc_request. +// There could be multiple clients making requests and each has its own +// request_id sequence. +// The ipc_request is garanteed to be unique when it's created in +// MediaStreamDispatcher. +struct MediaStreamDispatcher::Request { + Request(const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler, + int request_id, + int ipc_request) + : handler(handler), + request_id(request_id), + ipc_request(ipc_request) { + } + bool IsThisRequest( + int request_id1, + const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler1) { + return (request_id1 == request_id && handler1.get() == handler.get()); + } + base::WeakPtr<MediaStreamDispatcherEventHandler> handler; + int request_id; + int ipc_request; +}; + +struct MediaStreamDispatcher::Stream { + Stream() {} + ~Stream() {} + base::WeakPtr<MediaStreamDispatcherEventHandler> handler; + StreamDeviceInfoArray audio_array; + StreamDeviceInfoArray video_array; +}; + MediaStreamDispatcher::MediaStreamDispatcher(RenderViewImpl* render_view) : RenderViewObserver(render_view), main_loop_(base::MessageLoopProxy::current()), diff --git a/chromium/content/renderer/media/media_stream_dispatcher.h b/chromium/content/renderer/media/media_stream_dispatcher.h index 4c08958488a..89d7c0daafa 100644 --- a/chromium/content/renderer/media/media_stream_dispatcher.h +++ b/chromium/content/renderer/media/media_stream_dispatcher.h @@ -99,38 +99,11 @@ class CONTENT_EXPORT MediaStreamDispatcher FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream); - // A request is identified by pair (request_id, handler), or ipc_request. - // There could be multiple clients making requests and each has its own - // request_id sequence. - // The ipc_request is garanteed to be unique when it's created in - // MediaStreamDispatcher. - struct Request { - Request(const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler, - int request_id, - int ipc_request) - : handler(handler), - request_id(request_id), - ipc_request(ipc_request) { - } - bool IsThisRequest( - int request_id1, - const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler1) { - return (request_id1 == request_id && handler1.get() == handler.get()); - } - base::WeakPtr<MediaStreamDispatcherEventHandler> handler; - int request_id; - int ipc_request; - }; + struct Request; // Private class for keeping track of opened devices and who have // opened it. - struct Stream { - Stream() {} - ~Stream() {} - base::WeakPtr<MediaStreamDispatcherEventHandler> handler; - StreamDeviceInfoArray audio_array; - StreamDeviceInfoArray video_array; - }; + struct Stream; // RenderViewObserver OVERRIDE. virtual bool Send(IPC::Message* message) OVERRIDE; diff --git a/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc b/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc index a6418fb5a8f..d7f847240b0 100644 --- a/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc +++ b/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc @@ -6,7 +6,7 @@ #if defined(TOOLKIT_GTK) #include <gtk/gtk.h> -#elif defined(USE_CAIRO) +#elif defined(USE_X11) #include <cairo/cairo.h> #endif diff --git a/chromium/content/renderer/pepper/message_channel.cc b/chromium/content/renderer/pepper/message_channel.cc index 7c5961cfbe2..51132a6dc42 100644 --- a/chromium/content/renderer/pepper/message_channel.cc +++ b/chromium/content/renderer/pepper/message_channel.cc @@ -292,6 +292,18 @@ NPClass message_channel_class = { } // namespace // MessageChannel -------------------------------------------------------------- +struct MessageChannel::VarConversionResult { + VarConversionResult(const ppapi::ScopedPPVar& r, bool s) + : result(r), + success(s), + conversion_completed(true) {} + VarConversionResult() + : success(false), + conversion_completed(false) {} + ppapi::ScopedPPVar result; + bool success; + bool conversion_completed; +}; MessageChannel::MessageChannelNPObject::MessageChannelNPObject() { } diff --git a/chromium/content/renderer/pepper/message_channel.h b/chromium/content/renderer/pepper/message_channel.h index 43aa0f95a62..e0020e688c1 100644 --- a/chromium/content/renderer/pepper/message_channel.h +++ b/chromium/content/renderer/pepper/message_channel.h @@ -11,12 +11,15 @@ #include "base/memory/weak_ptr.h" #include "ppapi/shared_impl/resource.h" -#include "ppapi/shared_impl/scoped_pp_var.h" #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" #include "third_party/npapi/bindings/npruntime.h" struct PP_Var; +namespace ppapi { +class ScopedPPVar; +} + namespace content { class PepperPluginInstanceImpl; @@ -87,18 +90,7 @@ class MessageChannel { private: // Struct for storing the result of a NPVariant being converted to a PP_Var. - struct VarConversionResult { - VarConversionResult(const ppapi::ScopedPPVar& r, bool s) - : result(r), - success(s), - conversion_completed(true) {} - VarConversionResult() - : success(false), - conversion_completed(false) {} - ppapi::ScopedPPVar result; - bool success; - bool conversion_completed; - }; + struct VarConversionResult; // This is called when an NPVariant is finished being converted. // |result_iteartor| is an iterator into |converted_var_queue_| where the diff --git a/chromium/content/renderer/pepper/pepper_platform_context_3d.cc b/chromium/content/renderer/pepper/pepper_platform_context_3d.cc index b9fd07b67d5..6c3408bd429 100644 --- a/chromium/content/renderer/pepper/pepper_platform_context_3d.cc +++ b/chromium/content/renderer/pepper/pepper_platform_context_3d.cc @@ -107,6 +107,7 @@ bool PlatformContext3D::Init(const int32* attrib_list, if (!command_buffer_->ProduceFrontBuffer(names[0])) return false; mailbox_ = names[0]; + sync_point_ = command_buffer_->InsertSyncPoint(); command_buffer_->SetChannelErrorCallback( base::Bind(&PlatformContext3D::OnContextLost, @@ -118,8 +119,15 @@ bool PlatformContext3D::Init(const int32* attrib_list, return true; } -void PlatformContext3D::GetBackingMailbox(gpu::Mailbox* mailbox) { +void PlatformContext3D::GetBackingMailbox(gpu::Mailbox* mailbox, + uint32* sync_point) { *mailbox = mailbox_; + *sync_point = sync_point_; +} + +void PlatformContext3D::InsertSyncPointForBackingMailbox() { + DCHECK(command_buffer_); + sync_point_ = command_buffer_->InsertSyncPoint(); } bool PlatformContext3D::IsOpaque() { diff --git a/chromium/content/renderer/pepper/pepper_platform_context_3d.h b/chromium/content/renderer/pepper/pepper_platform_context_3d.h index 2520bbd65da..dcd42caa611 100644 --- a/chromium/content/renderer/pepper/pepper_platform_context_3d.h +++ b/chromium/content/renderer/pepper/pepper_platform_context_3d.h @@ -31,7 +31,11 @@ class PlatformContext3D { bool Init(const int32* attrib_list, PlatformContext3D* share_context); // Retrieves the mailbox name for the front buffer backing the context. - void GetBackingMailbox(gpu::Mailbox* mailbox); + void GetBackingMailbox(gpu::Mailbox* mailbox, uint32* sync_point); + + // Inserts a new sync point to associate with the backing mailbox, that should + // be waited on before using the mailbox. + void InsertSyncPointForBackingMailbox(); // Returns true if the backing texture is always opaque. bool IsOpaque(); @@ -68,6 +72,7 @@ class PlatformContext3D { scoped_refptr<GpuChannelHost> channel_; gpu::Mailbox mailbox_; + uint32 sync_point_; bool has_alpha_; CommandBufferProxyImpl* command_buffer_; base::Closure context_lost_callback_; diff --git a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc index c6d6582132c..405d6ceb4c4 100644 --- a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -700,9 +700,21 @@ void PepperPluginInstanceImpl::ScrollRect(int dx, } } +static void IgnoreCallback(unsigned, bool) {} + void PepperPluginInstanceImpl::CommitBackingTexture() { - if (texture_layer_.get()) - texture_layer_->SetNeedsDisplay(); + if (!texture_layer_.get()) + return; + PlatformContext3D* context = bound_graphics_3d_->platform_context(); + gpu::Mailbox mailbox; + uint32 sync_point = 0; + context->GetBackingMailbox(&mailbox, &sync_point); + DCHECK(!mailbox.IsZero()); + DCHECK_NE(sync_point, 0u); + texture_layer_->SetTextureMailbox( + cc::TextureMailbox(mailbox, sync_point), + cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); + texture_layer_->SetNeedsDisplay(); } void PepperPluginInstanceImpl::InstanceCrashed() { @@ -1857,16 +1869,16 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output, #endif } -static void IgnoreCallback(unsigned, bool) {} - void PepperPluginInstanceImpl::UpdateLayer() { if (!container_) return; gpu::Mailbox mailbox; + uint32 sync_point = 0; if (bound_graphics_3d_.get()) { PlatformContext3D* context = bound_graphics_3d_->platform_context(); - context->GetBackingMailbox(&mailbox); + context->GetBackingMailbox(&mailbox, &sync_point); + DCHECK_EQ(mailbox.IsZero(), sync_point == 0); } bool want_3d_layer = !mailbox.IsZero(); bool want_2d_layer = bound_graphics_2d_platform_ && @@ -1895,7 +1907,7 @@ void PepperPluginInstanceImpl::UpdateLayer() { texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); opaque = bound_graphics_3d_->IsOpaque(); texture_layer_->SetTextureMailbox( - cc::TextureMailbox(mailbox, 0), + cc::TextureMailbox(mailbox, sync_point), cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); } else { DCHECK(bound_graphics_2d_platform_); diff --git a/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc b/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc index 1564279f7b4..989b9994395 100644 --- a/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc @@ -197,6 +197,10 @@ int32 PPB_Graphics3D_Impl::DoSwapBuffers() { if (gles2_impl()) gles2_impl()->SwapBuffers(); + // Since the backing texture has been updated, a new sync point should be + // inserted. + platform_context_->InsertSyncPointForBackingMailbox(); + if (bound_to_instance_) { // If we are bound to the instance, we need to ask the compositor // to commit our backing texture so that the graphics appears on the page. diff --git a/chromium/content/renderer/render_thread_impl.cc b/chromium/content/renderer/render_thread_impl.cc index 609b965f468..e910b8bf80d 100644 --- a/chromium/content/renderer/render_thread_impl.cc +++ b/chromium/content/renderer/render_thread_impl.cc @@ -314,7 +314,7 @@ void RenderThreadImpl::Init() { v8::V8::SetCreateHistogramFunction(CreateHistogram); v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); -#if (defined(OS_MACOSX) || defined(OS_ANDROID)) && !defined(TOOLKIT_QT) +#if defined(OS_MACOSX) || defined(OS_ANDROID) // On Mac and Android, the select popups are rendered by the browser. blink::WebView::setUseExternalPopupMenus(true); #endif diff --git a/chromium/content/renderer/renderer_main.cc b/chromium/content/renderer/renderer_main.cc index 5330d21a564..63c72ae934b 100644 --- a/chromium/content/renderer/renderer_main.cc +++ b/chromium/content/renderer/renderer_main.cc @@ -161,8 +161,6 @@ int RendererMain(const MainFunctionParams& parameters) { // As long as we use Cocoa in the renderer (for the forseeable future as of // now; see http://crbug.com/306348 for info) we need to have a UI loop. base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); -#elif defined(OS_WIN) && defined(TOOLKIT_QT) - base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); #else // The main message loop of the renderer services doesn't have IO or UI tasks, // unless in-process-plugins is used. @@ -225,6 +223,7 @@ int RendererMain(const MainFunctionParams& parameters) { if (!no_sandbox) { run_loop = platform.EnableSandbox(); } else { + LOG(ERROR) << "Running without renderer sandbox"; #ifndef NDEBUG // For convenience, we print the stack trace for crashes. We can't get // symbols when the sandbox is enabled, so only try when the sandbox is diff --git a/chromium/content/renderer/renderer_webcolorchooser_impl.h b/chromium/content/renderer/renderer_webcolorchooser_impl.h index d7534788738..0fa608f4359 100644 --- a/chromium/content/renderer/renderer_webcolorchooser_impl.h +++ b/chromium/content/renderer/renderer_webcolorchooser_impl.h @@ -36,6 +36,11 @@ class RendererWebColorChooserImpl : public blink::WebColorChooser, blink::WebColorChooserClient* client() { return client_; } + // Don't destroy the RendererWebColorChooserImpl when the RenderViewImpl goes + // away. RendererWebColorChooserImpl is owned by + // blink::ColorChooserUIController. + virtual void OnDestruct() OVERRIDE {} + private: // RenderViewObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; diff --git a/chromium/content/zygote/zygote_main_linux.cc b/chromium/content/zygote/zygote_main_linux.cc index 2e5cc7e98d5..8e91c2f17e5 100644 --- a/chromium/content/zygote/zygote_main_linux.cc +++ b/chromium/content/zygote/zygote_main_linux.cc @@ -181,6 +181,8 @@ static void InitLibcLocaltimeFunctions() { // references to localtime() will resolve to this function. Notice that we need // to set visibility attribute to "default" to export the symbol, as it is set // to "hidden" by default in chrome per build/common.gypi. +__attribute__ ((__visibility__("default"))) +struct tm* localtime_override(const time_t* timep) __asm__ ("localtime"); __attribute__ ((__visibility__("default"))) struct tm* localtime_override(const time_t* timep) { @@ -197,6 +199,10 @@ struct tm* localtime_override(const time_t* timep) { } } +// Use same trick to override localtime64(), localtime_r() and localtime64_r(). +__attribute__ ((__visibility__("default"))) +struct tm* localtime64_override(const time_t* timep) __asm__ ("localtime64"); + __attribute__ ((__visibility__("default"))) struct tm* localtime64_override(const time_t* timep) { if (g_am_zygote_or_renderer) { @@ -213,6 +219,10 @@ struct tm* localtime64_override(const time_t* timep) { } __attribute__ ((__visibility__("default"))) +struct tm* localtime_r_override(const time_t* timep, + struct tm* result) __asm__ ("localtime_r"); + +__attribute__ ((__visibility__("default"))) struct tm* localtime_r_override(const time_t* timep, struct tm* result) { if (g_am_zygote_or_renderer) { ProxyLocaltimeCallToBrowser(*timep, result, NULL, 0); @@ -225,6 +235,10 @@ struct tm* localtime_r_override(const time_t* timep, struct tm* result) { } __attribute__ ((__visibility__("default"))) +struct tm* localtime64_r_override(const time_t* timep, + struct tm* result) __asm__ ("localtime64_r"); + +__attribute__ ((__visibility__("default"))) struct tm* localtime64_r_override(const time_t* timep, struct tm* result) { if (g_am_zygote_or_renderer) { ProxyLocaltimeCallToBrowser(*timep, result, NULL, 0); |