summaryrefslogtreecommitdiffstats
path: root/patches/chromium
diff options
context:
space:
mode:
Diffstat (limited to 'patches/chromium')
-rw-r--r--patches/chromium/0001-Add-WebEngineContext-to-RunLoop-s-friends.patch30
-rw-r--r--patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch159
-rw-r--r--patches/chromium/0003-Clang-libc-does-not-support-incomplete-types-in-temp.patch653
-rw-r--r--patches/chromium/0004-Do-not-modify-the-child-path.patch26
-rw-r--r--patches/chromium/0005-Do-not-warn-for-header-hygiene.patch26
-rw-r--r--patches/chromium/0006-Build-files-necessary-for-touch-and-gestures.patch47
-rw-r--r--patches/chromium/0007-remove-Wno-deprecated-register-from-common.gypi.patch35
-rw-r--r--patches/chromium/0008-Solve-conflicts-when-including-both-QtOpenGL-headers.patch74
-rw-r--r--patches/chromium/0009-Do-not-forward-declare-UIResourceRequest-Identity-an.patch133
-rw-r--r--patches/chromium/0010-Fix-the-build-with-a-GL-ES2-configured-Qt.patch161
-rw-r--r--patches/chromium/0011-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch31
-rw-r--r--patches/chromium/0012-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch81
-rw-r--r--patches/chromium/0013-Add-seams-to-setup-GL-contexts-sharing-with-QtQuick.patch106
-rw-r--r--patches/chromium/0014-Declare-a-Qt-IPC-message-class.patch25
-rw-r--r--patches/chromium/third_party/WebKit/0001-Remove-leftovers-from-WebKitSystemInterface.patch28
-rw-r--r--patches/chromium/third_party/libjingle/source/talk/0001-Do-not-forward-declare-WebRtcVoiceChannelInfo.patch63
-rw-r--r--patches/chromium/tools/grit/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch43
-rw-r--r--patches/chromium/tools/gyp/0001-Fix-build-with-toplevel-dir.patch29
-rw-r--r--patches/chromium/tools/gyp/0002-Add-support-for-libc-to-xcode_emulation.py.patch23
19 files changed, 1773 insertions, 0 deletions
diff --git a/patches/chromium/0001-Add-WebEngineContext-to-RunLoop-s-friends.patch b/patches/chromium/0001-Add-WebEngineContext-to-RunLoop-s-friends.patch
new file mode 100644
index 000000000..31e97a832
--- /dev/null
+++ b/patches/chromium/0001-Add-WebEngineContext-to-RunLoop-s-friends.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Tue, 11 Jun 2013 15:44:26 +0200
+Subject: Add WebEngineContext to RunLoop's friends.
+
+---
+ base/run_loop.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/base/run_loop.h b/base/run_loop.h
+index f5ee5c3..b167907 100644
+--- a/base/run_loop.h
++++ b/base/run_loop.h
+@@ -10,6 +10,8 @@
+ #include "base/memory/weak_ptr.h"
+ #include "base/message_loop/message_loop.h"
+
++class WebEngineContext;
++
+ namespace base {
+ #if defined(OS_ANDROID)
+ class MessagePumpForUI;
+@@ -76,6 +78,7 @@ class BASE_EXPORT RunLoop {
+
+ private:
+ friend class MessageLoop;
++ friend class ::WebEngineContext;
+ #if defined(OS_ANDROID)
+ // Android doesn't support the blocking MessageLoop::Run, so it calls
+ // BeforeRun and AfterRun directly.
diff --git a/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch b/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch
new file mode 100644
index 000000000..279e10a95
--- /dev/null
+++ b/patches/chromium/0002-Mac-Use-libc-instead-of-stdlibc.patch
@@ -0,0 +1,159 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 27 Jun 2013 15:51:43 +0200
+Subject: Mac: Use libc++ instead of stdlibc++.
+
+- Add a missing include file to process_iterator_mac.cc.
+- Disable Chromium clang plugins.
+- Add a use_libcpp variable to common.gypi that can be used
+ to build with libc++ instead of libstdc++.
+ In this case several warnings also must be disabled,
+ And the mac deployment target must be bumped to 10.7.
+- ext/hash_map and ext/hash_set are deprecated.
+ Use unordered containers as a replacement.
+---
+ base/process/process_iterator_mac.cc | 1 +
+ build/common.gypi | 30 +++++++++++++++++++++++++++---
+ third_party/protobuf/config.h | 27 ++++++++++++++-------------
+ 3 files changed, 42 insertions(+), 16 deletions(-)
+
+diff --git a/base/process/process_iterator_mac.cc b/base/process/process_iterator_mac.cc
+index 29daa2d..e35c2ae 100644
+--- a/base/process/process_iterator_mac.cc
++++ b/base/process/process_iterator_mac.cc
+@@ -7,6 +7,7 @@
+ #include <errno.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
++#include <unistd.h>
+
+ #include "base/logging.h"
+ #include "base/strings/string_util.h"
+diff --git a/build/common.gypi b/build/common.gypi
+index e13aba4..9961053 100644
+--- a/build/common.gypi
++++ b/build/common.gypi
+@@ -287,7 +287,7 @@
+ # Run tools/clang/scripts/update.sh to make sure they are compiled.
+ # This causes 'clang_chrome_plugins_flags' to be set.
+ # Has no effect if 'clang' is not set as well.
+- 'clang_use_chrome_plugins%': 1,
++ 'clang_use_chrome_plugins%': 0,
+
+ # Enable building with ASAN (Clang's -fsanitize=address option).
+ # -fsanitize=address only works with clang, but asan=1 implies clang=1
+@@ -1144,6 +1144,9 @@
+ # rlz codes for searches but do not use the library.
+ 'enable_rlz%': 0,
+
++ # Compile with libc++ instead of libstdc++.
++ 'use_libcpp%' : 0,
++
+ # Turns on the i18n support in V8.
+ 'v8_enable_i18n_support': 1,
+
+@@ -1414,10 +1417,10 @@
+ # someplace that Xcode doesn't know about, set mac_sdk_path to the
+ # path to the SDK; when set to a non-empty string, SDK detection
+ # based on mac_sdk_min will be bypassed entirely.
+- 'mac_sdk_min%': '10.6',
++ 'mac_sdk_min%': '10.7',
+ 'mac_sdk_path%': '',
+
+- 'mac_deployment_target%': '10.6',
++ 'mac_deployment_target%': '10.7',
+ },
+
+ 'mac_sdk_min': '<(mac_sdk_min)',
+@@ -1427,6 +1430,7 @@
+ # Compile in Breakpad support by default so that it can be
+ # tested, even if it is not enabled by default at runtime.
+ 'mac_breakpad_compiled_in%': 1,
++
+ 'conditions': [
+ # mac_product_name is set to the name of the .app bundle as it should
+ # appear on disk. This duplicates data from
+@@ -1997,6 +2001,16 @@
+ ['use_x11==1', {
+ 'defines': ['USE_X11=1'],
+ }],
++ ['use_libcpp==1', {
++ 'defines': ['USE_UNORDERED_CONTAINERS=1'],
++ 'cflags_cc': [
++ '-Wno-deprecated-declarations',
++ '-Wno-newline-eof',
++ '-Wno-unused-value',
++ '-Wno-unused-variable',
++ '-stdlib=libc++'
++ ],
++ }],
+ ['enable_one_click_signin==1', {
+ 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
+ }],
+@@ -3914,6 +3928,16 @@
+ '-Wno-deprecated-register',
+ ],
+ }],
++ ['use_libcpp==1', {
++ 'OTHER_CPLUSPLUSFLAGS': ['-stdlib=libc++'],
++ 'USE_LIBCPP': 'YES',
++ 'WARNING_CFLAGS': [
++ '-Wno-deprecated-declarations',
++ '-Wno-newline-eof',
++ '-Wno-unused-value',
++ '-Wno-unused-variable',
++ ],
++ }],
+ ['clang==1 and clang_use_chrome_plugins==1', {
+ 'OTHER_CFLAGS': [
+ '<@(clang_chrome_plugins_flags)',
+diff --git a/third_party/protobuf/config.h b/third_party/protobuf/config.h
+index dcc0041..affcf55 100644
+--- a/third_party/protobuf/config.h
++++ b/third_party/protobuf/config.h
+@@ -1,31 +1,32 @@
+ /* config.h. Generated from config.h.in by configure. */
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
+-/* the name of <hash_set> */
+-#define HASH_MAP_CLASS hash_map
++#if defined(USE_UNORDERED_CONTAINERS)
++
++#define HASH_MAP_H <unordered_map>
++#define HASH_SET_H <unordered_set>
++#define HASH_NAMESPACE std
++#define HASH_MAP_CLASS unordered_map
++#define HASH_SET_CLASS unordered_set
+
+-/* the location of <hash_map> */
+-#if defined(USE_STLPORT)
+-#define HASH_MAP_H <hash_map>
+ #else
+-#define HASH_MAP_H <ext/hash_map>
+-#endif
+
+-/* the namespace of hash_map/hash_set */
+ #if defined(USE_STLPORT)
++#define HASH_MAP_H <hash_map>
++#define HASH_SET_H <hash_set>
+ #define HASH_NAMESPACE std
+ #else
++#define HASH_MAP_H <ext/hash_map>
++#define HASH_SET_H <ext/hash_set>
+ #define HASH_NAMESPACE __gnu_cxx
+ #endif
+
+ /* the name of <hash_set> */
++#define HASH_MAP_CLASS hash_map
++
++/* the name of <hash_set> */
+ #define HASH_SET_CLASS hash_set
+
+-/* the location of <hash_set> */
+-#if defined(USE_STLPORT)
+-#define HASH_SET_H <hash_set>
+-#else
+-#define HASH_SET_H <ext/hash_set>
+ #endif
+
+ /* Define to 1 if you have the <dlfcn.h> header file. */
diff --git a/patches/chromium/0003-Clang-libc-does-not-support-incomplete-types-in-temp.patch b/patches/chromium/0003-Clang-libc-does-not-support-incomplete-types-in-temp.patch
new file mode 100644
index 000000000..ce3d9bb30
--- /dev/null
+++ b/patches/chromium/0003-Clang-libc-does-not-support-incomplete-types-in-temp.patch
@@ -0,0 +1,653 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 27 Jun 2013 15:58:32 +0200
+Subject: Clang / libc++ does not support incomplete types in templates. See:
+ http://clang.llvm.org/compatibility.html#undep_incomplete
+
+Therefore forward declarations must be removed in several places:
+- AudioBus::QueuedAudioBuffer
+- base::Callback
+- GURL
+- HttpAuthCache::Entry
+- ImageFamily::MapKey
+- MediaStreamDispatcher::Request
+- MediaStreamDispatcher::Stream
+- MediaStreamDispatcherHost::StreamRequest
+- MessagePortService::MessagePort
+- MockCertVerifier::Rule
+- PepperRendererInstanceData
+- RuleBasedHostResolverProc::Rule
+- WebURLError
+- WebURLLoaderMockFactory::ResponseInfo
+- WorkerDevToolsManager::InspectedWorker
+- WorkerDevToolsManager::TerminatedInspectedWorker
+---
+ base/callback_forward.h | 9 +-----
+ .../browser/devtools/worker_devtools_manager.cc | 24 ----------------
+ content/browser/devtools/worker_devtools_manager.h | 26 ++++++++++++++++--
+ .../media/media_stream_dispatcher_host.cc | 11 --------
+ .../media/media_stream_dispatcher_host.h | 12 +++++++-
+ .../browser/worker_host/message_port_service.cc | 22 ---------------
+ content/browser/worker_host/message_port_service.h | 23 +++++++++++++++-
+ content/common/gpu/gpu_messages.h | 4 ++-
+ content/renderer/media/media_stream_dispatcher.cc | 31 ---------------------
+ content/renderer/media/media_stream_dispatcher.h | 31 +++++++++++++++++++--
+ content/renderer/pepper/message_channel.cc | 12 --------
+ content/renderer/pepper/message_channel.h | 18 ++++++++----
+ gpu/config/dx_diag_node.cc | 4 +++
+ gpu/config/dx_diag_node.h | 4 +++
+ media/filters/ffmpeg_audio_decoder.cc | 6 ----
+ media/filters/ffmpeg_audio_decoder.h | 8 +++++-
+ net/cert/mock_cert_verifier.cc | 19 -------------
+ net/cert/mock_cert_verifier.h | 20 +++++++++++++-
+ net/dns/mock_host_resolver.cc | 31 ---------------------
+ net/dns/mock_host_resolver.h | 32 +++++++++++++++++++++-
+ 20 files changed, 168 insertions(+), 179 deletions(-)
+
+diff --git a/base/callback_forward.h b/base/callback_forward.h
+index 7983248..8538bb2 100644
+--- a/base/callback_forward.h
++++ b/base/callback_forward.h
+@@ -5,13 +5,6 @@
+ #ifndef BASE_CALLBACK_FORWARD_H_
+ #define BASE_CALLBACK_FORWARD_H_
+
+-namespace base {
+-
+-template <typename Sig>
+-class Callback;
+-
+-typedef Callback<void(void)> Closure;
+-
+-} // namespace base
++#include "base/callback.h"
+
+ #endif // BASE_CALLBACK_FORWARD_H
+diff --git a/content/browser/devtools/worker_devtools_manager.cc b/content/browser/devtools/worker_devtools_manager.cc
+index f08523b..983c55c 100644
+--- a/content/browser/devtools/worker_devtools_manager.cc
++++ b/content/browser/devtools/worker_devtools_manager.cc
+@@ -51,17 +51,6 @@ base::LazyInstance<AgentHosts>::Leaky g_orphan_map = LAZY_INSTANCE_INITIALIZER;
+
+ } // namespace
+
+-struct WorkerDevToolsManager::TerminatedInspectedWorker {
+- TerminatedInspectedWorker(WorkerId id, const GURL& url, const string16& name)
+- : old_worker_id(id),
+- worker_url(url),
+- worker_name(name) {}
+- WorkerId old_worker_id;
+- GURL worker_url;
+- string16 worker_name;
+-};
+-
+-
+ class WorkerDevToolsManager::WorkerDevToolsAgentHost
+ : public IPCDevToolsAgentHost {
+ public:
+@@ -200,19 +189,6 @@ class WorkerDevToolsManager::DetachedClientHosts {
+ }
+ };
+
+-struct WorkerDevToolsManager::InspectedWorker {
+- InspectedWorker(WorkerProcessHost* host, int route_id, const GURL& url,
+- const string16& name)
+- : host(host),
+- route_id(route_id),
+- worker_url(url),
+- worker_name(name) {}
+- WorkerProcessHost* const host;
+- int const route_id;
+- GURL worker_url;
+- string16 worker_name;
+-};
+-
+ // static
+ WorkerDevToolsManager* WorkerDevToolsManager::GetInstance() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+diff --git a/content/browser/devtools/worker_devtools_manager.h b/content/browser/devtools/worker_devtools_manager.h
+index 8a9a708..e6d090c 100644
+--- a/content/browser/devtools/worker_devtools_manager.h
++++ b/content/browser/devtools/worker_devtools_manager.h
+@@ -54,7 +54,20 @@ class WorkerDevToolsManager {
+ private:
+ friend struct DefaultSingletonTraits<WorkerDevToolsManager>;
+ class DetachedClientHosts;
+- struct InspectedWorker;
++
++ struct InspectedWorker {
++ InspectedWorker(WorkerProcessHost* host, int route_id, const GURL& url,
++ const string16& name)
++ : host(host),
++ route_id(route_id),
++ worker_url(url),
++ worker_name(name) {}
++ WorkerProcessHost* const host;
++ int const route_id;
++ GURL worker_url;
++ string16 worker_name;
++ };
++
+ typedef std::list<InspectedWorker> InspectedWorkersList;
+
+ WorkerDevToolsManager();
+@@ -84,7 +97,16 @@ class WorkerDevToolsManager {
+
+ InspectedWorkersList inspected_workers_;
+
+- struct TerminatedInspectedWorker;
++ struct TerminatedInspectedWorker {
++ TerminatedInspectedWorker(WorkerId id, const GURL& url, const string16& name)
++ : old_worker_id(id),
++ worker_url(url),
++ worker_name(name) {}
++ WorkerId old_worker_id;
++ GURL worker_url;
++ string16 worker_name;
++ };
++
+ 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/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+index ebc4d89..9135b71 100644
+--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
++++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+@@ -12,17 +12,6 @@
+
+ namespace content {
+
+-struct MediaStreamDispatcherHost::StreamRequest {
+- StreamRequest() : render_view_id(0), page_request_id(0) {}
+- StreamRequest(int render_view_id, int page_request_id)
+- : render_view_id(render_view_id),
+- page_request_id(page_request_id ) {
+- }
+- int render_view_id;
+- // Id of the request generated by MediaStreamDispatcher.
+- int page_request_id;
+-};
+-
+ MediaStreamDispatcherHost::MediaStreamDispatcherHost(
+ int render_process_id,
+ MediaStreamManager* media_stream_manager)
+diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.h b/content/browser/renderer_host/media/media_stream_dispatcher_host.h
+index ec1dd15..cfc6913 100644
+--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.h
++++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.h
+@@ -72,7 +72,17 @@ class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter,
+ int render_process_id_;
+ MediaStreamManager* media_stream_manager_;
+
+- struct StreamRequest;
++ struct StreamRequest {
++ StreamRequest() : render_view_id(0), page_request_id(0) {}
++ StreamRequest(int render_view_id, int page_request_id)
++ : render_view_id(render_view_id),
++ page_request_id(page_request_id ) {
++ }
++ int render_view_id;
++ // Id of the request generated by MediaStreamDispatcher.
++ int page_request_id;
++ };
++
+ typedef std::map<std::string, StreamRequest> StreamMap;
+ // Streams generated for this host.
+ StreamMap streams_;
+diff --git a/content/browser/worker_host/message_port_service.cc b/content/browser/worker_host/message_port_service.cc
+index 3bc8f5a..b413c1f 100644
+--- a/content/browser/worker_host/message_port_service.cc
++++ b/content/browser/worker_host/message_port_service.cc
+@@ -9,28 +9,6 @@
+
+ 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.
+- WorkerMessageFilter* 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
+- // WorkerProcessHostMsg_QueueMessages.
+- bool queue_messages;
+- QueuedMessages queued_messages;
+-};
+-
+ MessagePortService* MessagePortService::GetInstance() {
+ return Singleton<MessagePortService>::get();
+ }
+diff --git a/content/browser/worker_host/message_port_service.h b/content/browser/worker_host/message_port_service.h
+index b85e76b..30645c7 100644
+--- a/content/browser/worker_host/message_port_service.h
++++ b/content/browser/worker_host/message_port_service.h
+@@ -61,7 +61,28 @@ class MessagePortService {
+ // verify that the message port id exists.
+ void Erase(int message_port_id);
+
+- struct MessagePort;
++ 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.
++ WorkerMessageFilter* 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
++ // WorkerProcessHostMsg_QueueMessages.
++ bool queue_messages;
++ QueuedMessages queued_messages;
++ };
++
+ typedef std::map<int, MessagePort> MessagePorts;
+ MessagePorts message_ports_;
+
+diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
+index b4e5be5..3952d79 100644
+--- a/content/common/gpu/gpu_messages.h
++++ b/content/common/gpu/gpu_messages.h
+@@ -116,10 +116,12 @@ IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
+ IPC_STRUCT_END()
+ #endif
+
+- IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode)
++#if defined(OS_WIN)
++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/content/renderer/media/media_stream_dispatcher.cc b/content/renderer/media/media_stream_dispatcher.cc
+index cc241fa..57d65b6 100644
+--- a/content/renderer/media/media_stream_dispatcher.cc
++++ b/content/renderer/media/media_stream_dispatcher.cc
+@@ -14,37 +14,6 @@
+
+ namespace content {
+
+-// 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::EnumerationRequest::EnumerationRequest(
+ const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler,
+ int request_id)
+diff --git a/content/renderer/media/media_stream_dispatcher.h b/content/renderer/media/media_stream_dispatcher.h
+index aa8f345..af25963 100644
+--- a/content/renderer/media/media_stream_dispatcher.h
++++ b/content/renderer/media/media_stream_dispatcher.h
+@@ -98,11 +98,38 @@ class CONTENT_EXPORT MediaStreamDispatcher
+ FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure);
+ FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream);
+
+- struct Request;
++ // 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;
++ };
+
+ // Private class for keeping track of opened devices and who have
+ // opened it.
+- struct Stream;
++ struct Stream {
++ Stream() {}
++ ~Stream() {}
++ base::WeakPtr<MediaStreamDispatcherEventHandler> handler;
++ StreamDeviceInfoArray audio_array;
++ StreamDeviceInfoArray video_array;
++ };
+
+ // An enumeration request is identified by pair (request_id, handler).
+ // It allows multiple clients to make requests and each client could have
+diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc
+index f06b787..c41be2f 100644
+--- a/content/renderer/pepper/message_channel.cc
++++ b/content/renderer/pepper/message_channel.cc
+@@ -279,18 +279,6 @@ 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/content/renderer/pepper/message_channel.h b/content/renderer/pepper/message_channel.h
+index 9c8c28d..e4e1423 100644
+--- a/content/renderer/pepper/message_channel.h
++++ b/content/renderer/pepper/message_channel.h
+@@ -10,15 +10,12 @@
+
+ #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;
+@@ -86,7 +83,18 @@ class MessageChannel {
+
+ private:
+ // Struct for storing the result of a NPVariant being converted to a PP_Var.
+- struct VarConversionResult;
++ 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;
++ };
+
+ // This is called when an NPVariant is finished being converted.
+ // |result_iteartor| is an iterator into |converted_var_queue_| where the
+diff --git a/gpu/config/dx_diag_node.cc b/gpu/config/dx_diag_node.cc
+index e0902ca..c1e84ae 100644
+--- a/gpu/config/dx_diag_node.cc
++++ b/gpu/config/dx_diag_node.cc
+@@ -4,6 +4,8 @@
+
+ #include "gpu/config/dx_diag_node.h"
+
++#if defined(OS_WIN)
++
+ namespace gpu {
+
+ DxDiagNode::DxDiagNode() {}
+@@ -11,3 +13,5 @@ DxDiagNode::DxDiagNode() {}
+ DxDiagNode::~DxDiagNode() {}
+
+ } // namespace gpu
++
++#endif // defined(OS_WIN)
+diff --git a/gpu/config/dx_diag_node.h b/gpu/config/dx_diag_node.h
+index 33d29b3..45ffa65 100644
+--- a/gpu/config/dx_diag_node.h
++++ b/gpu/config/dx_diag_node.h
+@@ -8,6 +8,8 @@
+ #ifndef GPU_CONFIG_DX_DIAG_NODE_H_
+ #define GPU_CONFIG_DX_DIAG_NODE_H_
+
++#if defined(OS_WIN)
++
+ #include <map>
+ #include <string>
+
+@@ -24,4 +26,6 @@ struct GPU_EXPORT DxDiagNode {
+
+ } // namespace gpu
+
++#endif // defined(OS_WIN)
++
+ #endif // GPU_CONFIG_DX_DIAG_NODE_H_
+diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
+index f922e98..f41c893 100644
+--- a/media/filters/ffmpeg_audio_decoder.cc
++++ b/media/filters/ffmpeg_audio_decoder.cc
+@@ -22,12 +22,6 @@
+
+ namespace media {
+
+-// Helper structure for managing multiple decoded audio frames per packet.
+-struct QueuedAudioBuffer {
+- AudioDecoder::Status status;
+- scoped_refptr<AudioBuffer> buffer;
+-};
+-
+ // Returns true if the decode result was end of stream.
+ static inline bool IsEndOfStream(int result,
+ int decoded_size,
+diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h
+index 7ea8615..44c9830 100644
+--- a/media/filters/ffmpeg_audio_decoder.h
++++ b/media/filters/ffmpeg_audio_decoder.h
+@@ -25,7 +25,13 @@ namespace media {
+
+ class AudioTimestampHelper;
+ class DecoderBuffer;
+-struct QueuedAudioBuffer;
++
++// Helper structure for managing multiple decoded audio frames per packet.
++struct QueuedAudioBuffer {
++ AudioDecoder::Status status;
++ scoped_refptr<AudioBuffer> buffer;
++};
++
+
+ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
+ public:
+diff --git a/net/cert/mock_cert_verifier.cc b/net/cert/mock_cert_verifier.cc
+index ea5538e..a30e3d5 100644
+--- a/net/cert/mock_cert_verifier.cc
++++ b/net/cert/mock_cert_verifier.cc
+@@ -13,25 +13,6 @@
+
+ namespace net {
+
+-struct MockCertVerifier::Rule {
+- Rule(X509Certificate* cert,
+- const std::string& hostname,
+- const CertVerifyResult& result,
+- int rv)
+- : cert(cert),
+- hostname(hostname),
+- result(result),
+- rv(rv) {
+- DCHECK(cert);
+- DCHECK(result.verified_cert.get());
+- }
+-
+- scoped_refptr<X509Certificate> cert;
+- std::string hostname;
+- CertVerifyResult result;
+- int rv;
+-};
+-
+ MockCertVerifier::MockCertVerifier() : default_result_(ERR_CERT_INVALID) {}
+
+ MockCertVerifier::~MockCertVerifier() {}
+diff --git a/net/cert/mock_cert_verifier.h b/net/cert/mock_cert_verifier.h
+index 5af7b7e..704c66b 100644
+--- a/net/cert/mock_cert_verifier.h
++++ b/net/cert/mock_cert_verifier.h
+@@ -57,7 +57,25 @@ class MockCertVerifier : public CertVerifier {
+ int rv);
+
+ private:
+- struct Rule;
++ struct Rule {
++ Rule(X509Certificate* cert,
++ const std::string& hostname,
++ const CertVerifyResult& result,
++ int rv)
++ : cert(cert),
++ hostname(hostname),
++ result(result),
++ rv(rv) {
++ DCHECK(cert);
++ DCHECK(result.verified_cert.get());
++ }
++
++ scoped_refptr<X509Certificate> cert;
++ std::string hostname;
++ CertVerifyResult result;
++ int rv;
++ };
++
+ typedef std::list<Rule> RuleList;
+
+ int default_result_;
+diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
+index ff5ffbc..25918ba 100644
+--- a/net/dns/mock_host_resolver.cc
++++ b/net/dns/mock_host_resolver.cc
+@@ -212,37 +212,6 @@ void MockHostResolverBase::ResolveNow(size_t id) {
+
+ //-----------------------------------------------------------------------------
+
+-struct RuleBasedHostResolverProc::Rule {
+- enum ResolverType {
+- kResolverTypeFail,
+- kResolverTypeSystem,
+- kResolverTypeIPLiteral,
+- };
+-
+- ResolverType resolver_type;
+- std::string host_pattern;
+- AddressFamily address_family;
+- HostResolverFlags host_resolver_flags;
+- std::string replacement;
+- std::string canonical_name;
+- int latency_ms; // In milliseconds.
+-
+- Rule(ResolverType resolver_type,
+- const std::string& host_pattern,
+- AddressFamily address_family,
+- HostResolverFlags host_resolver_flags,
+- const std::string& replacement,
+- const std::string& canonical_name,
+- int latency_ms)
+- : resolver_type(resolver_type),
+- host_pattern(host_pattern),
+- address_family(address_family),
+- host_resolver_flags(host_resolver_flags),
+- replacement(replacement),
+- canonical_name(canonical_name),
+- latency_ms(latency_ms) {}
+-};
+-
+ RuleBasedHostResolverProc::RuleBasedHostResolverProc(HostResolverProc* previous)
+ : HostResolverProc(previous) {
+ }
+diff --git a/net/dns/mock_host_resolver.h b/net/dns/mock_host_resolver.h
+index 3593fbd..f8a4240 100644
+--- a/net/dns/mock_host_resolver.h
++++ b/net/dns/mock_host_resolver.h
+@@ -209,7 +209,37 @@ class RuleBasedHostResolverProc : public HostResolverProc {
+ int* os_error) OVERRIDE;
+
+ private:
+- struct Rule;
++ struct Rule {
++ enum ResolverType {
++ kResolverTypeFail,
++ kResolverTypeSystem,
++ kResolverTypeIPLiteral,
++ };
++
++ ResolverType resolver_type;
++ std::string host_pattern;
++ AddressFamily address_family;
++ HostResolverFlags host_resolver_flags;
++ std::string replacement;
++ std::string canonical_name;
++ int latency_ms; // In milliseconds.
++
++ Rule(ResolverType resolver_type,
++ const std::string& host_pattern,
++ AddressFamily address_family,
++ HostResolverFlags host_resolver_flags,
++ const std::string& replacement,
++ const std::string& canonical_name,
++ int latency_ms)
++ : resolver_type(resolver_type),
++ host_pattern(host_pattern),
++ address_family(address_family),
++ host_resolver_flags(host_resolver_flags),
++ replacement(replacement),
++ canonical_name(canonical_name),
++ latency_ms(latency_ms) {}
++ };
++
+ typedef std::list<Rule> RuleList;
+
+ virtual ~RuleBasedHostResolverProc();
diff --git a/patches/chromium/0004-Do-not-modify-the-child-path.patch b/patches/chromium/0004-Do-not-modify-the-child-path.patch
new file mode 100644
index 000000000..ee80678eb
--- /dev/null
+++ b/patches/chromium/0004-Do-not-modify-the-child-path.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Sat, 29 Jun 2013 22:39:29 +0200
+Subject: Do not modify the child path.
+
+We currently only have a single process binary for Qt.
+Therefore we should not choose a different binary based on required privileges.
+However, this patch can only be a preliminary solution.
+May be we should instead implement our own ChildProcessHost.
+---
+ content/common/child_process_host_impl.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
+index fb058d3..2208376 100644
+--- a/content/common/child_process_host_impl.cc
++++ b/content/common/child_process_host_impl.cc
+@@ -106,7 +106,7 @@ base::FilePath ChildProcessHost::GetChildPath(int flags) {
+ if (child_path.empty())
+ PathService::Get(CHILD_PROCESS_EXE, &child_path);
+
+-#if defined(OS_MACOSX)
++#if defined(OS_MACOSX) && 0
+ 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/patches/chromium/0005-Do-not-warn-for-header-hygiene.patch b/patches/chromium/0005-Do-not-warn-for-header-hygiene.patch
new file mode 100644
index 000000000..01afa7e9c
--- /dev/null
+++ b/patches/chromium/0005-Do-not-warn-for-header-hygiene.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Wed, 3 Jul 2013 11:16:56 +0200
+Subject: Do not warn for header-hygiene.
+
+QtDeclarative is consciously leaking the namespace QtQml.
+Therefore clang would warn about header hygiene.
+Unfortunately this cannot be fixed in QtDeclarative,
+unless we accept not to be able to use QtQuick1 and QtQuick2
+in the same application.
+---
+ build/common.gypi | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/common.gypi b/build/common.gypi
+index 9961053..ab759282 100644
+--- a/build/common.gypi
++++ b/build/common.gypi
+@@ -3936,6 +3936,7 @@
+ '-Wno-newline-eof',
+ '-Wno-unused-value',
+ '-Wno-unused-variable',
++ '-Wno-header-hygiene',
+ ],
+ }],
+ ['clang==1 and clang_use_chrome_plugins==1', {
diff --git a/patches/chromium/0006-Build-files-necessary-for-touch-and-gestures.patch b/patches/chromium/0006-Build-files-necessary-for-touch-and-gestures.patch
new file mode 100644
index 000000000..14b4c2239
--- /dev/null
+++ b/patches/chromium/0006-Build-files-necessary-for-touch-and-gestures.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Thu, 25 Jul 2013 17:25:47 +0200
+Subject: Build files necessary for touch and gestures.
+
+Also guard the use of MessagePumpAuraX11 in events_x.cc. We need to
+build it to get symbols depending on base::NativeEvent.
+---
+ content/content_browser.gypi | 2 +-
+ ui/ui.gyp | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/content/content_browser.gypi b/content/content_browser.gypi
+index 1e3485c..c2e5f18 100644
+--- a/content/content_browser.gypi
++++ b/content/content_browser.gypi
+@@ -1479,7 +1479,7 @@
+ ['exclude', '^browser/geolocation/wifi_data_provider_linux\\.cc$'],
+ ],
+ }],
+- ['use_aura!=1 and OS!="win"', {
++ ['use_aura!=1 and use_qt!=1 and OS!="win"', {
+ 'sources!': [
+ 'browser/renderer_host/input/touchscreen_tap_suppression_controller.cc',
+ 'browser/renderer_host/ui_events_helper.cc',
+diff --git a/ui/ui.gyp b/ui/ui.gyp
+index 09c011c..4716f6c 100644
+--- a/ui/ui.gyp
++++ b/ui/ui.gyp
+@@ -708,7 +708,7 @@
+ ['exclude', 'base/dragdrop/drag_utils_aura.cc'],
+ ],
+ }],
+- ['use_aura==0 and toolkit_views==0', {
++ ['use_aura==0 and use_qt==0 and toolkit_views==0', {
+ 'sources/': [
+ ['exclude', '^base/gestures/*'],
+ ]
+@@ -886,7 +886,7 @@
+ 'base/cursor/cursor_loader_null.h',
+ ],
+ }],
+- ['toolkit_views==0', {
++ ['use_qt==0 and toolkit_views==0', {
+ 'sources!': [
+ 'base/x/events_x.cc',
+ 'events/event.cc',
diff --git a/patches/chromium/0007-remove-Wno-deprecated-register-from-common.gypi.patch b/patches/chromium/0007-remove-Wno-deprecated-register-from-common.gypi.patch
new file mode 100644
index 000000000..cb980c691
--- /dev/null
+++ b/patches/chromium/0007-remove-Wno-deprecated-register-from-common.gypi.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 1 Aug 2013 14:03:14 +0200
+Subject: remove -Wno-deprecated-register from common.gypi.
+
+This warning is not supported by recent clang versions
+shipping with XCode. Therefore replacing it with -Wno-deprecated.
+This is a bit a too broad fix, but the best we can do for now.
+It seems that the flag is still supported in upstream clang.
+---
+ build/common.gypi | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/build/common.gypi b/build/common.gypi
+index ab759282..cf5b196 100644
+--- a/build/common.gypi
++++ b/build/common.gypi
+@@ -3222,7 +3222,7 @@
+ # Clang considers the `register` keyword as deprecated, but e.g.
+ # code generated by flex (used in angle) contains that keyword.
+ # http://crbug.com/255186
+- '-Wno-deprecated-register',
++ '-Wno-deprecated',
+ ],
+ 'cflags!': [
+ # Clang doesn't seem to know know this flag.
+@@ -3925,7 +3925,7 @@
+ # Clang considers the `register` keyword as deprecated, but e.g.
+ # code generated by flex (used in angle) contains that keyword.
+ # http://crbug.com/255186
+- '-Wno-deprecated-register',
++ '-Wno-deprecated',
+ ],
+ }],
+ ['use_libcpp==1', {
diff --git a/patches/chromium/0008-Solve-conflicts-when-including-both-QtOpenGL-headers.patch b/patches/chromium/0008-Solve-conflicts-when-including-both-QtOpenGL-headers.patch
new file mode 100644
index 000000000..a12c9fb8e
--- /dev/null
+++ b/patches/chromium/0008-Solve-conflicts-when-including-both-QtOpenGL-headers.patch
@@ -0,0 +1,74 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Fri, 6 Sep 2013 17:08:45 +0200
+Subject: Solve conflicts when including both QtOpenGL headers and
+ resource_provider.h
+
+If resource_provider.h is going to be used to integrate delegated frame
+to external compositors, it should avoid conflicting with the system's gl.h.
+
+Change-Id: Ie37d6cde263157e6717cc006a9896f0b9ebdaa5d
+Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
+---
+ cc/layers/texture_layer.cc | 1 +
+ cc/output/delegating_renderer.cc | 1 +
+ cc/quads/content_draw_quad_base.h | 1 -
+ cc/resources/resource_provider.h | 5 ++++-
+ 4 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
+index 21c5e93..a845709 100644
+--- a/cc/layers/texture_layer.cc
++++ b/cc/layers/texture_layer.cc
+@@ -13,6 +13,7 @@
+ #include "cc/resources/single_release_callback.h"
+ #include "cc/trees/blocking_task_runner.h"
+ #include "cc/trees/layer_tree_host.h"
++#include "third_party/khronos/GLES2/gl2.h"
+ #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+
+ namespace cc {
+diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
+index e3413a5..1b4021f 100644
+--- a/cc/output/delegating_renderer.cc
++++ b/cc/output/delegating_renderer.cc
+@@ -23,6 +23,7 @@
+ #include "cc/quads/yuv_video_draw_quad.h"
+ #include "cc/resources/resource_provider.h"
+ #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
++#include "third_party/khronos/GLES2/gl2.h"
+ #include "third_party/khronos/GLES2/gl2ext.h"
+
+ using WebKit::WebGraphicsContext3D;
+diff --git a/cc/quads/content_draw_quad_base.h b/cc/quads/content_draw_quad_base.h
+index cbf18ca..6229d61 100644
+--- a/cc/quads/content_draw_quad_base.h
++++ b/cc/quads/content_draw_quad_base.h
+@@ -8,7 +8,6 @@
+ #include "base/memory/scoped_ptr.h"
+ #include "cc/base/cc_export.h"
+ #include "cc/quads/draw_quad.h"
+-#include "third_party/khronos/GLES2/gl2.h"
+ #include "ui/gfx/point.h"
+ #include "ui/gfx/size.h"
+
+diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
+index fb1e5f0..928d4f9 100644
+--- a/cc/resources/resource_provider.h
++++ b/cc/resources/resource_provider.h
+@@ -25,11 +25,14 @@
+ #include "cc/resources/single_release_callback.h"
+ #include "cc/resources/texture_mailbox.h"
+ #include "cc/resources/transferable_resource.h"
+-#include "third_party/khronos/GLES2/gl2.h"
+ #include "third_party/skia/include/core/SkBitmap.h"
+ #include "third_party/skia/include/core/SkCanvas.h"
+ #include "ui/gfx/size.h"
+
++// A correct fix would be not to use GL types in this interal API file.
++typedef unsigned int GLenum;
++typedef int GLint;
++
+ namespace WebKit { class WebGraphicsContext3D; }
+
+ namespace gfx {
diff --git a/patches/chromium/0009-Do-not-forward-declare-UIResourceRequest-Identity-an.patch b/patches/chromium/0009-Do-not-forward-declare-UIResourceRequest-Identity-an.patch
new file mode 100644
index 000000000..9d24881fb
--- /dev/null
+++ b/patches/chromium/0009-Do-not-forward-declare-UIResourceRequest-Identity-an.patch
@@ -0,0 +1,133 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Tue, 29 Oct 2013 11:30:28 +0100
+Subject: Do not forward declare UIResourceRequest, Identity and IdentityKey.
+
+Clang / libc++ does not support incomplete types in templates.
+See: http://clang.llvm.org/compatibility.html#undep_incomplete
+---
+ cc/trees/layer_tree_impl.h | 1 +
+ .../browser/media/webrtc_identity_store_backend.cc | 37 -------------------
+ .../browser/media/webrtc_identity_store_backend.h | 42 ++++++++++++++++++++--
+ 3 files changed, 40 insertions(+), 40 deletions(-)
+
+diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
+index eb6a015..2ae33df 100644
+--- a/cc/trees/layer_tree_impl.h
++++ b/cc/trees/layer_tree_impl.h
+@@ -12,6 +12,7 @@
+ #include "base/containers/hash_tables.h"
+ #include "base/values.h"
+ #include "cc/layers/layer_impl.h"
++#include "cc/trees/layer_tree_host.h"
+ #include "cc/resources/ui_resource_client.h"
+ #include "ui/events/latency_info.h"
+
+diff --git a/content/browser/media/webrtc_identity_store_backend.cc b/content/browser/media/webrtc_identity_store_backend.cc
+index 9ec73e9..4188116 100644
+--- a/content/browser/media/webrtc_identity_store_backend.cc
++++ b/content/browser/media/webrtc_identity_store_backend.cc
+@@ -46,43 +46,6 @@ 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/content/browser/media/webrtc_identity_store_backend.h b/content/browser/media/webrtc_identity_store_backend.h
+index ab4e1ed..e660c73 100644
+--- a/content/browser/media/webrtc_identity_store_backend.h
++++ b/content/browser/media/webrtc_identity_store_backend.h
+@@ -11,8 +11,7 @@
+ #include "base/time/time.h"
+ #include "sql/connection.h"
+ #include "sql/meta_table.h"
+-
+-class GURL;
++#include "url/gurl.h"
+
+ namespace base {
+ class FilePath;
+@@ -88,7 +87,44 @@ class WebRTCIdentityStoreBackend
+ };
+ struct PendingFindRequest;
+ struct IdentityKey;
+- struct Identity;
++
++ 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;
++ };
++
+ typedef std::map<IdentityKey, Identity> IdentityMap;
+
+ ~WebRTCIdentityStoreBackend();
diff --git a/patches/chromium/0010-Fix-the-build-with-a-GL-ES2-configured-Qt.patch b/patches/chromium/0010-Fix-the-build-with-a-GL-ES2-configured-Qt.patch
new file mode 100644
index 000000000..02688d6ad
--- /dev/null
+++ b/patches/chromium/0010-Fix-the-build-with-a-GL-ES2-configured-Qt.patch
@@ -0,0 +1,161 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Wed, 30 Oct 2013 14:27:28 +0100
+Subject: Fix the build with a GL ES2 configured Qt.
+
+GLES/gl2.h is included through Qt public headers and the copy of
+Chromium is used since its include path comes before /usr/include.
+The problem is that this header is incompatible for some reasons,
+one of them being that it converts all GL function symbols from
+gl* to GLES2*.
+
+Qt layer code should always need to go through GL directly,
+so make sure that only GYP targets that depend directly on gpu.gyp,
+khronos.gyp or webkit_gpu.gyp will have an include path
+pointing to those headers.
+
+Replace all_dependent_settings with direct_dependent_settings and
+control which target inherits this include_dirs from its dependencies
+by using export_dependent_settings.
+
+Change-Id: Id4d98fe22ef8b778b5ba8da300dad28e69507732
+---
+ content/content_browser.gypi | 1 +
+ gpu/command_buffer_client.gypi | 3 +++
+ gpu/command_buffer_common.gypi | 3 +++
+ gpu/gpu.gyp | 18 ++++++++++++++++++
+ third_party/khronos/khronos.gyp | 2 +-
+ webkit/common/gpu/webkit_gpu.gyp | 3 +++
+ 6 files changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/content/content_browser.gypi b/content/content_browser.gypi
+index c2e5f18..f820ad0 100644
+--- a/content/content_browser.gypi
++++ b/content/content_browser.gypi
+@@ -1270,6 +1270,7 @@
+ 'dependencies': [
+ 'browser/devtools/devtools_resources.gyp:devtools_resources',
+ '../cc/cc.gyp:cc',
++ '../gpu/gpu.gyp:gpu_ipc',
+ '../net/net.gyp:http_server',
+ '../printing/printing.gyp:printing',
+ '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
+diff --git a/gpu/command_buffer_client.gypi b/gpu/command_buffer_client.gypi
+index b4d5b78..75bea79 100644
+--- a/gpu/command_buffer_client.gypi
++++ b/gpu/command_buffer_client.gypi
+@@ -14,6 +14,9 @@
+ 'dependencies': [
+ '../third_party/khronos/khronos.gyp:khronos_headers',
+ ],
++ 'export_dependent_settings': [
++ '../third_party/khronos/khronos.gyp:khronos_headers',
++ ],
+ 'sources': [
+ 'command_buffer/client/atomicops.cc',
+ 'command_buffer/client/atomicops.h',
+diff --git a/gpu/command_buffer_common.gypi b/gpu/command_buffer_common.gypi
+index 55e825e..4c1044a 100644
+--- a/gpu/command_buffer_common.gypi
++++ b/gpu/command_buffer_common.gypi
+@@ -6,6 +6,9 @@
+ 'dependencies': [
+ '../third_party/khronos/khronos.gyp:khronos_headers',
+ ],
++ 'export_dependent_settings': [
++ '../third_party/khronos/khronos.gyp:khronos_headers',
++ ],
+ 'sources': [
+ 'command_buffer/common/bitfield_helpers.h',
+ 'command_buffer/common/buffer.h',
+diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
+index 316aa91..1599623 100644
+--- a/gpu/gpu.gyp
++++ b/gpu/gpu.gyp
+@@ -23,6 +23,9 @@
+ 'command_buffer/command_buffer.gyp:gles2_utils',
+ 'gles2_cmd_helper',
+ ],
++ 'export_dependent_settings': [
++ '../third_party/khronos/khronos.gyp:khronos_headers',
++ ],
+ 'defines': [
+ 'GLES2_IMPL_IMPLEMENTATION',
+ ],
+@@ -88,6 +91,9 @@
+ 'command_buffer_client',
+ 'gles2_implementation',
+ ],
++ 'export_dependent_settings': [
++ 'command_buffer_client',
++ ],
+ 'defines': [
+ 'GLES2_C_LIB_IMPLEMENTATION',
+ ],
+@@ -113,6 +119,9 @@
+ 'command_buffer_client',
+ 'gles2_implementation_client_side_arrays_no_check',
+ ],
++ 'export_dependent_settings': [
++ 'command_buffer_client',
++ ],
+ 'sources': [
+ '<@(gles2_c_lib_source_files)',
+ ],
+@@ -348,6 +357,9 @@
+ 'gpu_config',
+ 'gpu_ipc',
+ ],
++ 'export_dependent_settings': [
++ 'command_buffer_common',
++ ],
+ 'sources': [
+ 'gpu_export.h',
+ ],
+@@ -390,6 +402,9 @@
+ 'dependencies': [
+ 'command_buffer_common',
+ ],
++ 'export_dependent_settings': [
++ 'command_buffer_common',
++ ],
+ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+ 'msvs_disabled_warnings': [4267, ],
+ },
+@@ -415,6 +430,9 @@
+ 'dependencies': [
+ 'command_buffer_common',
+ ],
++ 'export_dependent_settings': [
++ 'command_buffer_common',
++ ],
+ },
+ {
+ 'target_name': 'gpu_config',
+diff --git a/third_party/khronos/khronos.gyp b/third_party/khronos/khronos.gyp
+index 8a85572..88130d2 100644
+--- a/third_party/khronos/khronos.gyp
++++ b/third_party/khronos/khronos.gyp
+@@ -7,7 +7,7 @@
+ {
+ 'target_name': 'khronos_headers',
+ 'type': 'none',
+- 'all_dependent_settings': {
++ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '.',
+ '../../gpu', # Contains GLES2/gl2chromium.h
+diff --git a/webkit/common/gpu/webkit_gpu.gyp b/webkit/common/gpu/webkit_gpu.gyp
+index 2831446..be79c22 100644
+--- a/webkit/common/gpu/webkit_gpu.gyp
++++ b/webkit/common/gpu/webkit_gpu.gyp
+@@ -27,6 +27,9 @@
+ '<(DEPTH)/ui/gl/gl.gyp:gl',
+ '<(DEPTH)/ui/ui.gyp:ui',
+ ],
++ 'export_dependent_settings': [
++ '<(DEPTH)/gpu/gpu.gyp:gles2_implementation',
++ ],
+ 'sources': [
+ # This list contains all .h and .cc in gpu except for test code.
+ 'context_provider_in_process.cc',
diff --git a/patches/chromium/0011-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch b/patches/chromium/0011-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch
new file mode 100644
index 000000000..41ac2c5e1
--- /dev/null
+++ b/patches/chromium/0011-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Fri, 20 Sep 2013 15:01:41 +0200
+Subject: Hide the definition of MessagePumpGtk::GetDefaultXDisplay.
+
+---
+ base/message_loop/message_pump_gtk.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/base/message_loop/message_pump_gtk.cc b/base/message_loop/message_pump_gtk.cc
+index 86d2415..6023c11 100644
+--- a/base/message_loop/message_pump_gtk.cc
++++ b/base/message_loop/message_pump_gtk.cc
+@@ -79,6 +79,9 @@ void MessagePumpGtk::DispatchEvents(GdkEvent* event) {
+ DidProcessEvent(event);
+ }
+
++// FIXME: Get our own MessagePumpUI to avoid this.
++// Comment out this version so that our Qt version in shared_globals.cpp is used.
++/*
+ // static
+ Display* MessagePumpGtk::GetDefaultXDisplay() {
+ static GdkDisplay* display = gdk_display_get_default();
+@@ -90,6 +93,7 @@ Display* MessagePumpGtk::GetDefaultXDisplay() {
+ }
+ return GDK_DISPLAY_XDISPLAY(display);
+ }
++*/
+
+ void MessagePumpGtk::AddObserver(MessagePumpGdkObserver* observer) {
+ observers_.AddObserver(observer);
diff --git a/patches/chromium/0012-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch b/patches/chromium/0012-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
new file mode 100644
index 000000000..3a9052ff2
--- /dev/null
+++ b/patches/chromium/0012-Add-accessors-for-the-Qt-delegated-renderer-integrat.patch
@@ -0,0 +1,81 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Fri, 20 Sep 2013 15:00:47 +0200
+Subject: Add accessors for the Qt delegated renderer integration.
+
+This is needed to fetch the MessageLoop, the MailboxManager and the
+SyncPointManager of the GPU in-process host.
+---
+ content/common/gpu/gpu_channel_manager.h | 2 ++
+ content/gpu/gpu_child_thread.cc | 6 ++++++
+ content/gpu/gpu_child_thread.h | 6 ++++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
+index f01a1c5..e41a548 100644
+--- a/content/common/gpu/gpu_channel_manager.h
++++ b/content/common/gpu/gpu_channel_manager.h
+@@ -89,6 +89,8 @@ 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_; }
+
+ GpuChannel* LookupChannel(int32 client_id);
+diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
+index 170b364..a84a9e0 100644
+--- a/content/gpu/gpu_child_thread.cc
++++ b/content/gpu/gpu_child_thread.cc
+@@ -40,6 +40,8 @@ bool GpuProcessLogMessageHandler(int severity,
+
+ } // namespace
+
++GpuChildThread* GpuChildThread::instance_ = 0;
++
+ GpuChildThread::GpuChildThread(GpuWatchdogThread* watchdog_thread,
+ bool dead_on_arrival,
+ const gpu::GPUInfo& gpu_info,
+@@ -53,6 +55,8 @@ 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)
+@@ -71,6 +75,8 @@ 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/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
+index ff0c925..82bb32a 100644
+--- a/content/gpu/gpu_child_thread.h
++++ b/content/gpu/gpu_child_thread.h
+@@ -56,6 +56,10 @@ 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();
+@@ -94,6 +98,8 @@ 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/patches/chromium/0013-Add-seams-to-setup-GL-contexts-sharing-with-QtQuick.patch b/patches/chromium/0013-Add-seams-to-setup-GL-contexts-sharing-with-QtQuick.patch
new file mode 100644
index 000000000..a304c93bc
--- /dev/null
+++ b/patches/chromium/0013-Add-seams-to-setup-GL-contexts-sharing-with-QtQuick.patch
@@ -0,0 +1,106 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Thu, 24 Oct 2013 18:26:59 +0200
+Subject: Add seams to setup GL contexts sharing with QtQuick.
+
+This will allow us to know right before the first GL context is
+instantiated by Chromium so that we can install those contexts to
+be shared with QtQuick GL contexts as well.
+---
+ content/common/gpu/gpu_channel_manager.cc | 8 +++++++-
+ content/public/browser/content_browser_client.h | 5 +++++
+ ui/gl/gl_share_group.cc | 3 +++
+ ui/gl/gl_share_group.h | 7 +++++--
+ 4 files changed, 20 insertions(+), 3 deletions(-)
+
+diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
+index 8b466bd..fe3f7b3 100644
+--- a/content/common/gpu/gpu_channel_manager.cc
++++ b/content/common/gpu/gpu_channel_manager.cc
+@@ -11,6 +11,7 @@
+ #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"
+@@ -124,7 +125,12 @@ void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) {
+ DCHECK(!mailbox_manager_.get());
+ mailbox_manager_ = new gpu::gles2::MailboxManager;
+ }
+- share_group = share_group_.get();
++ // 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();
+ mailbox_manager = mailbox_manager_.get();
+ }
+
+diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
+index cc664c6..f817cb2 100644
+--- a/content/public/browser/content_browser_client.h
++++ b/content/public/browser/content_browser_client.h
+@@ -48,6 +48,7 @@ class CryptoModuleBlockingPasswordDelegate;
+ }
+
+ namespace gfx {
++class GLShareGroup;
+ class ImageSkia;
+ }
+
+@@ -570,6 +571,10 @@ class CONTENT_EXPORT ContentBrowserClient {
+ // Return NULL to use the default one for the platform to be created.
+ virtual LocationProvider* OverrideSystemLocationProvider();
+
++ // 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/ui/gl/gl_share_group.cc b/ui/gl/gl_share_group.cc
+index 8e8958b..347873d 100644
+--- a/ui/gl/gl_share_group.cc
++++ b/ui/gl/gl_share_group.cc
+@@ -18,6 +18,9 @@ GLShareGroup::GLShareGroup()
+ }
+
+ void GLShareGroup::AddContext(GLContext* context) {
++ if (contexts_.empty())
++ AboutToAddFirstContext();
++
+ contexts_.insert(context);
+ }
+
+diff --git a/ui/gl/gl_share_group.h b/ui/gl/gl_share_group.h
+index 1deed63..f1b0369 100644
+--- a/ui/gl/gl_share_group.h
++++ b/ui/gl/gl_share_group.h
+@@ -31,7 +31,7 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
+
+ // Returns a pointer to any initialized context in the share group
+ // or NULL if there are no initialized contexts in the share group.
+- GLContext* GetContext();
++ virtual GLContext* GetContext();
+
+ // Sets and returns the unique shared GL context. Used for context
+ // virtualization.
+@@ -45,10 +45,13 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
+ int GetRendererID();
+ #endif
+
++ protected:
++ virtual ~GLShareGroup();
++ virtual void AboutToAddFirstContext() { }
++
+ private:
+ friend class base::RefCounted<GLShareGroup>;
+
+- ~GLShareGroup();
+
+ // References to GLContext are by raw pointer to avoid a reference count
+ // cycle.
diff --git a/patches/chromium/0014-Declare-a-Qt-IPC-message-class.patch b/patches/chromium/0014-Declare-a-Qt-IPC-message-class.patch
new file mode 100644
index 000000000..c08c09916
--- /dev/null
+++ b/patches/chromium/0014-Declare-a-Qt-IPC-message-class.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+Date: Wed, 15 Jan 2014 17:22:44 +0100
+Subject: Declare a Qt IPC message class
+
+This allows Qt-specific IPC messages to be declared in QtWebEngine.
+
+Change-Id: Id6af79becf14c8c621df6752c6183ff550524859
+Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
+---
+ ipc/ipc_message_start.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ipc/ipc_message_start.h b/ipc/ipc_message_start.h
+index a8cca53..314ed0e 100644
+--- a/ipc/ipc_message_start.h
++++ b/ipc/ipc_message_start.h
+@@ -10,6 +10,7 @@
+ // code to figure out the message class from its ID.
+ enum IPCMessageStart {
+ AutomationMsgStart = 0,
++ QtMsgStart,
+ ViewMsgStart,
+ InputMsgStart,
+ PluginMsgStart,
diff --git a/patches/chromium/third_party/WebKit/0001-Remove-leftovers-from-WebKitSystemInterface.patch b/patches/chromium/third_party/WebKit/0001-Remove-leftovers-from-WebKitSystemInterface.patch
new file mode 100644
index 000000000..bfd00a573
--- /dev/null
+++ b/patches/chromium/third_party/WebKit/0001-Remove-leftovers-from-WebKitSystemInterface.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 27 Jun 2013 19:21:34 +0200
+Subject: Remove leftovers from WebKitSystemInterface
+
+---
+ Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm b/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm
+index c5be0bb..5882bcd 100644
+--- a/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm
++++ b/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm
+@@ -223,14 +223,9 @@ void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp,
+ static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+- ProviderInfo info = { cp, length, stringAttributes.get() };
+- RetainPtr<CTTypesetterRef> typesetter(AdoptCF, WKCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+-#else
+ RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, cp, length, kCFAllocatorNull));
+ RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), stringAttributes.get()));
+ RetainPtr<CTTypesetterRef> typesetter(AdoptCF, CTTypesetterCreateWithAttributedStringAndOptions(attributedString.get(), m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+-#endif
+
+ line.adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
+ } else {
diff --git a/patches/chromium/third_party/libjingle/source/talk/0001-Do-not-forward-declare-WebRtcVoiceChannelInfo.patch b/patches/chromium/third_party/libjingle/source/talk/0001-Do-not-forward-declare-WebRtcVoiceChannelInfo.patch
new file mode 100644
index 000000000..5af44662d
--- /dev/null
+++ b/patches/chromium/third_party/libjingle/source/talk/0001-Do-not-forward-declare-WebRtcVoiceChannelInfo.patch
@@ -0,0 +1,63 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Wed, 16 Oct 2013 10:17:11 +0200
+Subject: Do not forward declare WebRtcVoiceChannelInfo.
+
+Clang / libc++ does not support incomplete types in
+templates. See:
+http://clang.llvm.org/compatibility.html#undep_incomplete
+
+This fixes the fixes the "error: field has incomplete type" compiler error.
+---
+ media/webrtc/webrtcvoiceengine.cc | 13 -------------
+ media/webrtc/webrtcvoiceengine.h | 13 ++++++++++++-
+ 2 files changed, 12 insertions(+), 14 deletions(-)
+
+diff --git a/media/webrtc/webrtcvoiceengine.cc b/media/webrtc/webrtcvoiceengine.cc
+index 2a6ccd7..8686038 100644
+--- a/media/webrtc/webrtcvoiceengine.cc
++++ b/media/webrtc/webrtcvoiceengine.cc
+@@ -1475,19 +1475,6 @@ void WebRtcVoiceEngine::StopAecDump() {
+ }
+ }
+
+-// This struct relies on the generated copy constructor and assignment operator
+-// since it is used in an stl::map.
+-struct WebRtcVoiceMediaChannel::WebRtcVoiceChannelInfo {
+- WebRtcVoiceChannelInfo() : channel(-1), renderer(NULL) {}
+- WebRtcVoiceChannelInfo(int ch, AudioRenderer* r)
+- : channel(ch),
+- renderer(r) {}
+- ~WebRtcVoiceChannelInfo() {}
+-
+- int channel;
+- AudioRenderer* renderer;
+-};
+-
+ // WebRtcVoiceMediaChannel
+ WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine *engine)
+ : WebRtcMediaChannel<VoiceMediaChannel, WebRtcVoiceEngine>(
+diff --git a/media/webrtc/webrtcvoiceengine.h b/media/webrtc/webrtcvoiceengine.h
+index 6cb0b30..62d3bc1 100644
+--- a/media/webrtc/webrtcvoiceengine.h
++++ b/media/webrtc/webrtcvoiceengine.h
+@@ -374,7 +374,18 @@ class WebRtcVoiceMediaChannel
+ static Error WebRtcErrorToChannelError(int err_code);
+
+ private:
+- struct WebRtcVoiceChannelInfo;
++ // This struct relies on the generated copy constructor and assignment operator
++ // since it is used in an stl::map.
++ struct WebRtcVoiceChannelInfo {
++ WebRtcVoiceChannelInfo() : channel(-1), renderer(NULL) {}
++ WebRtcVoiceChannelInfo(int ch, AudioRenderer* r)
++ : channel(ch),
++ renderer(r) {}
++ ~WebRtcVoiceChannelInfo() {}
++
++ int channel;
++ AudioRenderer* renderer;
++ };
+ typedef std::map<uint32, WebRtcVoiceChannelInfo> ChannelMap;
+
+ void SetNack(int channel, bool nack_enabled);
diff --git a/patches/chromium/tools/grit/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch b/patches/chromium/tools/grit/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch
new file mode 100644
index 000000000..9da214cc2
--- /dev/null
+++ b/patches/chromium/tools/grit/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Wed, 24 Jul 2013 15:54:50 +0200
+Subject: GRIT: Allow grd files outside of chromium source dir.
+
+When replacing substrings with values from a dictionary,
+the replacements should not be truncated to the length of src_root_dir.
+
+If the basename does not exist as a key in the resource_ids file,
+then fall back to an absolute path.
+
+The precedence is like:
+file in chromium > file basename > absolute file name.
+
+THIS SHOULD BE UPSTREAMABLE.
+---
+ grit/node/misc.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/grit/node/misc.py b/grit/node/misc.py
+index 734c57a..33848b2 100755
+--- a/grit/node/misc.py
++++ b/grit/node/misc.py
+@@ -49,7 +49,7 @@ def _ReadFirstIdsFromFile(filename, defines):
+ def ReplaceVariable(matchobj):
+ for key, value in defines.iteritems():
+ if matchobj.group(1) == key:
+- value = os.path.abspath(value)[len(src_root_dir) + 1:]
++ value = os.path.abspath(value)
+ return value
+ return ''
+
+@@ -427,6 +427,10 @@ class GritNode(base.Node):
+ abs_filename = os.path.abspath(filename_or_stream)
+ if abs_filename[:len(src_root_dir)] != src_root_dir:
+ filename = os.path.basename(filename_or_stream)
++ # If the file is not within src_root_dir and the basename is not
++ # found as a key, fall back to using the absolute file name.
++ if not filename in first_ids:
++ filename = abs_filename
+ else:
+ filename = abs_filename[len(src_root_dir) + 1:]
+ filename = filename.replace('\\', '/')
diff --git a/patches/chromium/tools/gyp/0001-Fix-build-with-toplevel-dir.patch b/patches/chromium/tools/gyp/0001-Fix-build-with-toplevel-dir.patch
new file mode 100644
index 000000000..0ab2861ee
--- /dev/null
+++ b/patches/chromium/tools/gyp/0001-Fix-build-with-toplevel-dir.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Pierre Rossi <pierre.rossi@digia.com>
+Date: Mon, 13 May 2013 16:25:46 +0200
+Subject: Fix build with toplevel-dir
+
+---
+ pylib/gyp/generator/ninja.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
+index 9011807..6fe07c5 100644
+--- a/pylib/gyp/generator/ninja.py
++++ b/pylib/gyp/generator/ninja.py
+@@ -1476,9 +1476,13 @@ def CalculateVariables(default_variables, params):
+ default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
+ default_variables.setdefault('SHARED_LIB_DIR',
+ os.path.join('$!PRODUCT_DIR', 'lib'))
++ # Take into account the fact that toplevel_dir might not be equal to depth
++ toplevel_offset = ''
++ if 'options' in params:
++ options = params['options']
++ toplevel_offset = os.path.relpath(options.depth, options.toplevel_dir)
+ default_variables.setdefault('LIB_DIR',
+- os.path.join('$!PRODUCT_DIR', 'obj'))
+-
++ os.path.join('$!PRODUCT_DIR', 'obj', toplevel_offset))
+
+ def OpenOutput(path, mode='w'):
+ """Open |path| for writing, creating directories if necessary."""
diff --git a/patches/chromium/tools/gyp/0002-Add-support-for-libc-to-xcode_emulation.py.patch b/patches/chromium/tools/gyp/0002-Add-support-for-libc-to-xcode_emulation.py.patch
new file mode 100644
index 000000000..d12bad22b
--- /dev/null
+++ b/patches/chromium/tools/gyp/0002-Add-support-for-libc-to-xcode_emulation.py.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Thu, 27 Jun 2013 20:04:51 +0200
+Subject: Add support for libc++ to xcode_emulation.py
+
+---
+ pylib/gyp/xcode_emulation.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
+index b4af0fd..fb40048 100644
+--- a/pylib/gyp/xcode_emulation.py
++++ b/pylib/gyp/xcode_emulation.py
+@@ -580,6 +580,9 @@ class XcodeSettings(object):
+ for ldflag in self._Settings().get('OTHER_LDFLAGS', []):
+ ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path))
+
++ if self._Test('USE_LIBCPP', 'YES', default='NO'):
++ ldflags.append('-stdlib=libc++')
++
+ if self._Test('DEAD_CODE_STRIPPING', 'YES', default='NO'):
+ ldflags.append('-Wl,-dead_strip')
+