mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef: Update due to underlying chromium changes.
- Modifications due to WebFrame moving from webkit/glue to webkit/api - Remove the ATL dependency from browser_drag_delegate.cc - Use scoped_refptr instead of scoped_ptr for BrowserWebViewDelegate pointers in CefBrowserImpl. - Allow cancellation of redirects before they're sent in browser_resource_loader_bridge.cc - Enable remote fonts, local storage and session storage in context.cc - Add vsprops files to the libcef project that used to exist in the webkit/build directory git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@34 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -44,7 +44,6 @@
|
||||
#include "base/timer.h"
|
||||
#include "base/thread.h"
|
||||
#include "base/waitable_event.h"
|
||||
#include "net/base/cookie_monster.h"
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "net/base/net_errors.h"
|
||||
@@ -54,9 +53,9 @@
|
||||
#include "net/http/http_util.h"
|
||||
#include "net/proxy/proxy_service.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
#include "webkit/api/public/WebFrame.h"
|
||||
#include "webkit/glue/resource_loader_bridge.h"
|
||||
#include "webkit/glue/webappcachecontext.h"
|
||||
#include "webkit/glue/webframe.h"
|
||||
#include "webkit/glue/webview.h"
|
||||
|
||||
using webkit_glue::ResourceLoaderBridge;
|
||||
@@ -167,9 +166,14 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
peer_->OnUploadProgress(position, size);
|
||||
}
|
||||
|
||||
void NotifyReceivedRedirect(const GURL& new_url) {
|
||||
if (peer_)
|
||||
peer_->OnReceivedRedirect(new_url);
|
||||
void NotifyReceivedRedirect(const GURL& new_url,
|
||||
const ResourceLoaderBridge::ResponseInfo& info) {
|
||||
if (peer_ && peer_->OnReceivedRedirect(new_url, info)) {
|
||||
io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
this, &RequestProxy::AsyncFollowDeferredRedirect));
|
||||
} else {
|
||||
Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyReceivedResponse(const ResourceLoaderBridge::ResponseInfo& info,
|
||||
@@ -268,7 +272,9 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
} else if(!redirectUrl.empty()) {
|
||||
// redirect to the specified URL
|
||||
params->url = GURL(WideToUTF8(redirectUrl));
|
||||
OnReceivedRedirect(params->url);
|
||||
ResourceLoaderBridge::ResponseInfo info;
|
||||
bool defer_redirect;
|
||||
OnReceivedRedirect(params->url, info, &defer_redirect);
|
||||
} else if(resourceStream.get()) {
|
||||
// load from the provided resource stream
|
||||
handled = true;
|
||||
@@ -320,6 +326,14 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
Done();
|
||||
}
|
||||
|
||||
void AsyncFollowDeferredRedirect() {
|
||||
// This can be null in cases where the request is already done.
|
||||
if (!request_.get())
|
||||
return;
|
||||
|
||||
request_->FollowDeferredRedirect();
|
||||
}
|
||||
|
||||
void AsyncReadData() {
|
||||
if(resource_stream_.get()) {
|
||||
// Read from the handler-provided resource stream
|
||||
@@ -353,9 +367,13 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
// callbacks) that run on the IO thread. They are designed to be overridden
|
||||
// by the SyncRequestProxy subclass.
|
||||
|
||||
virtual void OnReceivedRedirect(const GURL& new_url) {
|
||||
virtual void OnReceivedRedirect(
|
||||
const GURL& new_url,
|
||||
const ResourceLoaderBridge::ResponseInfo& info,
|
||||
bool* defer_redirect) {
|
||||
*defer_redirect = true; // See AsyncFollowDeferredRedirect
|
||||
owner_loop_->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
this, &RequestProxy::NotifyReceivedRedirect, new_url));
|
||||
this, &RequestProxy::NotifyReceivedRedirect, new_url, info));
|
||||
}
|
||||
|
||||
virtual void OnReceivedResponse(
|
||||
@@ -383,18 +401,15 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
const GURL& new_url,
|
||||
bool* defer_redirect) {
|
||||
DCHECK(request->status().is_success());
|
||||
OnReceivedRedirect(new_url);
|
||||
ResourceLoaderBridge::ResponseInfo info;
|
||||
PopulateResponseInfo(request, &info);
|
||||
OnReceivedRedirect(new_url, info, defer_redirect);
|
||||
}
|
||||
|
||||
virtual void OnResponseStarted(URLRequest* request) {
|
||||
if (request->status().is_success()) {
|
||||
ResourceLoaderBridge::ResponseInfo info;
|
||||
info.request_time = request->request_time();
|
||||
info.response_time = request->response_time();
|
||||
info.headers = request->response_headers();
|
||||
info.app_cache_id = WebAppCacheContext::kNoAppCacheId;
|
||||
request->GetMimeType(&info.mime_type);
|
||||
request->GetCharset(&info.charset);
|
||||
PopulateResponseInfo(request, &info);
|
||||
OnReceivedResponse(info, false);
|
||||
AsyncReadData(); // start reading
|
||||
} else {
|
||||
@@ -466,6 +481,17 @@ class RequestProxy : public URLRequest::Delegate,
|
||||
}
|
||||
}
|
||||
|
||||
void PopulateResponseInfo(URLRequest* request,
|
||||
ResourceLoaderBridge::ResponseInfo* info) const {
|
||||
info->request_time = request->request_time();
|
||||
info->response_time = request->response_time();
|
||||
info->headers = request->response_headers();
|
||||
info->app_cache_id = WebAppCacheContext::kNoAppCacheId;
|
||||
request->GetMimeType(&info->mime_type);
|
||||
request->GetCharset(&info->charset);
|
||||
info->content_length = request->GetExpectedContentSize();
|
||||
}
|
||||
|
||||
scoped_ptr<URLRequest> request_;
|
||||
CefRefPtr<CefStreamReader> resource_stream_;
|
||||
|
||||
@@ -509,7 +535,18 @@ class SyncRequestProxy : public RequestProxy {
|
||||
// --------------------------------------------------------------------------
|
||||
// Event hooks that run on the IO thread:
|
||||
|
||||
virtual void OnReceivedRedirect(const GURL& new_url) {
|
||||
virtual void OnReceivedRedirect(
|
||||
const GURL& new_url,
|
||||
const ResourceLoaderBridge::ResponseInfo& info,
|
||||
bool* defer_redirect) {
|
||||
// TODO(darin): It would be much better if this could live in WebCore, but
|
||||
// doing so requires API changes at all levels. Similar code exists in
|
||||
// WebCore/platform/network/cf/ResourceHandleCFNet.cpp :-(
|
||||
if (new_url.GetOrigin() != result_->url.GetOrigin()) {
|
||||
DLOG(WARNING) << "Cross origin redirect denied";
|
||||
Cancel();
|
||||
return;
|
||||
}
|
||||
result_->url = new_url;
|
||||
}
|
||||
|
||||
@@ -711,7 +748,7 @@ bool FindProxyForUrl(const GURL& url, std::string* proxy_list) {
|
||||
request_context->proxy_service()));
|
||||
|
||||
net::ProxyInfo proxy_info;
|
||||
int rv = sync_proxy_service->ResolveProxy(url, &proxy_info);
|
||||
int rv = sync_proxy_service->ResolveProxy(NULL, url, &proxy_info);
|
||||
if (rv == net::OK) {
|
||||
*proxy_list = proxy_info.ToPacString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user