mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-12 09:37:37 +01:00
8fee8ed05d
- Move all tests from the top-level directory to tests/. - Move files shared by cefclient and unittests to tests/shared/. - Add a fused (single header/source file) version of gtest in tests/gtest/ with associated CMake configuration. - Test-only headers are now exposed in include/test/. Unit test targets must define UNIT_TEST in order to access them. - Replace usage of USING_CEF_SHARED with WRAPPING_CEF_SHARED for clarity (only the libcef_dll_wrapper target should define it). - Remove the RENAME_DIRECTORY CMake macro which is no longer used. - Remove C++11 usage from unittests sources for compatibility with the binary distribution configuration. - Windows: Fix build errors due to chrome_elf.dll and imm32.lib missing from the CMake configuration.
62 lines
1.9 KiB
C++
62 lines
1.9 KiB
C++
// Copyright (c) 2015 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.
|
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_MAIN_MESSAGE_LOOP_MULTITHREADED_WIN_H_
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_MAIN_MESSAGE_LOOP_MULTITHREADED_WIN_H_
|
|
#pragma once
|
|
|
|
#include <windows.h>
|
|
#include <queue>
|
|
|
|
#include "include/base/cef_lock.h"
|
|
#include "include/base/cef_platform_thread.h"
|
|
#include "tests/shared/browser/main_message_loop.h"
|
|
|
|
namespace client {
|
|
|
|
// Represents the main message loop in the browser process when using multi-
|
|
// threaded message loop mode on Windows. In this mode there is no Chromium
|
|
// message loop running on the main application thread. Instead, this
|
|
// implementation utilizes a hidden message window for running tasks.
|
|
class MainMessageLoopMultithreadedWin : public MainMessageLoop {
|
|
public:
|
|
MainMessageLoopMultithreadedWin();
|
|
~MainMessageLoopMultithreadedWin();
|
|
|
|
// MainMessageLoop methods.
|
|
int Run() OVERRIDE;
|
|
void Quit() OVERRIDE;
|
|
void PostTask(CefRefPtr<CefTask> task) OVERRIDE;
|
|
bool RunsTasksOnCurrentThread() const OVERRIDE;
|
|
void SetCurrentModelessDialog(HWND hWndDialog) OVERRIDE;
|
|
|
|
private:
|
|
// Create the message window.
|
|
static HWND CreateMessageWindow(HINSTANCE hInstance);
|
|
|
|
// Window procedure for the message window.
|
|
static LRESULT CALLBACK MessageWndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|
LPARAM lParam);
|
|
|
|
void PostTaskInternal(CefRefPtr<CefTask> task);
|
|
|
|
base::PlatformThreadId thread_id_;
|
|
UINT task_message_id_;
|
|
|
|
// Only accessed on the main thread.
|
|
HWND dialog_hwnd_;
|
|
|
|
base::Lock lock_;
|
|
|
|
// Must be protected by |lock_|.
|
|
HWND message_hwnd_;
|
|
std::queue<CefRefPtr<CefTask> > queued_tasks_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MainMessageLoopMultithreadedWin);
|
|
};
|
|
|
|
} // namespace client
|
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_MAIN_MESSAGE_LOOP_MULTITHREADED_WIN_H_
|