mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 173683.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@981 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -323,11 +323,9 @@ CefRefPtr<CefBrowserHostImpl> 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<CefBrowserHostImpl> 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.
|
||||
|
@@ -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() {
|
||||
|
@@ -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.
|
||||
|
@@ -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,
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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<net::UploadElement> element)
|
||||
: net::UploadBytesElementReader(element->bytes(),
|
||||
element->bytes_length()),
|
||||
element_(element.Pass()) {
|
||||
DCHECK_EQ(net::UploadElement::TYPE_BYTES, element_->type());
|
||||
}
|
||||
|
||||
virtual ~BytesElementReader() {}
|
||||
|
||||
private:
|
||||
scoped_ptr<net::UploadElement> 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<net::UploadElement> 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<net::UploadElement> 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<CefPostDataImpl*>(postdata_.get())->Get(*upload);
|
||||
request->set_upload(upload);
|
||||
request->set_upload(
|
||||
make_scoped_ptr(static_cast<CefPostDataImpl*>(postdata_.get())->Get()));
|
||||
} else if (request->get_upload()) {
|
||||
request->set_upload(NULL);
|
||||
request->set_upload(scoped_ptr<net::UploadDataStream>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,6 +495,19 @@ void CefPostDataImpl::Get(net::UploadData& data) {
|
||||
data.swap_elements(&data_elements);
|
||||
}
|
||||
|
||||
net::UploadDataStream* CefPostDataImpl::Get() {
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
ScopedVector<net::UploadElementReader> element_readers;
|
||||
ElementVector::const_iterator it = elements_.begin();
|
||||
for (; it != elements_.end(); ++it) {
|
||||
element_readers.push_back(
|
||||
static_cast<CefPostDataElementImpl*>(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<char*>(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();
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<script>
|
||||
function onLoad() {
|
||||
var tabs_list_request = new XMLHttpRequest();
|
||||
tabs_list_request.open("GET", "/json" + new Date().getTime(), true);
|
||||
tabs_list_request.open("GET", "/json/list?t=" + new Date().getTime(), true);
|
||||
tabs_list_request.onreadystatechange = onReady;
|
||||
tabs_list_request.send();
|
||||
}
|
||||
|
Reference in New Issue
Block a user