diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 2e8f0d5fa..954538a57 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': '170167', + 'chromium_revision': '173683', } diff --git a/LICENSE.txt b/LICENSE.txt index 52812e171..a5d84adab 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2012 Marshall A. Greenblatt. Portions Copyright (c) +// Copyright (c) 2008-2013 Marshall A. Greenblatt. Portions Copyright (c) // 2006-2009 Google Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/cef.gyp b/cef.gyp index 8962b6771..697e3f410 100644 --- a/cef.gyp +++ b/cef.gyp @@ -428,6 +428,7 @@ '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', '<(DEPTH)/third_party/zlib/zlib.gyp:minizip', + '<(DEPTH)/ui/gl/gl.gyp:gl', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', '<(DEPTH)/webkit/support/webkit_support.gyp:glue', @@ -779,6 +780,7 @@ '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', '<(DEPTH)/third_party/zlib/zlib.gyp:minizip', + '<(DEPTH)/ui/gl/gl.gyp:gl', '<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', '<(DEPTH)/webkit/support/webkit_support.gyp:glue', diff --git a/include/cef_trace_event.h b/include/cef_trace_event.h index e46b4f189..7fee2183f 100644 --- a/include/cef_trace_event.h +++ b/include/cef_trace_event.h @@ -184,13 +184,6 @@ CEF_EXPORT void cef_trace_event_end(const char* category, const char* arg2_name, uint64 arg2_val, int copy); -CEF_EXPORT void cef_trace_event_if_longer_than(int64 threshold_us, - const char* category, - const char* name, - const char* arg1_name, - uint64 arg1_val, - const char* arg2_name, - uint64 arg2_val); CEF_EXPORT void cef_trace_counter(const char* category, const char* name, const char* value1_name, @@ -312,25 +305,6 @@ CEF_EXPORT void cef_trace_event_async_end(const char* category, cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ arg2_val, true) -// Time threshold event: -// Only record the event if the duration is greater than the specified -// threshold_us (time in microseconds). -// Records a pair of begin and end events called "name" for the current -// scope, with 0, 1 or 2 associated arguments. If the category is not -// enabled, then this does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define CEF_TRACE_EVENT_IF_LONGER_THAN0(threshold_us, category, name) \ - cef_trace_event_if_longer_than(threshold_us, category, name, NULL, 0, NULL, 0) -#define CEF_TRACE_EVENT_IF_LONGER_THAN1(threshold_us, category, name, \ - arg1_name, arg1_val) \ - cef_trace_event_if_longer_than(threshold_us, category, name, arg1_name, \ - arg1_val, NULL, 0) -#define CEF_TRACE_EVENT_IF_LONGER_THAN2(threshold_us, category, name, \ - arg1_name, arg1_val, arg2_name, arg2_val) \ - cef_trace_event_if_longer_than(threshold_us, category, name, arg1_name, \ - arg1_val, arg2_name, arg2_val) - // Records the value of a counter called "name" immediately. Value // must be representable as a 32 bit integer. // - category and name strings must have application lifetime (statics or diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 0fe060e23..f7bdf15b7 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -323,11 +323,9 @@ CefRefPtr CefBrowserHostImpl::Create( DCHECK(opener == NULL || browser_info->is_popup()); if (web_contents == NULL) { - web_contents = content::WebContents::Create( - _Context->browser_context(), - NULL, - MSG_ROUTING_NONE, - NULL); + content::WebContents::CreateParams create_params( + _Context->browser_context()); + web_contents = content::WebContents::Create(create_params); } CefRefPtr browser = @@ -1614,11 +1612,9 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( const content::MediaResponseCallback& callback) { CEF_CURRENTLY_ON_UIT(); + // TODO(cef): Get the default devices for the request. See for example + // chrome/browser/media/media_stream_devices_controller.cc. content::MediaStreamDevices devices; - for (content::MediaStreamDeviceMap::const_iterator it = - request->devices.begin(); it != request->devices.end(); ++it) { - devices.push_back(*it->second.begin()); - } // TODO(cef): Give the user an opportunity to approve the device list or run // the callback with an empty device list to cancel the request. diff --git a/libcef/browser/resource_context.cc b/libcef/browser/resource_context.cc index 1bf0908d1..8f20cfc76 100644 --- a/libcef/browser/resource_context.cc +++ b/libcef/browser/resource_context.cc @@ -15,8 +15,9 @@ CefResourceContext::~CefResourceContext() { // Destroy the getter after content::ResourceContext has finished destructing. // Otherwise, the URLRequestContext objects will be deleted before // ResourceDispatcherHost has canceled any pending URLRequests. + getter_->AddRef(); content::BrowserThread::ReleaseSoon( - content::BrowserThread::IO, FROM_HERE, getter_.release()); + content::BrowserThread::IO, FROM_HERE, getter_.get()); } net::HostResolver* CefResourceContext::GetHostResolver() { diff --git a/libcef/browser/resource_dispatcher_host_delegate.h b/libcef/browser/resource_dispatcher_host_delegate.h index 4965cae5d..4e0e64270 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.h +++ b/libcef/browser/resource_dispatcher_host_delegate.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ #pragma once +#include "base/compiler_specific.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" // Implements ResourceDispatcherHostDelegate. diff --git a/libcef/browser/trace_impl.cc b/libcef/browser/trace_impl.cc index 01c70df3c..9da4a4172 100644 --- a/libcef/browser/trace_impl.cc +++ b/libcef/browser/trace_impl.cc @@ -188,29 +188,6 @@ CEF_EXPORT void cef_trace_event_end(const char* category, } } -CEF_EXPORT void cef_trace_event_if_longer_than(int64 threshold_us, - const char* category, - const char* name, - const char* arg1_name, - uint64 arg1_val, - const char* arg2_name, - uint64 arg2_val) { - DCHECK(category); - DCHECK(name); - if (!category || !name) - return; - - if (arg1_name == NULL && arg2_name == NULL) { - TRACE_EVENT_IF_LONGER_THAN0(threshold_us, category, name); - } else if (arg2_name == NULL) { - TRACE_EVENT_IF_LONGER_THAN1(threshold_us, category, name, - arg1_name, arg1_val); - } else { - TRACE_EVENT_IF_LONGER_THAN2(threshold_us, category, name, arg1_name, - arg1_val, arg2_name, arg2_val); - } -} - CEF_EXPORT void cef_trace_counter(const char* category, const char* name, const char* value1_name, diff --git a/libcef/browser/web_contents_view_osr.cc b/libcef/browser/web_contents_view_osr.cc index 7c900c2bf..8e886cbec 100644 --- a/libcef/browser/web_contents_view_osr.cc +++ b/libcef/browser/web_contents_view_osr.cc @@ -21,7 +21,8 @@ CefWebContentsViewOSR::~CefWebContentsViewOSR() { // Overridden from WebContentsView: -void CefWebContentsViewOSR::CreateView(const gfx::Size& initial_size) { +void CefWebContentsViewOSR::CreateView(const gfx::Size& initial_size, + gfx::NativeView context) { } content::RenderWidgetHostView* CefWebContentsViewOSR::CreateViewForWidget( @@ -40,10 +41,6 @@ content::RenderWidgetHostView* CefWebContentsViewOSR::CreateViewForPopupWidget( return popup_widget; } -void CefWebContentsViewOSR::SetView(content::RenderWidgetHostView* view) { - view_ = view; -} - gfx::NativeView CefWebContentsViewOSR::GetNativeView() const { return gfx::NativeView(); } diff --git a/libcef/browser/web_contents_view_osr.h b/libcef/browser/web_contents_view_osr.h index fcfb26069..d5e3e52dd 100644 --- a/libcef/browser/web_contents_view_osr.h +++ b/libcef/browser/web_contents_view_osr.h @@ -27,12 +27,12 @@ class CefWebContentsViewOSR : public content::WebContentsView, virtual ~CefWebContentsViewOSR(); // WebContentsView methods. - virtual void CreateView(const gfx::Size& initial_size) OVERRIDE; + virtual void CreateView(const gfx::Size& initial_size, + gfx::NativeView context) OVERRIDE; virtual content::RenderWidgetHostView* CreateViewForWidget( content::RenderWidgetHost* render_widget_host) OVERRIDE; virtual content::RenderWidgetHostView* CreateViewForPopupWidget( content::RenderWidgetHost* render_widget_host); - virtual void SetView(content::RenderWidgetHostView* view) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; virtual gfx::NativeView GetContentNativeView() const OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index b7cc365c1..3a3e7f33f 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -22,6 +22,51 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.h" +namespace { + +// A subclass of net::UploadBytesElementReader that keeps the associated +// UploadElement alive until the request completes. +class BytesElementReader : public net::UploadBytesElementReader { + public: + explicit BytesElementReader(scoped_ptr element) + : net::UploadBytesElementReader(element->bytes(), + element->bytes_length()), + element_(element.Pass()) { + DCHECK_EQ(net::UploadElement::TYPE_BYTES, element_->type()); + } + + virtual ~BytesElementReader() {} + + private: + scoped_ptr element_; + + DISALLOW_COPY_AND_ASSIGN(BytesElementReader); +}; + +// A subclass of net::UploadFileElementReader that keeps the associated +// UploadElement alive until the request completes. +class FileElementReader : public net::UploadFileElementReader { + public: + explicit FileElementReader(scoped_ptr element) + : net::UploadFileElementReader( + element->file_path(), + element->file_range_offset(), + element->file_range_length(), + element->expected_file_modification_time()), + element_(element.Pass()) { + DCHECK_EQ(net::UploadElement::TYPE_FILE, element_->type()); + } + + virtual ~FileElementReader() {} + + private: + scoped_ptr element_; + + DISALLOW_COPY_AND_ASSIGN(FileElementReader); +}; + +} // namespace + #define CHECK_READONLY_RETURN(val) \ if (read_only_) { \ @@ -194,11 +239,10 @@ void CefRequestImpl::Get(net::URLRequest* request) { request->SetExtraRequestHeaders(headers); if (postdata_.get()) { - net::UploadData* upload = new net::UploadData(); - static_cast(postdata_.get())->Get(*upload); - request->set_upload(upload); + request->set_upload( + make_scoped_ptr(static_cast(postdata_.get())->Get())); } else if (request->get_upload()) { - request->set_upload(NULL); + request->set_upload(scoped_ptr()); } } @@ -451,6 +495,19 @@ void CefPostDataImpl::Get(net::UploadData& data) { data.swap_elements(&data_elements); } +net::UploadDataStream* CefPostDataImpl::Get() { + AutoLock lock_scope(this); + + ScopedVector element_readers; + ElementVector::const_iterator it = elements_.begin(); + for (; it != elements_.end(); ++it) { + element_readers.push_back( + static_cast(it->get())->Get()); + } + + return new net::UploadDataStream(&element_readers, 0); +} + void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) { AutoLock lock_scope(this); CHECK_READONLY_RETURN_VOID(); @@ -644,6 +701,25 @@ void CefPostDataElementImpl::Get(net::UploadElement& element) { } } +net::UploadElementReader* CefPostDataElementImpl::Get() { + AutoLock lock_scope(this); + + if (type_ == PDE_TYPE_BYTES) { + net::UploadElement* element = new net::UploadElement(); + element->SetToBytes(static_cast(data_.bytes.bytes), + data_.bytes.size); + return new BytesElementReader(make_scoped_ptr(element)); + } else if (type_ == PDE_TYPE_FILE) { + net::UploadElement* element = new net::UploadElement(); + FilePath path = FilePath(CefString(&data_.filename)); + element->SetToFilePath(path); + return new FileElementReader(make_scoped_ptr(element)); + } else { + NOTREACHED(); + return NULL; + } +} + void CefPostDataElementImpl::Set(const WebKit::WebHTTPBody::Element& element) { AutoLock lock_scope(this); CHECK_READONLY_RETURN_VOID(); diff --git a/libcef/common/request_impl.h b/libcef/common/request_impl.h index 309c208f7..c9ad15295 100644 --- a/libcef/common/request_impl.h +++ b/libcef/common/request_impl.h @@ -100,6 +100,7 @@ class CefPostDataImpl : public CefPostData { void Set(const net::UploadData& data); void Set(const net::UploadDataStream& data_stream); void Get(net::UploadData& data); + net::UploadDataStream* Get(); void Set(const WebKit::WebHTTPBody& data); void Get(WebKit::WebHTTPBody& data); @@ -135,6 +136,7 @@ class CefPostDataElementImpl : public CefPostDataElement { void Set(const net::UploadElement& element); void Set(const net::UploadElementReader& element_reader); void Get(net::UploadElement& element); + net::UploadElementReader* Get(); void Set(const WebKit::WebHTTPBody::Element& element); void Get(WebKit::WebHTTPBody::Element& element); diff --git a/libcef/resources/devtools_discovery_page.html b/libcef/resources/devtools_discovery_page.html index f7abd383e..87933d1af 100644 --- a/libcef/resources/devtools_discovery_page.html +++ b/libcef/resources/devtools_discovery_page.html @@ -7,7 +7,7 @@