mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-11 09:08:06 +01:00
801ff3ca43
- Move to the new DOM storage backend. Persistent localStorage support will need to be re-implemented (issue #603). - Add CefV8Value::CreateUInt method and indicate that integer types are 32bit via usage of int32 and uint32 types (issue #331). - Add CefV8Context::Eval method for synchronous JavaScript execution that returns a value or exception (issue #444). - Move exception handling from an ExecuteFunction argument to a CefV8Value attribute (issue #546). - Make user data an attribute for all CefV8Value object types and not just CreateObject (issue #547). - Un-fork SQLitePersistentCookieStore by adding stub implementations for sqlite_diagnostics and browser_thread. - Update tools/cef_parser.py to match the CEF3 version. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@644 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
79 lines
2.7 KiB
C++
79 lines
2.7 KiB
C++
// Copyright (c) 2010 The Chromium Embedded Framework Authors.
|
|
// Portions copyright (c) 2010 The Chromium 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 "libcef/cef_process_io_thread.h"
|
|
|
|
#include "libcef/cef_context.h"
|
|
#include "libcef/browser_appcache_system.h"
|
|
#include "libcef/browser_file_writer.h"
|
|
#include "libcef/browser_network_delegate.h"
|
|
#include "libcef/browser_resource_loader_bridge.h"
|
|
#include "libcef/browser_socket_stream_bridge.h"
|
|
#include "libcef/browser_webblobregistry_impl.h"
|
|
|
|
#include "build/build_config.h"
|
|
#include "base/compiler_specific.h"
|
|
#include "net/socket/client_socket_pool_manager.h"
|
|
|
|
#if defined(OS_WIN)
|
|
#include <Objbase.h> // NOLINT(build/include_order)
|
|
#endif
|
|
|
|
CefProcessIOThread::CefProcessIOThread()
|
|
: CefThread(CefThread::IO), request_context_(NULL) {}
|
|
|
|
CefProcessIOThread::CefProcessIOThread(MessageLoop* message_loop)
|
|
: CefThread(CefThread::IO, message_loop), request_context_(NULL) {}
|
|
|
|
CefProcessIOThread::~CefProcessIOThread() {
|
|
// We cannot rely on our base class to stop the thread since we want our
|
|
// CleanUp function to run.
|
|
Stop();
|
|
}
|
|
|
|
void CefProcessIOThread::Init() {
|
|
CefThread::Init();
|
|
|
|
FilePath cache_path(_Context->cache_path());
|
|
request_context_.reset(new BrowserRequestContext(cache_path,
|
|
net::HttpCache::NORMAL, false));
|
|
_Context->set_request_context(request_context_.get());
|
|
|
|
network_delegate_.reset(new BrowserNetworkDelegate());
|
|
request_context_->set_network_delegate(network_delegate_.get());
|
|
|
|
BrowserAppCacheSystem::InitializeOnIOThread(request_context_.get());
|
|
BrowserFileWriter::InitializeOnIOThread(request_context_.get());
|
|
BrowserFileSystem::InitializeOnIOThread(
|
|
request_context_->blob_storage_controller());
|
|
BrowserSocketStreamBridge::InitializeOnIOThread(request_context_.get());
|
|
BrowserWebBlobRegistryImpl::InitializeOnIOThread(
|
|
request_context_->blob_storage_controller());
|
|
}
|
|
|
|
void CefProcessIOThread::CleanUp() {
|
|
// Flush any remaining messages. This ensures that any accumulated
|
|
// Task objects get destroyed before we exit, which avoids noise in
|
|
// purify leak-test results.
|
|
MessageLoop::current()->RunAllPending();
|
|
|
|
// In reverse order of initialization.
|
|
BrowserWebBlobRegistryImpl::Cleanup();
|
|
BrowserSocketStreamBridge::Cleanup();
|
|
BrowserFileSystem::CleanupOnIOThread();
|
|
BrowserFileWriter::CleanupOnIOThread();
|
|
BrowserAppCacheSystem::CleanupOnIOThread();
|
|
|
|
_Context->set_request_context(NULL);
|
|
|
|
request_context_->set_network_delegate(NULL);
|
|
network_delegate_.reset(NULL);
|
|
|
|
_Context->set_request_context(NULL);
|
|
request_context_.reset(NULL);
|
|
|
|
CefThread::Cleanup();
|
|
}
|