diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-02 10:15:40 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-06-02 08:41:08 +0000 |
commit | b92421879c003a0857b2074f7e05b3bbbb326569 (patch) | |
tree | bdfd21ad74690ae4069e4a055191844994027b78 /chromium/content/child | |
parent | 980b784afe75be22158126ac6a639c19459d3427 (diff) | |
download | qtwebengine-chromium-b92421879c003a0857b2074f7e05b3bbbb326569.tar.gz |
BASELINE: Update Chromium to 51.0.2704.79
Also adds a few files for url_parsing in extensions.
Change-Id: Ie4820c3da75f0a56b3cc86dccc077d671227077b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'chromium/content/child')
-rw-r--r-- | chromium/content/child/child_shared_bitmap_manager.cc | 19 | ||||
-rw-r--r-- | chromium/content/child/child_thread_impl.cc | 11 | ||||
-rw-r--r-- | chromium/content/child/child_thread_impl.h | 5 | ||||
-rw-r--r-- | chromium/content/child/webblobregistry_impl.cc | 4 |
4 files changed, 28 insertions, 11 deletions
diff --git a/chromium/content/child/child_shared_bitmap_manager.cc b/chromium/content/child/child_shared_bitmap_manager.cc index daa46279bb7..3374f4a98ba 100644 --- a/chromium/content/child/child_shared_bitmap_manager.cc +++ b/chromium/content/child/child_shared_bitmap_manager.cc @@ -108,15 +108,24 @@ ChildSharedBitmapManager::AllocateSharedMemoryBitmap(const gfx::Size& size) { std::unique_ptr<base::SharedMemory> memory; #if defined(OS_POSIX) base::SharedMemoryHandle handle; - sender_->Send(new ChildProcessHostMsg_SyncAllocateSharedBitmap( - memory_size, id, &handle)); + bool send_success = + sender_->Send(new ChildProcessHostMsg_SyncAllocateSharedBitmap( + memory_size, id, &handle)); + if (!send_success) + return nullptr; memory = base::WrapUnique(new base::SharedMemory(handle, false)); if (!memory->Map(memory_size)) CollectMemoryUsageAndDie(size, memory_size); #else - memory = ChildThreadImpl::AllocateSharedMemory(memory_size, sender_.get()); - if (!memory) - CollectMemoryUsageAndDie(size, memory_size); + bool out_of_memory; + memory = ChildThreadImpl::AllocateSharedMemory(memory_size, sender_.get(), + &out_of_memory); + if (!memory) { + if (out_of_memory) + CollectMemoryUsageAndDie(size, memory_size); + else + return nullptr; + } if (!memory->Map(memory_size)) CollectMemoryUsageAndDie(size, memory_size); diff --git a/chromium/content/child/child_thread_impl.cc b/chromium/content/child/child_thread_impl.cc index 733d538df65..2421375ddd2 100644 --- a/chromium/content/child/child_thread_impl.cc +++ b/chromium/content/child/child_thread_impl.cc @@ -575,13 +575,14 @@ IPC::MessageRouter* ChildThreadImpl::GetRouter() { std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory( size_t buf_size) { DCHECK(base::MessageLoop::current() == message_loop()); - return AllocateSharedMemory(buf_size, this); + return AllocateSharedMemory(buf_size, this, nullptr); } // static std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory( size_t buf_size, - IPC::Sender* sender) { + IPC::Sender* sender, + bool* out_of_memory) { std::unique_ptr<base::SharedMemory> shared_buf; // Ask the browser to create the shared memory, since this is blocked by the // sandbox on most platforms. @@ -591,11 +592,15 @@ std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory( if (base::SharedMemory::IsHandleValid(shared_mem_handle)) { shared_buf.reset(new base::SharedMemory(shared_mem_handle, false)); } else { - NOTREACHED() << "Browser failed to allocate shared memory"; + LOG(WARNING) << "Browser failed to allocate shared memory"; + if (out_of_memory) + *out_of_memory = true; return nullptr; } } else { // Send is allowed to fail during shutdown. Return null in this case. + if (out_of_memory) + *out_of_memory = false; return nullptr; } return shared_buf; diff --git a/chromium/content/child/child_thread_impl.h b/chromium/content/child/child_thread_impl.h index fec7da76906..18edb0359a1 100644 --- a/chromium/content/child/child_thread_impl.h +++ b/chromium/content/child/child_thread_impl.h @@ -103,9 +103,12 @@ class CONTENT_EXPORT ChildThreadImpl // A static variant that can be called on background threads provided // the |sender| passed in is safe to use on background threads. + // |out_of_memory| is an output variable populated on failure which tells the + // caller whether the failure was caused by an out of memory error. static std::unique_ptr<base::SharedMemory> AllocateSharedMemory( size_t buf_size, - IPC::Sender* sender); + IPC::Sender* sender, + bool* out_of_memory); ChildSharedBitmapManager* shared_bitmap_manager() const { return shared_bitmap_manager_.get(); diff --git a/chromium/content/child/webblobregistry_impl.cc b/chromium/content/child/webblobregistry_impl.cc index afc7ae28a73..6ad76f2c93e 100644 --- a/chromium/content/child/webblobregistry_impl.cc +++ b/chromium/content/child/webblobregistry_impl.cc @@ -148,8 +148,8 @@ void WebBlobRegistryImpl::addDataToStream(const WebURL& url, size_t shared_memory_size = std::min(length, storage::kBlobStorageMaxSharedMemoryBytes); std::unique_ptr<base::SharedMemory> shared_memory( - ChildThreadImpl::AllocateSharedMemory(shared_memory_size, - sender_.get())); + ChildThreadImpl::AllocateSharedMemory(shared_memory_size, sender_.get(), + nullptr)); CHECK(shared_memory.get()); if (!shared_memory->Map(shared_memory_size)) CHECK(false); |