Update to Chromium revision 142910.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@703 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-22 00:10:10 +00:00
parent 65cc337f03
commit 1f42df1b61
11 changed files with 49 additions and 30 deletions

View File

@ -17,5 +17,5 @@
{
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '140240',
'chromium_revision': '142910',
}

View File

@ -107,7 +107,7 @@ WebStorageNamespace* BrowserDomStorageSystem::NamespaceImpl::copy() {
int new_id = kInvalidNamespaceId;
if (Context()) {
new_id = Context()->AllocateSessionId();
Context()->CloneSessionNamespace(namespace_id_, new_id);
Context()->CloneSessionNamespace(namespace_id_, new_id, std::string());
}
return new NamespaceImpl(parent_, new_id);
}
@ -215,7 +215,7 @@ WebStorageNamespace* BrowserDomStorageSystem::CreateLocalStorageNamespace() {
WebStorageNamespace* BrowserDomStorageSystem::CreateSessionStorageNamespace() {
int id = context_->AllocateSessionId();
context_->CreateSessionNamespace(id);
context_->CreateSessionNamespace(id, std::string());
return new NamespaceImpl(weak_factory_.GetWeakPtr(), id);
}

View File

@ -279,12 +279,12 @@ void BrowserDragDelegate::DoDragging(const WebDropData& drop_data,
// a shortcut so we add it first.
if (!drop_data.file_contents.empty())
PrepareDragForFileContents(drop_data, &data);
if (!drop_data.text_html.empty())
data.SetHtml(drop_data.text_html, drop_data.html_base_url);
if (!drop_data.html.is_null() && !drop_data.html.string().empty())
data.SetHtml(drop_data.html.string(), drop_data.html_base_url);
// We set the text contents before the URL because the URL also sets text
// content.
if (!drop_data.plain_text.empty())
data.SetString(drop_data.plain_text);
if (!drop_data.text.is_null() && !drop_data.text.string().empty())
data.SetString(drop_data.text.string());
if (drop_data.url.is_valid())
PrepareDragForUrl(drop_data, &data);
}

View File

@ -104,3 +104,14 @@ bool BrowserNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
const FilePath& path) const {
return true;
}
bool BrowserNetworkDelegate::OnCanThrottleRequest(
const net::URLRequest& request) const {
return false;
}
int BrowserNetworkDelegate::OnBeforeSocketStreamConnect(
net::SocketStream* stream,
const net::CompletionCallback& callback) {
return net::OK;
}

View File

@ -51,6 +51,11 @@ class BrowserNetworkDelegate : public net::NetworkDelegate {
net::CookieOptions* options) OVERRIDE;
virtual bool OnCanAccessFile(const net::URLRequest& request,
const FilePath& path) const OVERRIDE;
virtual bool OnCanThrottleRequest(
const net::URLRequest& request) const OVERRIDE;
virtual int OnBeforeSocketStreamConnect(
net::SocketStream* stream,
const net::CompletionCallback& callback) OVERRIDE;
bool accept_all_cookies_;
};

View File

@ -1138,8 +1138,6 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge,
static_cast<SyncRequestProxy*>(proxy_.get())->WaitForCompletion();
}
virtual void UpdateRoutingId(int new_routing_id) OVERRIDE {}
private:
CefRefPtr<CefBrowserImpl> browser_;

View File

@ -35,11 +35,11 @@ CefString CefDragDataImpl::GetLinkMetadata() {
}
CefString CefDragDataImpl::GetFragmentText() {
return data_.plain_text;
return data_.text.is_null() ? CefString() : data_.text.string();
}
CefString CefDragDataImpl::GetFragmentHtml() {
return data_.text_html;
return data_.html.is_null() ? CefString() : data_.html.string();
}
CefString CefDragDataImpl::GetFragmentBaseURL() {

View File

@ -79,14 +79,14 @@ void WebDragSource::StartDragging(const WebDropData& drop_data,
const WebKit::WebPoint& image_offset) {
drop_data_.reset(new WebDropData(drop_data));
int targets_mask = 0;
if (!drop_data.plain_text.empty())
if (!drop_data.text.is_null() && !drop_data.text.string().empty())
targets_mask |= ui::TEXT_PLAIN;
if (drop_data.url.is_valid()) {
targets_mask |= ui::TEXT_URI_LIST;
targets_mask |= ui::CHROME_NAMED_URL;
targets_mask |= ui::NETSCAPE_URL;
}
if (!drop_data.text_html.empty())
if (!drop_data.html.is_null() && !drop_data.html.string().empty())
targets_mask |= ui::TEXT_HTML;
GtkTargetList* tl = ui::GetTargetListFromCodeMask(targets_mask);
@ -125,14 +125,16 @@ void WebDragSource::OnDragDataGet(GtkWidget* sender, GdkDragContext* context,
guint target_type, guint time) {
switch (target_type) {
case ui::TEXT_PLAIN: {
std::string utf8_text = UTF16ToUTF8(drop_data_->plain_text);
std::string utf8_text = drop_data_->text.is_null() ?
std::string() : UTF16ToUTF8(drop_data_->text.string());
gtk_selection_data_set_text(selection_data, utf8_text.c_str(),
utf8_text.length());
break;
}
case ui::TEXT_HTML: {
std::string utf8_text = UTF16ToUTF8(drop_data_->text_html);
std::string utf8_text = drop_data_->html.is_null() ?
std::string() : UTF16ToUTF8(drop_data_->html.string());
gtk_selection_data_set(selection_data,
ui::GetAtomForTarget(ui::TEXT_HTML),
8,

View File

@ -153,9 +153,9 @@ void PromiseWriterHelper(const WebDropData& drop_data,
// HTML.
if ([type isEqualToString:NSHTMLPboardType]) {
DCHECK(!dropData_->text_html.empty());
DCHECK(!dropData_->html.is_null() && !dropData_->html.string().empty());
// See comment on |kHtmlHeader| above.
[pboard setString:SysUTF16ToNSString(kHtmlHeader + dropData_->text_html)
[pboard setString:SysUTF16ToNSString(kHtmlHeader + dropData_->html.string())
forType:NSHTMLPboardType];
// URL.
@ -202,8 +202,8 @@ void PromiseWriterHelper(const WebDropData& drop_data,
// Plain text.
} else if ([type isEqualToString:NSStringPboardType]) {
DCHECK(!dropData_->plain_text.empty());
[pboard setString:SysUTF16ToNSString(dropData_->plain_text)
DCHECK(!dropData_->text.is_null() && !dropData_->text.string().empty());
[pboard setString:SysUTF16ToNSString(dropData_->text.string())
forType:NSStringPboardType];
// Oops!
@ -359,7 +359,7 @@ void PromiseWriterHelper(const WebDropData& drop_data,
[pasteboard_ declareTypes:[NSArray array] owner:view_];
// HTML.
if (!dropData_->text_html.empty())
if (!dropData_->html.is_null() && !dropData_->html.string().empty())
[pasteboard_ addTypes:[NSArray arrayWithObject:NSHTMLPboardType]
owner:view_];
@ -419,7 +419,7 @@ void PromiseWriterHelper(const WebDropData& drop_data,
}
// Plain text.
if (!dropData_->plain_text.empty())
if (!dropData_->text.is_null() && !dropData_->text.string().empty())
[pasteboard_ addTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:view_];
}

View File

@ -186,7 +186,8 @@ void WebDropTarget::OnDragDataReceived(GtkWidget* widget,
data->target == ui::GetAtomForTarget(ui::TEXT_PLAIN_NO_CHARSET)) {
guchar* text = gtk_selection_data_get_text(data);
if (text) {
drop_data_->plain_text = UTF8ToUTF16((const char*)text);
drop_data_->text =
NullableString16(UTF8ToUTF16((const char*)text), false);
g_free(text);
}
} else if (data->target == ui::GetAtomForTarget(ui::TEXT_URI_LIST)) {
@ -208,7 +209,7 @@ void WebDropTarget::OnDragDataReceived(GtkWidget* widget,
// This is a hack. Some file managers also populate text/plain with
// a file URL when dragging files, so we clear it to avoid exposing
// it to the web content.
// drop_data_->plain_text.clear();
// drop_data_->text = NullableString16(true);
} else if (!drop_data_->url.is_valid()) {
// Also set the first non-file URL as the URL content for the drop.
drop_data_->url = url;
@ -217,9 +218,9 @@ void WebDropTarget::OnDragDataReceived(GtkWidget* widget,
g_strfreev(uris);
}
} else if (data->target == ui::GetAtomForTarget(ui::TEXT_HTML)) {
drop_data_->text_html =
drop_data_->html = NullableString16(
UTF8ToUTF16(std::string(reinterpret_cast<char*>(data->data),
data->length));
data->length)), false);
// We leave the base URL empty.
} else if (data->target == ui::GetAtomForTarget(ui::NETSCAPE_URL)) {
std::string netscape_url(reinterpret_cast<char*>(data->data),

View File

@ -221,17 +221,19 @@ using WebKit::WebView;
// Get plain text.
if ([types containsObject:NSStringPboardType]) {
data->plain_text =
base::SysNSStringToUTF16([pboard stringForType:NSStringPboardType]);
data->text = NullableString16(
base::SysNSStringToUTF16([pboard stringForType:NSStringPboardType]),
false);
}
// Get HTML. If there's no HTML, try RTF.
if ([types containsObject:NSHTMLPboardType]) {
data->text_html =
base::SysNSStringToUTF16([pboard stringForType:NSHTMLPboardType]);
data->html = NullableString16(
base::SysNSStringToUTF16([pboard stringForType:NSHTMLPboardType]),
false);
} else if ([types containsObject:NSRTFPboardType]) {
NSString* html = [pboard htmlFromRtf];
data->text_html = base::SysNSStringToUTF16(html);
data->html = NullableString16(base::SysNSStringToUTF16(html), false);
}
// Get files.