diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index d3a7e7d79..6f8fdef8c 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '157509', + 'chromium_revision': '160122', } diff --git a/cef.gyp b/cef.gyp index 72b680ce2..6c696e2c7 100644 --- a/cef.gyp +++ b/cef.gyp @@ -852,6 +852,7 @@ 'libcef/browser/zip_reader_impl.h', 'libcef/common/cef_message_generator.cc', 'libcef/common/cef_message_generator.h', + 'libcef/common/cef_messages.cc', 'libcef/common/cef_messages.h', 'libcef/common/cef_switches.cc', 'libcef/common/cef_switches.h', diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index dbf573ce4..465ba4337 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -270,10 +270,6 @@ content::SpeechRecognitionPreferences* return speech_recognition_preferences_.get(); } -bool CefBrowserContext::DidLastSessionExitCleanly() { - return true; -} - quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() { return NULL; } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index a9e446263..b4601d0ae 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -45,7 +45,6 @@ class CefBrowserContext : public content::BrowserContext { GetGeolocationPermissionContext() OVERRIDE; virtual content::SpeechRecognitionPreferences* GetSpeechRecognitionPreferences() OVERRIDE; - virtual bool DidLastSessionExitCleanly() OVERRIDE; virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; private: diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index 18074fbc8..d09cd5727 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -73,9 +73,7 @@ void CefBrowserMainParts::PreMainMessageLoopRun() { command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); int port; if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { - devtools_delegate_ = new CefDevToolsDelegate( - port, - browser_context_->GetRequestContext()); + devtools_delegate_ = new CefDevToolsDelegate(port); } else { DLOG(WARNING) << "Invalid http debugger port number " << port; } diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index 51da7b52c..a2fc7e4d2 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -349,7 +349,7 @@ bool CefCookieManagerImpl::GetCefCookie(const GURL& url, std::string cookie_path = net::CanonicalCookie::CanonPath(url, pc); base::Time creation_time = base::Time::Now(); base::Time cookie_expires = - net::CanonicalCookie::CanonExpiration(pc, creation_time, creation_time); + net::CanonicalCookie::CanonExpiration(pc, creation_time); CefString(&cookie.name).FromString(pc.Name()); CefString(&cookie.value).FromString(pc.Value()); diff --git a/libcef/browser/devtools_delegate.cc b/libcef/browser/devtools_delegate.cc index 86a7dd6f1..0afb746f0 100644 --- a/libcef/browser/devtools_delegate.cc +++ b/libcef/browser/devtools_delegate.cc @@ -21,7 +21,6 @@ #include "content/public/common/content_switches.h" #include "grit/cef_resources.h" #include "net/base/tcp_listen_socket.h" -#include "net/url_request/url_request_context_getter.h" #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" @@ -93,13 +92,10 @@ class CefDevToolsBindingHandler } // namespace -CefDevToolsDelegate::CefDevToolsDelegate( - int port, - net::URLRequestContextGetter* context_getter) { +CefDevToolsDelegate::CefDevToolsDelegate(int port) { devtools_http_handler_ = content::DevToolsHttpHandler::Start( new net::TCPListenSocketFactory("127.0.0.1", port), "", - context_getter, this); binding_.reset(new CefDevToolsBindingHandler()); @@ -120,11 +116,15 @@ std::string CefDevToolsDelegate::GetDiscoveryPageHTML() { } bool CefDevToolsDelegate::BundlesFrontendResources() { - return false; + return true; } -std::string CefDevToolsDelegate::GetFrontendResourcesBaseURL() { - return kChromeDevToolsURL; +FilePath CefDevToolsDelegate::GetDebugFrontendDir() { + return FilePath(); +} + +std::string CefDevToolsDelegate::GetPageThumbnailData(const GURL& url) { + return std::string(); } std::string CefDevToolsDelegate::GetDevToolsURL(content::RenderViewHost* rvh, diff --git a/libcef/browser/devtools_delegate.h b/libcef/browser/devtools_delegate.h index f51f46d09..3286847f7 100644 --- a/libcef/browser/devtools_delegate.h +++ b/libcef/browser/devtools_delegate.h @@ -14,17 +14,13 @@ #include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/devtools_http_handler_delegate.h" -namespace net { -class URLRequestContextGetter; -} - namespace content { class RenderViewHost; } class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate { public: - CefDevToolsDelegate(int port, net::URLRequestContextGetter* context_getter); + explicit CefDevToolsDelegate(int port); virtual ~CefDevToolsDelegate(); // Stops http server. @@ -33,7 +29,8 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate { // DevToolsHttpProtocolHandler::Delegate overrides. virtual std::string GetDiscoveryPageHTML() OVERRIDE; virtual bool BundlesFrontendResources() OVERRIDE; - virtual std::string GetFrontendResourcesBaseURL() OVERRIDE; + virtual FilePath GetDebugFrontendDir() OVERRIDE; + virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE; // Returns the DevTools URL for the specified RenderViewHost. std::string GetDevToolsURL(content::RenderViewHost* rvh, bool http_scheme); diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index b4052fbb1..f65b37adf 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -131,8 +131,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { if (!manager) return; - DownloadItem* item = manager->GetActiveDownloadItem(download_id); - if (!item) + DownloadItem* item = manager->GetDownload(download_id); + if (!item || !item->IsInProgress()) return; FilePath result; @@ -182,8 +182,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { scoped_refptr manager = GetDownloadManager(); if (manager) { - content::DownloadItem* item = - manager->GetActiveDownloadItem(download_id_); + DownloadItem* item = manager->GetDownload(download_id_); if (item && item->IsInProgress()) item->Cancel(true); } diff --git a/libcef/common/cef_messages.cc b/libcef/common/cef_messages.cc new file mode 100644 index 000000000..0cdba623b --- /dev/null +++ b/libcef/common/cef_messages.cc @@ -0,0 +1,116 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "libcef/common/cef_messages.h" + +namespace IPC { + +// Extracted from chrome/common/automation_messages.cc. + +// Only the net::UploadData ParamTraits<> definition needs this definition, so +// keep this in the implementation file so we can forward declare UploadData in +// the header. +template <> +struct ParamTraits { + typedef net::UploadElement param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, static_cast(p.type())); + switch (p.type()) { + case net::UploadElement::TYPE_BYTES: { + m->WriteData(p.bytes(), static_cast(p.bytes_length())); + break; + } + default: { + DCHECK(p.type() == net::UploadElement::TYPE_FILE); + WriteParam(m, p.file_path()); + WriteParam(m, p.file_range_offset()); + WriteParam(m, p.file_range_length()); + WriteParam(m, p.expected_file_modification_time()); + break; + } + } + } + static bool Read(const Message* m, PickleIterator* iter, param_type* r) { + int type; + if (!ReadParam(m, iter, &type)) + return false; + switch (type) { + case net::UploadElement::TYPE_BYTES: { + const char* data; + int len; + if (!m->ReadData(iter, &data, &len)) + return false; + r->SetToBytes(data, len); + break; + } + default: { + DCHECK(type == net::UploadElement::TYPE_FILE); + FilePath file_path; + uint64 offset, length; + base::Time expected_modification_time; + if (!ReadParam(m, iter, &file_path)) + return false; + if (!ReadParam(m, iter, &offset)) + return false; + if (!ReadParam(m, iter, &length)) + return false; + if (!ReadParam(m, iter, &expected_modification_time)) + return false; + r->SetToFilePathRange(file_path, offset, length, + expected_modification_time); + break; + } + } + return true; + } + static void Log(const param_type& p, std::string* l) { + l->append(""); + } +}; + +void ParamTraits >::Write(Message* m, + const param_type& p) { + WriteParam(m, p.get() != NULL); + if (p) { + WriteParam(m, *p->elements()); + WriteParam(m, p->identifier()); + WriteParam(m, p->is_chunked()); + WriteParam(m, p->last_chunk_appended()); + } +} + +bool ParamTraits >::Read(const Message* m, + PickleIterator* iter, + param_type* r) { + bool has_object; + if (!ReadParam(m, iter, &has_object)) + return false; + if (!has_object) + return true; + std::vector elements; + if (!ReadParam(m, iter, &elements)) + return false; + int64 identifier; + if (!ReadParam(m, iter, &identifier)) + return false; + bool is_chunked = false; + if (!ReadParam(m, iter, &is_chunked)) + return false; + bool last_chunk_appended = false; + if (!ReadParam(m, iter, &last_chunk_appended)) + return false; + *r = new net::UploadData; + (*r)->swap_elements(&elements); + (*r)->set_identifier(identifier); + (*r)->set_is_chunked(is_chunked); + (*r)->set_last_chunk_appended(last_chunk_appended); + return true; +} + +void ParamTraits >::Log(const param_type& p, + std::string* l) { + l->append(""); +} + +} // namespace IPC diff --git a/libcef/common/cef_messages.h b/libcef/common/cef_messages.h index ef1455a89..f89b502aa 100644 --- a/libcef/common/cef_messages.h +++ b/libcef/common/cef_messages.h @@ -169,3 +169,23 @@ IPC_MESSAGE_ROUTED1(CefHostMsg_Response, // has been processed. IPC_MESSAGE_ROUTED1(CefHostMsg_ResponseAck, int /* request_id */) + + +// Singly-included section for struct and custom IPC traits. +#ifndef CEF_LIBCEF_COMMON_CEF_MESSAGES_H_ +#define CEF_LIBCEF_COMMON_CEF_MESSAGES_H_ + +namespace IPC { + +// Extracted from chrome/common/automation_messages.h. +template <> +struct ParamTraits > { + typedef scoped_refptr param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, PickleIterator* iter, param_type* r); + static void Log(const param_type& p, std::string* l); +}; + +} // namespace IPC + +#endif // CEF_LIBCEF_COMMON_CEF_MESSAGES_H_ diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index e64c05b90..51516d2cf 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -225,7 +225,7 @@ void CefBrowserImpl::GetFrameNames(std::vector& names) { if (main_frame) { WebFrame* cur = main_frame; do { - names.push_back(CefString(cur->name().utf8())); + names.push_back(CefString(cur->uniqueName().utf8())); cur = cur->traverseNext(true); } while (cur != main_frame); } @@ -357,7 +357,7 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( int64 parent_id = frame->parent() == NULL ? kInvalidFrameId : frame->parent()->identifier(); - string16 name = frame->name(); + string16 name = frame->uniqueName(); // Notify the browser that the frame has been identified. Send(new CefHostMsg_FrameIdentified(routing_id(), frame_id, parent_id, name)); diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 3be3c7f59..95cbc5d98 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -196,7 +196,7 @@ CefString CefFrameImpl::GetName() { CEF_REQUIRE_RT_RETURN(name); if (frame_) - name = frame_->name(); + name = frame_->uniqueName(); return name; } diff --git a/patch/patches/tools_gyp.patch b/patch/patches/tools_gyp.patch index 71368ad84..525cf75d2 100644 --- a/patch/patches/tools_gyp.patch +++ b/patch/patches/tools_gyp.patch @@ -1,8 +1,8 @@ Index: pylib/gyp/input.py =================================================================== ---- pylib/gyp/input.py (revision 1501) +--- pylib/gyp/input.py (revision 1508) +++ pylib/gyp/input.py (working copy) -@@ -685,7 +685,8 @@ +@@ -824,7 +824,8 @@ # that don't load quickly, this can be faster than #