Date: Thursday, November 14, 2013 @ 00:41:00 Author: foutrelis Revision: 199519
upgpkg: chromium 31.0.1650.48-1 New upstream release. Added: chromium/trunk/chromium-31.0.1650.48-NPAPI-cookies.patch chromium/trunk/chromium-31.0.1650.48-NPN_URLRedirectResponse.patch Modified: chromium/trunk/PKGBUILD -----------------------------------------------------+ PKGBUILD | 36 +- chromium-31.0.1650.48-NPAPI-cookies.patch | 276 ++++++++++++++++++ chromium-31.0.1650.48-NPN_URLRedirectResponse.patch | 13 3 files changed, 316 insertions(+), 9 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2013-11-13 23:06:31 UTC (rev 199518) +++ PKGBUILD 2013-11-13 23:41:00 UTC (rev 199519) @@ -5,8 +5,8 @@ # Contributor: Daniel J Griffiths <[email protected]> pkgname=chromium -pkgver=30.0.1599.114 -_toolchains_rev=12029 +pkgver=31.0.1650.48 +_toolchains_rev=12181 pkgrel=1 pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser" arch=('i686' 'x86_64') @@ -13,7 +13,7 @@ url="http://www.chromium.org/" license=('BSD') depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent' 'libxss' 'icu' - 'libgcrypt' 'ttf-font' 'udev' 'dbus' 'flac' 'opus' 'libwebp' 'snappy' + 'libgcrypt' 'ttf-font' 'udev' 'dbus' 'flac' 'opus' 'snappy' 'speech-dispatcher' 'pciutils' 'libpulse' 'harfbuzz' 'harfbuzz-icu' 'desktop-file-utils' 'hicolor-icon-theme') makedepends=('python2' 'perl' 'gperf' 'yasm' 'mesa' 'libgnome-keyring' @@ -21,6 +21,7 @@ [[ $CARCH = x86_64 ]] && makedepends+=('lib32-gcc-libs' 'lib32-zlib') optdepends=('kdebase-kdialog: needed for file dialogs in KDE') backup=('etc/chromium/default') +options=('!strip') install=chromium.install source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz naclsdk_nacl_linux_x86-$_toolchains_rev.tgz::https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain/$_toolchains_rev/naclsdk_linux_x86.tgz @@ -30,18 +31,22 @@ chromium.desktop chromium.default chromium.sh + chromium-31.0.1650.48-NPN_URLRedirectResponse.patch + chromium-31.0.1650.48-NPAPI-cookies.patch chromium-system-icu-r0.patch) noextract=(naclsdk_nacl_linux_x86-$_toolchains_rev.tgz naclsdk_pnacl_linux_x86-$_toolchains_rev.tgz naclsdk_pnacl_translator-$_toolchains_rev.tgz) -sha256sums=('82ff2b54cb6fa9f314098e9905e79d578d97940bab05111a3c0c782217c2b760' - '641e2acf0e755bfe052016164e9e0198104130b612a042eacf259a2f2630d6cd' - '6ce53b1af8fef34c1557c7fbb764cfbca29cb70b8ee3367746a31976cf115e01' - '0b7afcbad1461336e7062d7c8d64e67e670a1fce07214e24313204af1f3a5a70' - 'd6c5ed767ee9ee4e92b4de958cd32b0152783f170c1483fe99d2199fc2623813' +sha256sums=('3e478b5b85a023b3bba55b23d71cd6f585a08f865f7a98297a9a0757e9695c5d' + 'cb4ac159f61de5e75d339813c0fc74f986156310a2c43a30ba40125951e72450' + 'ad229b69a5af72a9fa7cf2167ee48560cc11049206e4ef919cb31d1273d6409f' + 'fdb8309ef2b1c8600d63c4420ac02d66d85ab9befe98d99e9706828870730077' + '162cf456b0a1cb4ce505004f828a09164ee3e3c8274739c6d5e972bf0ef1cfe9' '09bfac44104f4ccda4c228053f689c947b3e97da9a4ab6fa34ce061ee83d0322' '478340d5760a9bd6c549e19b1b5d1c5b4933ebf5f8cfb2b3e2d70d07443fe232' '4999fded897af692f4974f0a3e3bbb215193519918a1fa9b31ed51e74a2dccb9' + 'c2e56730e0cf962d762d18abf8488e1b19b4688ce39d22dd74c47dba7996319b' + 'b24f58147333eb29f762aec58742db74825b587def3d6daf16c8cd315ce6ccff' '9bf164094ff33565f79807ab17cbd1d3f75655383fdaa01bb1a702263174cf09') # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) @@ -55,6 +60,14 @@ prepare() { cd "$srcdir/$pkgname-$pkgver" + # Black screen is displayed when playing a video with NPAPI plugin + # http://code.google.com/p/chromium/issues/detail?id=301510 + patch -Np0 -i "$srcdir/chromium-31.0.1650.48-NPN_URLRedirectResponse.patch" + + # Cookies not being sent with plugin requests + # http://code.google.com/p/chromium/issues/detail?id=316511 + patch -Np0 -i "$srcdir/chromium-31.0.1650.48-NPAPI-cookies.patch" + # Fix build with system ICU (patch from Gentoo) patch -Np0 -i "$srcdir/chromium-system-icu-r0.patch" @@ -116,7 +129,6 @@ -Duse_system_libevent=1 -Duse_system_libjpeg=1 -Duse_system_libpng=1 - -Duse_system_libwebp=1 -Duse_system_libxml=0 -Duse_system_opus=1 -Duse_system_snappy=1 @@ -146,6 +158,12 @@ out/Release/{libppGoogleNaClPluginChrome.so,nacl_irt_*.nexe} \ "$pkgdir/usr/lib/chromium/" + # Manually strip binaries so that 'nacl_irt_*.nexe' is left intact + strip $STRIP_BINARIES "$pkgdir/usr/lib/chromium/"{chromium,chrome-sandbox} \ + "$pkgdir/usr/lib/chromium/"nacl_helper{,_bootstrap} + strip $STRIP_SHARED "$pkgdir/usr/lib/chromium/libffmpegsumo.so" \ + "$pkgdir/usr/lib/chromium/libppGoogleNaClPluginChrome.so" + # Allow users to override command-line options install -Dm644 "$srcdir/chromium.default" "$pkgdir/etc/chromium/default" Added: chromium-31.0.1650.48-NPAPI-cookies.patch =================================================================== --- chromium-31.0.1650.48-NPAPI-cookies.patch (rev 0) +++ chromium-31.0.1650.48-NPAPI-cookies.patch 2013-11-13 23:41:00 UTC (rev 199519) @@ -0,0 +1,276 @@ +Index: content/browser/child_process_security_policy_impl.cc +=================================================================== +--- content/browser/child_process_security_policy_impl.cc (revision 233522) ++++ content/browser/child_process_security_policy_impl.cc (working copy) +@@ -793,7 +793,7 @@ + bool ChildProcessSecurityPolicyImpl::CanSendCookiesForOrigin(int child_id, + const GURL& gurl) { + for (PluginProcessHostIterator iter; !iter.Done(); ++iter) { +- if (iter.GetData().process_type == child_id) { ++ if (iter.GetData().id == child_id) { + if (iter.GetData().process_type == PROCESS_TYPE_PLUGIN) { + // NPAPI plugin processes are unsandboxed and so are trusted. Plugins + // can make request to any origin. +Index: content/browser/plugin_browsertest.cc +=================================================================== +--- content/browser/plugin_browsertest.cc (revision 233522) ++++ content/browser/plugin_browsertest.cc (working copy) +@@ -5,15 +5,21 @@ + #include "base/command_line.h" + #include "base/file_util.h" + #include "base/path_service.h" ++#include "base/strings/string_util.h" + #include "base/strings/utf_string_conversions.h" ++#include "content/browser/loader/resource_dispatcher_host_impl.h" + #include "content/public/browser/browser_thread.h" ++#include "content/public/browser/resource_dispatcher_host_delegate.h" + #include "content/public/common/content_switches.h" + #include "content/public/test/browser_test_utils.h" ++#include "content/public/test/test_utils.h" + #include "content/shell/browser/shell.h" + #include "content/shell/common/shell_switches.h" + #include "content/test/content_browser_test.h" + #include "content/test/content_browser_test_utils.h" + #include "content/test/net/url_request_mock_http_job.h" ++#include "net/test/embedded_test_server/embedded_test_server.h" ++#include "net/url_request/url_request.h" + #include "ui/gfx/rect.h" + + #if defined(OS_WIN) +@@ -468,4 +474,77 @@ + } + #endif // defined(OS_WIN) + ++class TestResourceDispatcherHostDelegate ++ : public ResourceDispatcherHostDelegate { ++ public: ++ TestResourceDispatcherHostDelegate() : found_cookie_(false) {} ++ ++ bool found_cookie() { return found_cookie_; } ++ ++ void WaitForPluginRequest() { ++ if (found_cookie_) ++ return; ++ ++ runner_ = new MessageLoopRunner; ++ runner_->Run(); ++ } ++ ++ private: ++ // ResourceDispatcherHostDelegate implementation: ++ virtual void OnResponseStarted( ++ net::URLRequest* request, ++ ResourceContext* resource_context, ++ ResourceResponse* response, ++ IPC::Sender* sender) OVERRIDE { ++ // The URL below comes from plugin_geturl_test.cc. ++ if (!EndsWith(request->url().spec(), ++ "npapi/plugin_ref_target_page.html", ++ true)) { ++ return; ++ } ++ net::HttpRequestHeaders headers; ++ bool found_cookie = false; ++ if (request->GetFullRequestHeaders(&headers) && ++ headers.ToString().find("Cookie: blah") != std::string::npos) { ++ found_cookie = true; ++ } ++ BrowserThread::PostTask( ++ BrowserThread::UI, ++ FROM_HERE, ++ base::Bind(&TestResourceDispatcherHostDelegate::GotCookie, ++ base::Unretained(this), found_cookie)); ++ } ++ ++ void GotCookie(bool found_cookie) { ++ found_cookie_ = found_cookie; ++ if (runner_) ++ runner_->QuitClosure().Run(); ++ } ++ ++ scoped_refptr<MessageLoopRunner> runner_; ++ bool found_cookie_; ++ ++ DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); ++}; ++ ++// Ensure that cookies get sent with plugin requests. ++IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(Cookies)) { ++ // Create a new browser just to ensure that the plugin process' child_id is ++ // not equal to its type (PROCESS_TYPE_PLUGIN), as that was the error which ++ // caused this bug. ++ NavigateToURL(CreateBrowser(), GURL("about:blank")); ++ ++ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); ++ GURL url(embedded_test_server()->GetURL("/npapi/cookies.html")); ++ ++ TestResourceDispatcherHostDelegate test_delegate; ++ ResourceDispatcherHostDelegate* old_delegate = ++ ResourceDispatcherHostImpl::Get()->delegate(); ++ ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); ++ LoadAndWait(url); ++ test_delegate.WaitForPluginRequest(); ++ ASSERT_TRUE(test_delegate.found_cookie()); ++ ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); ++} ++ + } // namespace content +Index: content/test/data/npapi/cookies.html +=================================================================== +--- content/test/data/npapi/cookies.html (revision 0) ++++ content/test/data/npapi/cookies.html (revision 0) +@@ -0,0 +1,27 @@ ++<html> ++ ++<head> ++<script src="npapi.js"></script> ++<script>document.cookie="blah"</script> ++</head> ++ ++ ++<body> ++<div id="statusPanel" style="border: 1px solid red; width: 100%"> ++Test running.... ++</div> ++ ++ ++Cookies Test<p> ++This test fetches an URL via the plugin, and verifies that the cookies are sent ++with plugin-initiated requests. ++ ++<embed type="application/vnd.npapi-test" ++ src="foo" ++ name="cookies" ++ id="1" ++ mode="np_embed" ++> ++ ++</body> ++</html> + +Property changes on: content\test\data\npapi\cookies.html +___________________________________________________________________ +Added: svn:mime-type + + text/html +Added: svn:eol-style + + LF + +Index: content/test/plugin/plugin_geturl_test.cc +=================================================================== +--- content/test/plugin/plugin_geturl_test.cc (revision 233522) ++++ content/test/plugin/plugin_geturl_test.cc (working copy) +@@ -48,7 +48,8 @@ + expect_404_response_(false), + npn_evaluate_context_(false), + handle_url_redirects_(false), +- received_url_redirect_notification_(false) { ++ received_url_redirect_notification_(false), ++ check_cookies_(false) { + } + + PluginGetURLTest::~PluginGetURLTest() {} +@@ -78,7 +79,14 @@ + "geturlredirectnotify")) { + handle_url_redirects_ = true; + } +- return PluginTest::New(mode, argc, argn, argv, saved); ++ ++ NPError error = PluginTest::New(mode, argc, argn, argv, saved); ++ ++ // The above sets test_name(). ++ if (test_name() == "cookies") ++ check_cookies_ = true; ++ ++ return error; + } + + NPError PluginGetURLTest::SetWindow(NPWindow* pNPWindow) { +@@ -108,6 +116,13 @@ + id(), REDIRECT_SRC_URL, NULL, + reinterpret_cast<void*>(REDIRECT_SRC_URL_NOTIFICATION_ID)); + return NPERR_NO_ERROR; ++ } else if (check_cookies_) { ++ HostFunctions()->geturlnotify( ++ id(), ++ "plugin_ref_target_page.html", ++ NULL, ++ reinterpret_cast<void*>(SELF_URL_STREAM_ID)); ++ return NPERR_NO_ERROR; + } + + std::string url = SELF_URL; +@@ -161,7 +176,7 @@ + return NPERR_NO_ERROR; + } + +- if (!fail_write_url_.empty()) { ++ if (!fail_write_url_.empty() || check_cookies_) { + return NPERR_NO_ERROR; + } + +@@ -217,7 +232,7 @@ + return PluginTest::WriteReady(stream); + } + +- if (!referrer_target_url_.empty()) { ++ if (!referrer_target_url_.empty() || check_cookies_) { + return STREAM_CHUNK; + } + +@@ -242,7 +257,7 @@ + return -1; + } + +- if (!referrer_target_url_.empty()) { ++ if (!referrer_target_url_.empty() || check_cookies_) { + return len; + } + +@@ -314,6 +329,11 @@ + return NPERR_NO_ERROR; + } + ++ if (check_cookies_) { ++ SignalTestCompleted(); ++ return NPERR_NO_ERROR; ++ } ++ + unsigned long stream_id = + reinterpret_cast<unsigned long>(stream->notifyData); + switch (stream_id) { +@@ -367,6 +387,9 @@ + return; + } + ++ if (check_cookies_) ++ return; ++ + COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(data), cast_validity_check); + unsigned long stream_id = reinterpret_cast<unsigned long>(data); + switch (stream_id) { +Index: content/test/plugin/plugin_geturl_test.h +=================================================================== +--- content/test/plugin/plugin_geturl_test.h (revision 233522) ++++ content/test/plugin/plugin_geturl_test.h (working copy) +@@ -57,6 +57,7 @@ + std::string page_not_found_url_; + std::string fail_write_url_; + std::string referrer_target_url_; ++ bool check_cookies_; + }; + + } // namespace NPAPIClient +Index: content/test/plugin/plugin_test_factory.cc +=================================================================== +--- content/test/plugin/plugin_test_factory.cc (revision 233522) ++++ content/test/plugin/plugin_test_factory.cc (working copy) +@@ -38,7 +38,8 @@ + } else if (test_name == "geturl" || test_name == "geturl_404_response" || + test_name == "geturl_fail_write" || + test_name == "plugin_referrer_test" || +- test_name == "geturlredirectnotify") { ++ test_name == "geturlredirectnotify" || ++ test_name == "cookies") { + new_test = new PluginGetURLTest(instance, host_functions); + } else if (test_name == "npobject_identity") { + new_test = new NPObjectIdentityTest(instance, host_functions); Added: chromium-31.0.1650.48-NPN_URLRedirectResponse.patch =================================================================== --- chromium-31.0.1650.48-NPN_URLRedirectResponse.patch (rev 0) +++ chromium-31.0.1650.48-NPN_URLRedirectResponse.patch 2013-11-13 23:41:00 UTC (rev 199519) @@ -0,0 +1,13 @@ +Index: content/child/npapi/plugin_url_fetcher.cc +=================================================================== +--- content/child/npapi/plugin_url_fetcher.cc (revision 233351) ++++ content/child/npapi/plugin_url_fetcher.cc (working copy) +@@ -145,7 +145,7 @@ + + void PluginURLFetcher::URLRedirectResponse(bool allow) { + if (allow) { +- bridge_->SetDefersLoading(true); ++ bridge_->SetDefersLoading(false); + } else { + bridge_->Cancel(); + plugin_stream_->DidFail(resource_id_); // That will delete |this|.
