Rename CEF1 files from /trunk to /trunk/cef1 (issue #564).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@570 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-04-03 01:27:13 +00:00
parent 0a1fd8b040
commit b568f160d9
651 changed files with 6 additions and 7 deletions

View File

@@ -1,60 +0,0 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/wrapper/cef_byte_read_handler.h"
#include <stdlib.h>
#include "libcef_dll/cef_logging.h"
CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size,
CefRefPtr<CefBase> source)
: bytes_(bytes), size_(size), offset_(0), source_(source) {
}
size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) {
AutoLock lock_scope(this);
size_t s = (size_ - offset_) / size;
size_t ret = std::min(n, s);
memcpy(ptr, bytes_ + offset_, ret * size);
offset_ += ret * size;
return ret;
}
int CefByteReadHandler::Seek(int64 offset, int whence) {
int rv = -1L;
AutoLock lock_scope(this);
switch (whence) {
case SEEK_CUR:
if (offset_ + offset > size_ || offset_ + offset < 0)
break;
offset_ += offset;
rv = 0;
break;
case SEEK_END: {
int64 offset_abs = abs(offset);
if (offset_abs > size_)
break;
offset_ = size_ - offset_abs;
rv = 0;
break;
}
case SEEK_SET:
if (offset > size_ || offset < 0)
break;
offset_ = offset;
rv = 0;
break;
}
return rv;
}
int64 CefByteReadHandler::Tell() {
AutoLock lock_scope(this);
return offset_;
}
int CefByteReadHandler::Eof() {
AutoLock lock_scope(this);
return (offset_ >= size_);
}

View File

@@ -1,456 +0,0 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/wrapper/cef_xml_object.h"
#include "include/cef_stream.h"
#include "libcef_dll/cef_logging.h"
#include <sstream>
namespace {
class CefXmlObjectLoader {
public:
explicit CefXmlObjectLoader(CefRefPtr<CefXmlObject> root_object)
: root_object_(root_object) {
}
bool Load(CefRefPtr<CefStreamReader> stream,
CefXmlReader::EncodingType encodingType,
const CefString& URI) {
CefRefPtr<CefXmlReader> reader(
CefXmlReader::Create(stream, encodingType, URI));
if (!reader.get())
return false;
bool ret = reader->MoveToNextNode();
if (ret) {
CefRefPtr<CefXmlObject> cur_object(root_object_), new_object;
CefXmlObject::ObjectVector queue;
int cur_depth, value_depth = -1;
CefXmlReader::NodeType cur_type;
std::stringstream cur_value;
bool last_has_ns = false;
queue.push_back(root_object_);
do {
cur_depth = reader->GetDepth();
if (value_depth >= 0 && cur_depth > value_depth) {
// The current node has already been parsed as part of a value.
continue;
}
cur_type = reader->GetType();
if (cur_type == XML_NODE_ELEMENT_START) {
if (cur_depth == value_depth) {
// Add to the current value.
cur_value << std::string(reader->GetOuterXml());
continue;
} else if (last_has_ns && reader->GetPrefix().empty()) {
if (!cur_object->HasChildren()) {
// Start a new value because the last element has a namespace and
// this element does not.
value_depth = cur_depth;
cur_value << std::string(reader->GetOuterXml());
} else {
// Value following a child element is not allowed.
std::stringstream ss;
ss << L"Value following child element, line " <<
reader->GetLineNumber();
load_error_ = ss.str();
ret = false;
break;
}
} else {
// Start a new element.
new_object = new CefXmlObject(reader->GetQualifiedName());
cur_object->AddChild(new_object);
last_has_ns = !reader->GetPrefix().empty();
if (!reader->IsEmptyElement()) {
// The new element potentially has a value and/or children, so
// set the current object and add the object to the queue.
cur_object = new_object;
queue.push_back(cur_object);
}
if (reader->HasAttributes() && reader->MoveToFirstAttribute()) {
// Read all object attributes.
do {
new_object->SetAttributeValue(reader->GetQualifiedName(),
reader->GetValue());
} while (reader->MoveToNextAttribute());
reader->MoveToCarryingElement();
}
}
} else if (cur_type == XML_NODE_ELEMENT_END) {
if (cur_depth == value_depth) {
// Ending an element that is already in the value.
continue;
} else if (cur_depth < value_depth) {
// Done with parsing the value portion of the current element.
cur_object->SetValue(cur_value.str());
cur_value.str("");
value_depth = -1;
}
// Pop the current element from the queue.
queue.pop_back();
if (queue.empty() ||
cur_object->GetName() != reader->GetQualifiedName()) {
// Open tag without close tag or close tag without open tag should
// never occur (the parser catches this error).
DCHECK(false);
std::stringstream ss;
ss << "Mismatched end tag for " <<
std::string(cur_object->GetName()) <<
", line " << reader->GetLineNumber();
load_error_ = ss.str();
ret = false;
break;
}
// Set the current object to the previous object in the queue.
cur_object = queue.back().get();
} else if (cur_type == XML_NODE_TEXT || cur_type == XML_NODE_CDATA ||
cur_type == XML_NODE_ENTITY_REFERENCE) {
if (cur_depth == value_depth) {
// Add to the current value.
cur_value << std::string(reader->GetValue());
} else if (!cur_object->HasChildren()) {
// Start a new value.
value_depth = cur_depth;
cur_value << std::string(reader->GetValue());
} else {
// Value following a child element is not allowed.
std::stringstream ss;
ss << "Value following child element, line " <<
reader->GetLineNumber();
load_error_ = ss.str();
ret = false;
break;
}
}
} while (reader->MoveToNextNode());
}
if (reader->HasError()) {
load_error_ = reader->GetError();
return false;
}
return ret;
}
CefString GetLoadError() { return load_error_; }
private:
CefString load_error_;
CefRefPtr<CefXmlObject> root_object_;
};
} // namespace
CefXmlObject::CefXmlObject(const CefString& name)
: name_(name), parent_(NULL) {
}
CefXmlObject::~CefXmlObject() {
}
bool CefXmlObject::Load(CefRefPtr<CefStreamReader> stream,
CefXmlReader::EncodingType encodingType,
const CefString& URI, CefString* loadError) {
AutoLock lock_scope(this);
Clear();
CefXmlObjectLoader loader(this);
if (!loader.Load(stream, encodingType, URI)) {
if (loadError)
*loadError = loader.GetLoadError();
return false;
}
return true;
}
void CefXmlObject::Set(CefRefPtr<CefXmlObject> object) {
DCHECK(object.get());
AutoLock lock_scope1(this);
AutoLock lock_scope2(object);
Clear();
name_ = object->GetName();
Append(object, true);
}
void CefXmlObject::Append(CefRefPtr<CefXmlObject> object,
bool overwriteAttributes) {
DCHECK(object.get());
AutoLock lock_scope1(this);
AutoLock lock_scope2(object);
if (object->HasChildren()) {
ObjectVector children;
object->GetChildren(children);
ObjectVector::const_iterator it = children.begin();
for (; it != children.end(); ++it)
AddChild((*it)->Duplicate());
}
if (object->HasAttributes()) {
AttributeMap attributes;
object->GetAttributes(attributes);
AttributeMap::const_iterator it = attributes.begin();
for (; it != attributes.end(); ++it) {
if (overwriteAttributes || !HasAttribute(it->first))
SetAttributeValue(it->first, it->second);
}
}
}
CefRefPtr<CefXmlObject> CefXmlObject::Duplicate() {
CefRefPtr<CefXmlObject> new_obj;
{
AutoLock lock_scope(this);
new_obj = new CefXmlObject(name_);
new_obj->Append(this, true);
}
return new_obj;
}
void CefXmlObject::Clear() {
AutoLock lock_scope(this);
ClearChildren();
ClearAttributes();
}
CefString CefXmlObject::GetName() {
CefString name;
{
AutoLock lock_scope(this);
name = name_;
}
return name;
}
bool CefXmlObject::SetName(const CefString& name) {
DCHECK(!name.empty());
if (name.empty())
return false;
AutoLock lock_scope(this);
name_ = name;
return true;
}
bool CefXmlObject::HasParent() {
AutoLock lock_scope(this);
return (parent_ != NULL);
}
CefRefPtr<CefXmlObject> CefXmlObject::GetParent() {
CefRefPtr<CefXmlObject> parent;
{
AutoLock lock_scope(this);
parent = parent_;
}
return parent;
}
bool CefXmlObject::HasValue() {
AutoLock lock_scope(this);
return !value_.empty();
}
CefString CefXmlObject::GetValue() {
CefString value;
{
AutoLock lock_scope(this);
value = value_;
}
return value;
}
bool CefXmlObject::SetValue(const CefString& value) {
AutoLock lock_scope(this);
DCHECK(children_.empty());
if (!children_.empty())
return false;
value_ = value;
return true;
}
bool CefXmlObject::HasAttributes() {
AutoLock lock_scope(this);
return !attributes_.empty();
}
size_t CefXmlObject::GetAttributeCount() {
AutoLock lock_scope(this);
return attributes_.size();
}
bool CefXmlObject::HasAttribute(const CefString& name) {
if (name.empty())
return false;
AutoLock lock_scope(this);
AttributeMap::const_iterator it = attributes_.find(name);
return (it != attributes_.end());
}
CefString CefXmlObject::GetAttributeValue(const CefString& name) {
DCHECK(!name.empty());
CefString value;
if (!name.empty()) {
AutoLock lock_scope(this);
AttributeMap::const_iterator it = attributes_.find(name);
if (it != attributes_.end())
value = it->second;
}
return value;
}
bool CefXmlObject::SetAttributeValue(const CefString& name,
const CefString& value) {
DCHECK(!name.empty());
if (name.empty())
return false;
AutoLock lock_scope(this);
AttributeMap::iterator it = attributes_.find(name);
if (it != attributes_.end()) {
it->second = value;
} else {
attributes_.insert(std::make_pair(name, value));
}
return true;
}
size_t CefXmlObject::GetAttributes(AttributeMap& attributes) {
AutoLock lock_scope(this);
attributes = attributes_;
return attributes_.size();
}
void CefXmlObject::ClearAttributes() {
AutoLock lock_scope(this);
attributes_.clear();
}
bool CefXmlObject::HasChildren() {
AutoLock lock_scope(this);
return !children_.empty();
}
size_t CefXmlObject::GetChildCount() {
AutoLock lock_scope(this);
return children_.size();
}
bool CefXmlObject::HasChild(CefRefPtr<CefXmlObject> child) {
DCHECK(child.get());
AutoLock lock_scope(this);
ObjectVector::const_iterator it = children_.begin();
for (; it != children_.end(); ++it) {
if ((*it).get() == child.get())
return true;
}
return false;
}
bool CefXmlObject::AddChild(CefRefPtr<CefXmlObject> child) {
DCHECK(child.get());
if (!child.get())
return false;
AutoLock lock_scope1(child);
DCHECK(child->GetParent() == NULL);
if (child->GetParent() != NULL)
return false;
AutoLock lock_scope2(this);
children_.push_back(child);
child->SetParent(this);
return true;
}
bool CefXmlObject::RemoveChild(CefRefPtr<CefXmlObject> child) {
DCHECK(child.get());
AutoLock lock_scope(this);
ObjectVector::iterator it = children_.begin();
for (; it != children_.end(); ++it) {
if ((*it).get() == child.get()) {
children_.erase(it);
child->SetParent(NULL);
return true;
}
}
return false;
}
size_t CefXmlObject::GetChildren(ObjectVector& children) {
AutoLock lock_scope(this);
children = children_;
return children_.size();
}
void CefXmlObject::ClearChildren() {
AutoLock lock_scope(this);
ObjectVector::iterator it = children_.begin();
for (; it != children_.end(); ++it)
(*it)->SetParent(NULL);
children_.clear();
}
CefRefPtr<CefXmlObject> CefXmlObject::FindChild(const CefString& name) {
DCHECK(!name.empty());
if (name.empty())
return NULL;
AutoLock lock_scope(this);
ObjectVector::const_iterator it = children_.begin();
for (; it != children_.end(); ++it) {
if ((*it)->GetName() == name)
return (*it);
}
return NULL;
}
size_t CefXmlObject::FindChildren(const CefString& name,
ObjectVector& children) {
DCHECK(!name.empty());
if (name.empty())
return 0;
size_t ct = 0;
AutoLock lock_scope(this);
ObjectVector::const_iterator it = children_.begin();
for (; it != children_.end(); ++it) {
if ((*it)->GetName() == name) {
children.push_back(*it);
ct++;
}
}
return ct;
}
void CefXmlObject::SetParent(CefXmlObject* parent) {
AutoLock lock_scope(this);
if (parent) {
DCHECK(parent_ == NULL);
parent_ = parent;
} else {
DCHECK(parent_ != NULL);
parent_ = NULL;
}
}

View File

@@ -1,162 +0,0 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#if defined(__linux__)
#include <wctype.h>
#endif
#include <algorithm>
#include <vector>
#include "include/wrapper/cef_zip_archive.h"
#include "include/cef_stream.h"
#include "include/cef_zip_reader.h"
#include "include/wrapper/cef_byte_read_handler.h"
#include "libcef_dll/cef_logging.h"
namespace {
class CefZipFile : public CefZipArchive::File {
public:
explicit CefZipFile(size_t size) : data_(size) {}
~CefZipFile() {}
// Returns the read-only data contained in the file.
virtual const unsigned char* GetData() { return &data_[0]; }
// Returns the size of the data in the file.
virtual size_t GetDataSize() { return data_.size(); }
// Returns a CefStreamReader object for streaming the contents of the file.
virtual CefRefPtr<CefStreamReader> GetStreamReader() {
CefRefPtr<CefReadHandler> handler(
new CefByteReadHandler(GetData(), GetDataSize(), this));
return CefStreamReader::CreateForHandler(handler);
}
std::vector<unsigned char>* GetDataVector() { return &data_; }
private:
std::vector<unsigned char> data_;
IMPLEMENT_REFCOUNTING(CefZipFile);
};
} // namespace
// CefZipArchive implementation
CefZipArchive::CefZipArchive() {
}
CefZipArchive::~CefZipArchive() {
}
size_t CefZipArchive::Load(CefRefPtr<CefStreamReader> stream,
bool overwriteExisting) {
AutoLock lock_scope(this);
CefRefPtr<CefZipReader> reader(CefZipReader::Create(stream));
if (!reader.get())
return 0;
if (!reader->MoveToFirstFile())
return 0;
std::wstring name;
CefRefPtr<CefZipFile> contents;
FileMap::iterator it;
std::vector<unsigned char>* data;
size_t count = 0, size, offset;
do {
size = static_cast<size_t>(reader->GetFileSize());
if (size == 0) {
// Skip directories and empty files.
continue;
}
if (!reader->OpenFile(CefString()))
break;
name = reader->GetFileName();
std::transform(name.begin(), name.end(), name.begin(), towlower);
it = contents_.find(name);
if (it != contents_.end()) {
if (overwriteExisting)
contents_.erase(it);
else // Skip files that already exist.
continue;
}
contents = new CefZipFile(size);
data = contents->GetDataVector();
offset = 0;
// Read the file contents.
do {
offset += reader->ReadFile(&(*data)[offset], size - offset);
} while (offset < size && !reader->Eof());
DCHECK(offset == size);
reader->CloseFile();
count++;
// Add the file to the map.
contents_.insert(std::make_pair(name, contents.get()));
} while (reader->MoveToNextFile());
return count;
}
void CefZipArchive::Clear() {
AutoLock lock_scope(this);
contents_.clear();
}
size_t CefZipArchive::GetFileCount() {
AutoLock lock_scope(this);
return contents_.size();
}
bool CefZipArchive::HasFile(const CefString& fileName) {
std::wstring str = fileName;
std::transform(str.begin(), str.end(), str.begin(), towlower);
AutoLock lock_scope(this);
FileMap::const_iterator it = contents_.find(CefString(str));
return (it != contents_.end());
}
CefRefPtr<CefZipArchive::File> CefZipArchive::GetFile(
const CefString& fileName) {
std::wstring str = fileName;
std::transform(str.begin(), str.end(), str.begin(), towlower);
AutoLock lock_scope(this);
FileMap::const_iterator it = contents_.find(CefString(str));
if (it != contents_.end())
return it->second;
return NULL;
}
bool CefZipArchive::RemoveFile(const CefString& fileName) {
std::wstring str = fileName;
std::transform(str.begin(), str.end(), str.begin(), towlower);
AutoLock lock_scope(this);
FileMap::iterator it = contents_.find(CefString(str));
if (it != contents_.end()) {
contents_.erase(it);
return true;
}
return false;
}
size_t CefZipArchive::GetFiles(FileMap& map) {
AutoLock lock_scope(this);
map = contents_;
return contents_.size();
}

View File

@@ -1,487 +0,0 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "include/cef_app.h"
#include "include/capi/cef_app_capi.h"
#include "include/cef_origin_whitelist.h"
#include "include/capi/cef_origin_whitelist_capi.h"
#include "include/cef_scheme.h"
#include "include/capi/cef_scheme_capi.h"
#include "include/cef_storage.h"
#include "include/capi/cef_storage_capi.h"
#include "include/cef_task.h"
#include "include/capi/cef_task_capi.h"
#include "include/cef_url.h"
#include "include/capi/cef_url_capi.h"
#include "include/cef_v8.h"
#include "include/capi/cef_v8_capi.h"
#include "include/cef_version.h"
#include "libcef_dll/cpptoc/app_cpptoc.h"
#include "libcef_dll/cpptoc/content_filter_cpptoc.h"
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
#include "libcef_dll/cpptoc/domvisitor_cpptoc.h"
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
#include "libcef_dll/cpptoc/load_handler_cpptoc.h"
#include "libcef_dll/cpptoc/menu_handler_cpptoc.h"
#include "libcef_dll/cpptoc/permission_handler_cpptoc.h"
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
#include "libcef_dll/cpptoc/proxy_handler_cpptoc.h"
#include "libcef_dll/cpptoc/read_handler_cpptoc.h"
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h"
#include "libcef_dll/cpptoc/scheme_handler_cpptoc.h"
#include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h"
#include "libcef_dll/cpptoc/storage_visitor_cpptoc.h"
#include "libcef_dll/cpptoc/task_cpptoc.h"
#include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
#include "libcef_dll/cpptoc/v8context_handler_cpptoc.h"
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
#include "libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h"
#include "libcef_dll/cpptoc/write_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domevent_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
#include "libcef_dll/ctocpp/drag_data_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/response_ctocpp.h"
#include "libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
#include "libcef_dll/ctocpp/stream_writer_ctocpp.h"
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
#include "libcef_dll/ctocpp/v8exception_ctocpp.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
#include "libcef_dll/ctocpp/web_urlrequest_ctocpp.h"
#include "libcef_dll/ctocpp/xml_reader_ctocpp.h"
#include "libcef_dll/ctocpp/zip_reader_ctocpp.h"
// Define used to facilitate parsing.
#define CEF_GLOBAL
// GLOBAL METHODS - Body may be edited by hand.
CEF_GLOBAL bool CefInitialize(const CefSettings& settings,
CefRefPtr<CefApp> application) {
int build_revision = cef_build_revision();
if (build_revision != CEF_REVISION) {
// The libcef build revision does not match the CEF API revision.
DCHECK(false);
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: application
// Execute
int _retval = cef_initialize(
&settings,
CefAppCppToC::Wrap(application));
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL void CefShutdown() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_shutdown();
#ifndef NDEBUG
// Check that all wrapper objects have been destroyed
DCHECK_EQ(CefBrowserCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefContentFilterCppToC::DebugObjCt, 0);
DCHECK_EQ(CefCookieManagerCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefCookieVisitorCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDOMDocumentCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefDOMEventCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefDOMEventListenerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDOMNodeCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefDOMVisitorCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDisplayHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDownloadHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDragDataCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefDragHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefFindHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefFocusHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefFrameCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefJSDialogHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefKeyboardHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefLifeSpanHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefLoadHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefMenuHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefPermissionHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefPostDataCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefPostDataElementCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefPrintHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefProxyHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefReadHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefRenderHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefRequestCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefRequestHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefResourceBundleHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefResponseCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefSchemeHandlerCallbackCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefSchemeHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefSchemeHandlerFactoryCppToC::DebugObjCt, 0);
DCHECK_EQ(CefStorageVisitorCppToC::DebugObjCt, 0);
DCHECK_EQ(CefStreamReaderCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefStreamWriterCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefTaskCppToC::DebugObjCt, 0);
DCHECK_EQ(CefV8AccessorCppToC::DebugObjCt, 0);
DCHECK_EQ(CefV8ContextCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefV8ContextHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefV8ExceptionCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefV8HandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefV8ValueCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefWebURLRequestCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefWebURLRequestClientCppToC::DebugObjCt, 0);
DCHECK_EQ(CefWriteHandlerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefXmlReaderCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefZipReaderCToCpp::DebugObjCt, 0);
#endif // !NDEBUG
}
CEF_GLOBAL void CefDoMessageLoopWork() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_do_message_loop_work();
}
CEF_GLOBAL void CefRunMessageLoop() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_run_message_loop();
}
CEF_GLOBAL void CefQuitMessageLoop() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_quit_message_loop();
}
CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
const CefString& target_protocol, const CefString& target_domain,
bool allow_target_subdomains) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: source_origin; type: string_byref_const
DCHECK(!source_origin.empty());
if (source_origin.empty())
return false;
// Verify param: target_protocol; type: string_byref_const
DCHECK(!target_protocol.empty());
if (target_protocol.empty())
return false;
// Verify param: target_domain; type: string_byref_const
DCHECK(!target_domain.empty());
if (target_domain.empty())
return false;
// Execute
int _retval = cef_add_cross_origin_whitelist_entry(
source_origin.GetStruct(),
target_protocol.GetStruct(),
target_domain.GetStruct(),
allow_target_subdomains);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry(
const CefString& source_origin, const CefString& target_protocol,
const CefString& target_domain, bool allow_target_subdomains) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: source_origin; type: string_byref_const
DCHECK(!source_origin.empty());
if (source_origin.empty())
return false;
// Verify param: target_protocol; type: string_byref_const
DCHECK(!target_protocol.empty());
if (target_protocol.empty())
return false;
// Verify param: target_domain; type: string_byref_const
DCHECK(!target_domain.empty());
if (target_domain.empty())
return false;
// Execute
int _retval = cef_remove_cross_origin_whitelist_entry(
source_origin.GetStruct(),
target_protocol.GetStruct(),
target_domain.GetStruct(),
allow_target_subdomains);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefClearCrossOriginWhitelist() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = cef_clear_cross_origin_whitelist();
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name,
bool is_standard, bool is_local, bool is_display_isolated) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: scheme_name; type: string_byref_const
DCHECK(!scheme_name.empty());
if (scheme_name.empty())
return false;
// Execute
int _retval = cef_register_custom_scheme(
scheme_name.GetStruct(),
is_standard,
is_local,
is_display_isolated);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name,
const CefString& domain_name,
CefRefPtr<CefSchemeHandlerFactory> factory) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: scheme_name; type: string_byref_const
DCHECK(!scheme_name.empty());
if (scheme_name.empty())
return false;
// Unverified params: domain_name, factory
// Execute
int _retval = cef_register_scheme_handler_factory(
scheme_name.GetStruct(),
domain_name.GetStruct(),
CefSchemeHandlerFactoryCppToC::Wrap(factory));
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefClearSchemeHandlerFactories() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = cef_clear_scheme_handler_factories();
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin,
const CefString& key, CefRefPtr<CefStorageVisitor> visitor) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: visitor; type: refptr_diff
DCHECK(visitor.get());
if (!visitor.get())
return false;
// Unverified params: origin, key
// Execute
int _retval = cef_visit_storage(
type,
origin.GetStruct(),
key.GetStruct(),
CefStorageVisitorCppToC::Wrap(visitor));
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin,
const CefString& key, const CefString& value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: origin; type: string_byref_const
DCHECK(!origin.empty());
if (origin.empty())
return false;
// Verify param: key; type: string_byref_const
DCHECK(!key.empty());
if (key.empty())
return false;
// Verify param: value; type: string_byref_const
DCHECK(!value.empty());
if (value.empty())
return false;
// Execute
int _retval = cef_set_storage(
type,
origin.GetStruct(),
key.GetStruct(),
value.GetStruct());
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin,
const CefString& key) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: origin, key
// Execute
int _retval = cef_delete_storage(
type,
origin.GetStruct(),
key.GetStruct());
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: path
// Execute
int _retval = cef_set_storage_path(
type,
path.GetStruct());
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = cef_currently_on(
threadId);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: task; type: refptr_diff
DCHECK(task.get());
if (!task.get())
return false;
// Execute
int _retval = cef_post_task(
threadId,
CefTaskCppToC::Wrap(task));
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task, int64 delay_ms) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: task; type: refptr_diff
DCHECK(task.get());
if (!task.get())
return false;
// Execute
int _retval = cef_post_delayed_task(
threadId,
CefTaskCppToC::Wrap(task),
delay_ms);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: url; type: string_byref_const
DCHECK(!url.empty());
if (url.empty())
return false;
// Execute
int _retval = cef_parse_url(
url.GetStruct(),
&parts);
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = cef_create_url(
&parts,
url.GetWritableStruct());
// Return type: bool
return _retval?true:false;
}
CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name,
const CefString& javascript_code, CefRefPtr<CefV8Handler> handler) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: extension_name; type: string_byref_const
DCHECK(!extension_name.empty());
if (extension_name.empty())
return false;
// Verify param: javascript_code; type: string_byref_const
DCHECK(!javascript_code.empty());
if (javascript_code.empty())
return false;
// Unverified params: handler
// Execute
int _retval = cef_register_extension(
extension_name.GetStruct(),
javascript_code.GetStruct(),
CefV8HandlerCppToC::Wrap(handler));
// Return type: bool
return _retval?true:false;
}

View File

@@ -1,10 +0,0 @@
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/cef_nplugin.h"
#include "include/capi/cef_nplugin_capi.h"
bool CefRegisterPlugin(const CefPluginInfo& plugin_info) {
return cef_register_plugin(&plugin_info)?true:false;
}