Update to Chromium revision 170167.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@932 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
4a3b1ec9e2
commit
f53c281acd
|
@ -17,5 +17,5 @@
|
|||
|
||||
{
|
||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||
'chromium_revision': '167921',
|
||||
'chromium_revision': '170167',
|
||||
}
|
||||
|
|
|
@ -766,6 +766,8 @@
|
|||
'<(DEPTH)/content/browser/geolocation/wifi_data_provider_common.cc',
|
||||
'<(DEPTH)/content/common/net/url_fetcher.cc',
|
||||
'<(DEPTH)/content/common/net/url_request_user_data.cc',
|
||||
'<(DEPTH)/content/public/browser/content_browser_client.cc',
|
||||
'<(DEPTH)/content/public/common/content_client.cc',
|
||||
'<(DEPTH)/content/public/common/geoposition.cc',
|
||||
'<(DEPTH)/google_apis/google_api_keys.cc',
|
||||
],
|
||||
|
|
|
@ -166,7 +166,7 @@ void BrowserDomStorageSystem::AreaImpl::setItem(
|
|||
if (!Host())
|
||||
return;
|
||||
|
||||
AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
base::AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
NullableString16 unused;
|
||||
if (!Host()->SetAreaItem(connection_id_, key, newValue, pageUrl,
|
||||
&unused))
|
||||
|
@ -180,7 +180,7 @@ void BrowserDomStorageSystem::AreaImpl::removeItem(
|
|||
if (!Host())
|
||||
return;
|
||||
|
||||
AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
base::AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
string16 notused;
|
||||
Host()->RemoveAreaItem(connection_id_, key, pageUrl, ¬used);
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ void BrowserDomStorageSystem::AreaImpl::clear(const WebURL& pageUrl) {
|
|||
if (!Host())
|
||||
return;
|
||||
|
||||
AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
base::AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
|
||||
Host()->ClearArea(connection_id_, pageUrl);
|
||||
}
|
||||
|
||||
|
|
|
@ -180,10 +180,13 @@ class RequestInterceptor : public net::URLRequest::Interceptor {
|
|||
handler->OnResourceRedirect(browser, request->url().spec(), newUrlStr);
|
||||
if (newUrlStr != location.spec()) {
|
||||
GURL new_url = GURL(std::string(newUrlStr));
|
||||
if (!new_url.is_empty() && new_url.is_valid())
|
||||
return new net::URLRequestRedirectJob(request,
|
||||
network_delegate,
|
||||
new_url);
|
||||
if (!new_url.is_empty() && new_url.is_valid()) {
|
||||
return new net::URLRequestRedirectJob(
|
||||
request,
|
||||
network_delegate,
|
||||
new_url,
|
||||
net::URLRequestRedirectJob::REDIRECT_302_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -597,7 +600,8 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||
headers.AddHeadersFromString(params->headers);
|
||||
request_->SetExtraRequestHeaders(headers);
|
||||
request_->set_load_flags(params->load_flags);
|
||||
request_->set_upload(upload_data);
|
||||
if (upload_data)
|
||||
request_->set_upload(upload_data);
|
||||
request_->SetUserData(kCefUserData,
|
||||
new ExtraRequestInfo(browser_.get(), params->request_type));
|
||||
BrowserAppCacheSystem::SetExtraRequestInfo(
|
||||
|
@ -610,8 +614,8 @@ class RequestProxy : public net::URLRequest::Delegate,
|
|||
downloaded_file_ = ShareableFileReference::GetOrCreate(
|
||||
path, ShareableFileReference::DELETE_ON_FINAL_RELEASE,
|
||||
base::MessageLoopProxy::current());
|
||||
file_stream_.reset(new net::FileStream(NULL));
|
||||
file_stream_->OpenSync(
|
||||
file_stream_.reset(new net::FileStream(NULL));
|
||||
file_stream_->OpenSync(
|
||||
path, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "libcef/browser_webcookiejar_impl.h"
|
||||
#include "libcef/simple_clipboard_impl.h"
|
||||
|
||||
#include "base/scoped_temp_dir.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h"
|
||||
#include "webkit/glue/simple_webmimeregistry_impl.h"
|
||||
#include "webkit/glue/webclipboard_impl.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "base/at_exit.h"
|
||||
#include "base/file_path.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/scoped_temp_dir.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
|
||||
class CefBrowserImpl;
|
||||
|
@ -121,7 +121,7 @@ class CefContext : public CefBase {
|
|||
CefSettings settings_;
|
||||
CefRefPtr<CefApp> application_;
|
||||
FilePath cache_path_;
|
||||
ScopedTempDir cache_temp_dir_;
|
||||
base::ScopedTempDir cache_temp_dir_;
|
||||
|
||||
BrowserRequestContext* request_context_;
|
||||
BrowserFileSystem file_system_;
|
||||
|
|
|
@ -10,12 +10,13 @@
|
|||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "content/browser/geolocation/arbitrator_dependency_factory.h"
|
||||
#include "content/browser/geolocation/geolocation_observer.h"
|
||||
#include "content/browser/geolocation/geolocation_provider.h"
|
||||
#include "content/browser/geolocation/location_provider.h"
|
||||
#include "content/public/browser/access_token_store.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "content/public/common/geoposition.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationPermissionRequest.h"
|
||||
|
@ -25,6 +26,7 @@
|
|||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationError.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
|
||||
#include "webkit/user_agent/user_agent.h"
|
||||
|
||||
using WebKit::WebGeolocationController;
|
||||
using WebKit::WebGeolocationError;
|
||||
|
@ -75,6 +77,26 @@ class CefAccessTokenStore : public content::AccessTokenStore {
|
|||
DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore);
|
||||
};
|
||||
|
||||
// Stub implementation of ContentClient.
|
||||
class CefContentClient : public content::ContentClient {
|
||||
public:
|
||||
CefContentClient() {}
|
||||
|
||||
virtual std::string GetUserAgent() const OVERRIDE {
|
||||
return webkit_glue::GetUserAgent(GURL());
|
||||
}
|
||||
};
|
||||
|
||||
// Stub implementation of ContentBrowserClient.
|
||||
class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
public:
|
||||
CefContentBrowserClient() {}
|
||||
|
||||
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE {
|
||||
return new CefAccessTokenStore();
|
||||
}
|
||||
};
|
||||
|
||||
void NotifyArbitratorPermissionGranted() {
|
||||
DCHECK(CefThread::CurrentlyOn(CefThread::IO));
|
||||
content::GeolocationProvider::GetInstance()->OnPermissionGranted();
|
||||
|
@ -221,6 +243,15 @@ void CefGeolocationClient::cancelPermissionRequest(
|
|||
void CefGeolocationClient::OnStartUpdating(bool enable_high_accuracy) {
|
||||
DCHECK(CefThread::CurrentlyOn(CefThread::IO));
|
||||
|
||||
// GeolocationArbitrator uses ContentClient to retrieve the AccessTokenStore.
|
||||
// Simulate the necessary interfaces here.
|
||||
if (!content::GetContentClient()) {
|
||||
static CefContentClient content_client;
|
||||
static CefContentBrowserClient browser_client;
|
||||
content_client.set_browser_for_testing(&browser_client);
|
||||
content::SetContentClient(&content_client);
|
||||
}
|
||||
|
||||
if (!location_provider_)
|
||||
location_provider_ = content::GeolocationProvider::GetInstance();
|
||||
|
||||
|
@ -307,46 +338,6 @@ void CefGeolocationClient::OnPositionUpdated(
|
|||
}
|
||||
|
||||
|
||||
// Replacement for content/browser/geolocation/arbitrator_dependency_factory.cc
|
||||
|
||||
// GeolocationArbitratorDependencyFactory
|
||||
content::GeolocationArbitratorDependencyFactory::
|
||||
~GeolocationArbitratorDependencyFactory() {
|
||||
}
|
||||
|
||||
// DefaultGeolocationArbitratorDependencyFactory
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::
|
||||
~DefaultGeolocationArbitratorDependencyFactory() {
|
||||
}
|
||||
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::GetTimeNow
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::GetTimeFunction() {
|
||||
return base::Time::Now;
|
||||
}
|
||||
|
||||
content::AccessTokenStore*
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::NewAccessTokenStore() {
|
||||
return new CefAccessTokenStore;
|
||||
}
|
||||
|
||||
content::LocationProviderBase*
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::
|
||||
NewNetworkLocationProvider(
|
||||
content::AccessTokenStore* access_token_store,
|
||||
net::URLRequestContextGetter* context,
|
||||
const GURL& url,
|
||||
const string16& access_token) {
|
||||
return content::NewNetworkLocationProvider(access_token_store, context,
|
||||
url, access_token);
|
||||
}
|
||||
|
||||
content::LocationProviderBase*
|
||||
content::DefaultGeolocationArbitratorDependencyFactory::
|
||||
NewSystemLocationProvider() {
|
||||
return content::NewSystemLocationProvider();
|
||||
}
|
||||
|
||||
|
||||
// Extract from content/public/common/content_switches.cc.
|
||||
|
||||
namespace switches {
|
||||
|
|
|
@ -10,7 +10,14 @@
|
|||
#include "libcef/http_header_utils.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/base/upload_data_stream.h"
|
||||
#include "net/base/upload_element_reader.h"
|
||||
#include "net/base/upload_bytes_element_reader.h"
|
||||
#include "net/base/upload_file_element_reader.h"
|
||||
#include "net/http/http_request_headers.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
|
||||
|
||||
using WebKit::WebHTTPBody;
|
||||
using WebKit::WebString;
|
||||
|
@ -103,7 +110,7 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
|||
GetHeaderMap(headers, headermap_);
|
||||
|
||||
// Transfer post data, if any
|
||||
const net::UploadData* data = request->get_upload();
|
||||
const net::UploadDataStream* data = request->get_upload();
|
||||
if (data) {
|
||||
postdata_ = CefPostData::CreatePostData();
|
||||
static_cast<CefPostDataImpl*>(postdata_.get())->Set(*data);
|
||||
|
@ -305,6 +312,21 @@ void CefPostDataImpl::Set(const net::UploadData& data) {
|
|||
}
|
||||
}
|
||||
|
||||
void CefPostDataImpl::Set(const net::UploadDataStream& data_stream) {
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
CefRefPtr<CefPostDataElement> postelem;
|
||||
|
||||
const ScopedVector<net::UploadElementReader>& elements =
|
||||
data_stream.element_readers();
|
||||
ScopedVector<net::UploadElementReader>::const_iterator it = elements.begin();
|
||||
for (; it != elements.end(); ++it) {
|
||||
postelem = CefPostDataElement::CreatePostDataElement();
|
||||
static_cast<CefPostDataElementImpl*>(postelem.get())->Set(**it);
|
||||
AddElement(postelem);
|
||||
}
|
||||
}
|
||||
|
||||
void CefPostDataImpl::Get(net::UploadData& data) {
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
|
@ -448,6 +470,27 @@ void CefPostDataElementImpl::Set(const net::UploadElement& element) {
|
|||
}
|
||||
}
|
||||
|
||||
void CefPostDataElementImpl::Set(
|
||||
const net::UploadElementReader& element_reader) {
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
const net::UploadBytesElementReader* bytes_reader =
|
||||
element_reader.AsBytesReader();
|
||||
if (bytes_reader) {
|
||||
SetToBytes(bytes_reader->length(), bytes_reader->bytes());
|
||||
return;
|
||||
}
|
||||
|
||||
const net::UploadFileElementReader* file_reader =
|
||||
element_reader.AsFileReader();
|
||||
if (file_reader) {
|
||||
SetToFile(file_reader->path().value());
|
||||
return;
|
||||
}
|
||||
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
void CefPostDataElementImpl::Get(net::UploadElement& element) {
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
|
|
|
@ -7,15 +7,21 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/cef_request.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/http/http_request_headers.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
|
||||
|
||||
namespace net {
|
||||
class HttpRequestHeaders;
|
||||
class UploadData;
|
||||
class UploadDataStream;
|
||||
class UploadElement;
|
||||
class UploadElementReader;
|
||||
class URLRequest;
|
||||
};
|
||||
|
||||
namespace WebKit {
|
||||
class WebURLRequest;
|
||||
}
|
||||
|
||||
// Implementation of CefRequest
|
||||
class CefRequestImpl : public CefRequest {
|
||||
public:
|
||||
|
@ -77,6 +83,7 @@ class CefPostDataImpl : public CefPostData {
|
|||
virtual void RemoveElements();
|
||||
|
||||
void Set(const net::UploadData& data);
|
||||
void Set(const net::UploadDataStream& data_stream);
|
||||
void Get(net::UploadData& data);
|
||||
void Set(const WebKit::WebHTTPBody& data);
|
||||
void Get(WebKit::WebHTTPBody& data);
|
||||
|
@ -105,6 +112,7 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
|||
void* GetBytes() { return data_.bytes.bytes; }
|
||||
|
||||
void Set(const net::UploadElement& element);
|
||||
void Set(const net::UploadElementReader& element_reader);
|
||||
void Get(net::UploadElement& element);
|
||||
void Set(const WebKit::WebHTTPBody::Element& element);
|
||||
void Get(WebKit::WebHTTPBody::Element& element);
|
||||
|
|
|
@ -90,8 +90,10 @@ class CefV8TrackManager {
|
|||
|
||||
v8::Handle<v8::Object> object = context->Global();
|
||||
v8::Handle<v8::Value> value = object->GetHiddenValue(context_state_key_);
|
||||
if (!value.IsEmpty())
|
||||
return static_cast<CefV8ContextState*>(v8::External::Unwrap(value));
|
||||
if (!value.IsEmpty()) {
|
||||
return static_cast<CefV8ContextState*>(
|
||||
v8::External::Cast(*value)->Value());
|
||||
}
|
||||
|
||||
scoped_refptr<CefV8ContextState> state = new CefV8ContextState();
|
||||
object->SetHiddenValue(context_state_key_,
|
||||
|
@ -125,7 +127,7 @@ class CefV8TrackManager {
|
|||
return;
|
||||
|
||||
scoped_refptr<CefV8ContextState> state =
|
||||
static_cast<CefV8ContextState*>(v8::External::Unwrap(value));
|
||||
static_cast<CefV8ContextState*>(v8::External::Cast(*value)->Value());
|
||||
state->Detach();
|
||||
object->DeleteHiddenValue(context_state_key_);
|
||||
|
||||
|
@ -222,7 +224,7 @@ class V8TrackObject : public CefTrackNode {
|
|||
// Attach this track object to the specified V8 object.
|
||||
void AttachTo(v8::Handle<v8::Object> object) {
|
||||
object->SetHiddenValue(v8::String::New(kCefTrackObject),
|
||||
v8::External::Wrap(this));
|
||||
v8::External::New(this));
|
||||
}
|
||||
|
||||
// Retrieve the track object for the specified V8 object.
|
||||
|
@ -230,7 +232,7 @@ class V8TrackObject : public CefTrackNode {
|
|||
v8::Local<v8::Value> value =
|
||||
object->GetHiddenValue(v8::String::New(kCefTrackObject));
|
||||
if (!value.IsEmpty())
|
||||
return static_cast<V8TrackObject*>(v8::External::Unwrap(value));
|
||||
return static_cast<V8TrackObject*>(v8::External::Cast(*value)->Value());
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -399,7 +401,7 @@ v8::Handle<v8::Value> FunctionCallbackImpl(const v8::Arguments& args) {
|
|||
v8::HandleScope handle_scope;
|
||||
|
||||
CefV8Handler* handler =
|
||||
static_cast<CefV8Handler*>(v8::External::Unwrap(args.Data()));
|
||||
static_cast<CefV8Handler*>(v8::External::Cast(*args.Data())->Value());
|
||||
|
||||
CefV8ValueList params;
|
||||
for (int i = 0; i < args.Length(); i++)
|
||||
|
@ -506,7 +508,7 @@ class ExtensionWrapper : public v8::Extension {
|
|||
return v8::Handle<v8::FunctionTemplate>();
|
||||
|
||||
return v8::FunctionTemplate::New(FunctionCallbackImpl,
|
||||
v8::External::Wrap(handler_));
|
||||
v8::External::New(handler_));
|
||||
}
|
||||
|
||||
void UIT_RegisterExtension() {
|
||||
|
@ -987,7 +989,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
|
|||
// Create a new V8 function template.
|
||||
v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New();
|
||||
|
||||
v8::Local<v8::Value> data = v8::External::Wrap(handler.get());
|
||||
v8::Local<v8::Value> data = v8::External::New(handler.get());
|
||||
|
||||
// Set the function handler callback.
|
||||
tmpl->SetCallHandler(FunctionCallbackImpl, data);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "include/cef_scheme.h"
|
||||
#include "tests/unittests/test_handler.h"
|
||||
#include "tests/unittests/test_suite.h"
|
||||
#include "base/scoped_temp_dir.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
|
@ -379,7 +379,7 @@ void TestChangeDirectory(CefRefPtr<CefCookieManager> manager,
|
|||
base::WaitableEvent event(false, false);
|
||||
CefCookie cookie;
|
||||
|
||||
ScopedTempDir temp_dir;
|
||||
base::ScopedTempDir temp_dir;
|
||||
|
||||
// Create a new temporary directory.
|
||||
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
|
||||
|
@ -448,7 +448,7 @@ TEST(CookieTest, DomainCookieInMemory) {
|
|||
|
||||
// Test creation of a domain cookie.
|
||||
TEST(CookieTest, DomainCookieOnDisk) {
|
||||
ScopedTempDir temp_dir;
|
||||
base::ScopedTempDir temp_dir;
|
||||
|
||||
// Create a new temporary directory.
|
||||
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
|
||||
|
@ -479,7 +479,7 @@ TEST(CookieTest, HostCookieInMemory) {
|
|||
|
||||
// Test creation of a host cookie.
|
||||
TEST(CookieTest, HostCookieOnDisk) {
|
||||
ScopedTempDir temp_dir;
|
||||
base::ScopedTempDir temp_dir;
|
||||
|
||||
// Create a new temporary directory.
|
||||
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
|
||||
|
@ -510,7 +510,7 @@ TEST(CookieTest, MultipleCookiesInMemory) {
|
|||
|
||||
// Test creation of multiple cookies.
|
||||
TEST(CookieTest, MultipleCookiesOnDisk) {
|
||||
ScopedTempDir temp_dir;
|
||||
base::ScopedTempDir temp_dir;
|
||||
|
||||
// Create a new temporary directory.
|
||||
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
|
||||
|
@ -538,7 +538,7 @@ TEST(CookieTest, AllCookiesInMemory) {
|
|||
}
|
||||
|
||||
TEST(CookieTest, AllCookiesOnDisk) {
|
||||
ScopedTempDir temp_dir;
|
||||
base::ScopedTempDir temp_dir;
|
||||
|
||||
// Create a new temporary directory.
|
||||
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
|
||||
|
|
Loading…
Reference in New Issue