libcef: Update due to underlying chromium changes.

- External plugin loading support is now provided by webkit/glue/plugins so the libcef/plugins directory has been eliminated, with related changes.
- Modify the CefPluginInfo structure to use a more friendly data organization format.
- Remove CefUnregisterPlugin() as it is no longer functional.
- WebViewDelegate::ShowContextMenu() now receives the menu type as a bit-masked flag, so adjust the API accordingly.
- WebViewDelegate::GetContainingView() now returns a gfx::NativeViewId instead of a gfx::NativeView.
- Modify BrowserRequestContext because GetUserAgent() is now a virtual method of URLRequestContext.
- The data buffer in RequestProxy is now a net::IOBuffer.
- Add webkit_glue::GetScreenInfo().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@10 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-01-29 16:36:37 +00:00
parent 1b6fa403ab
commit 73027bb5a9
32 changed files with 139 additions and 4060 deletions

View File

@@ -43,6 +43,7 @@
#include "base/thread.h"
#include "base/waitable_event.h"
#include "net/base/cookie_monster.h"
#include "net/base/io_buffer.h"
#include "net/base/net_util.h"
#include "net/base/upload_data.h"
#include "net/url_request/url_request.h"
@@ -112,7 +113,7 @@ class RequestProxy : public URLRequest::Delegate,
public:
// Takes ownership of the params.
RequestProxy(CefRefPtr<CefBrowser> browser)
: browser_(browser)
: browser_(browser), buf_(new net::IOBuffer(kDataSize))
{
}
@@ -164,7 +165,7 @@ class RequestProxy : public URLRequest::Delegate,
// Make a local copy of buf_, since AsyncReadData reuses it.
scoped_array<char> buf_copy(new char[bytes_read]);
memcpy(buf_copy.get(), buf_, bytes_read);
memcpy(buf_copy.get(), buf_->data(), bytes_read);
// Continue reading more data into buf_
// Note: Doing this before notifying our peer ensures our load events get
@@ -282,7 +283,7 @@ class RequestProxy : public URLRequest::Delegate,
void AsyncReadData() {
if(resource_stream_.get()) {
// Read from the handler-provided resource stream
int bytes_read = resource_stream_->Read(buf_, 1, sizeof(buf_));
int bytes_read = resource_stream_->Read(buf_->data(), 1, kDataSize);
if(bytes_read > 0) {
OnReceivedData(bytes_read);
} else {
@@ -297,7 +298,7 @@ class RequestProxy : public URLRequest::Delegate,
if (request_->status().is_success()) {
int bytes_read;
if (request_->Read(buf_, sizeof(buf_), &bytes_read) && bytes_read) {
if (request_->Read(buf_, kDataSize, &bytes_read) && bytes_read) {
OnReceivedData(bytes_read);
} else if (!request_->status().is_io_pending()) {
Done();
@@ -388,7 +389,7 @@ class RequestProxy : public URLRequest::Delegate,
static const int kDataSize = 16*1024;
// read buffer for async IO
char buf_[kDataSize];
scoped_refptr<net::IOBuffer> buf_;
CefRefPtr<CefBrowser> browser_;
@@ -428,7 +429,7 @@ class SyncRequestProxy : public RequestProxy {
}
virtual void OnReceivedData(int bytes_read) {
result_->data.append(buf_, bytes_read);
result_->data.append(buf_->data(), bytes_read);
AsyncReadData(); // read more (may recurse)
}