Fix Debug building on Windows

This commit is contained in:
Cheng Zhao 2017-01-26 16:10:28 +09:00 committed by Kevin Sawicki
parent 6165d36351
commit 55d4d44f02
15 changed files with 52 additions and 79 deletions

View file

@ -20,6 +20,7 @@
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h" #include "content/public/browser/context_factory.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h" #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
#include "ui/compositor/layer_type.h" #include "ui/compositor/layer_type.h"
#include "ui/events/latency_info.h" #include "ui/events/latency_info.h"
@ -349,14 +350,16 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
is_showing_(!render_widget_host_->is_hidden()), is_showing_(!render_widget_host_->is_hidden()),
size_(native_window->GetSize()), size_(native_window->GetSize()),
painting_(true), painting_(true),
#if !defined(OS_MACOSX)
delegated_frame_host_(new content::DelegatedFrameHost(this)),
#endif
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
DCHECK(render_widget_host_); DCHECK(render_widget_host_);
render_widget_host_->SetView(this); render_widget_host_->SetView(this);
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
content::ImageTransportFactory* factory =
content::ImageTransportFactory::GetInstance();
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
factory->GetContextFactory()->AllocateFrameSinkId(), this);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif #endif
@ -743,16 +746,6 @@ OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
resources)); resources));
} }
void OffScreenRenderWidgetHostView::
DelegatedFrameHostOnLostCompositorResources() {
render_widget_host_->ScheduleComposite();
}
void OffScreenRenderWidgetHostView::DelegatedFrameHostUpdateVSyncParameters(
const base::TimeTicks& timebase, const base::TimeDelta& interval) {
render_widget_host_->UpdateVSyncParameters(timebase, interval);
}
void OffScreenRenderWidgetHostView::SetBeginFrameSource( void OffScreenRenderWidgetHostView::SetBeginFrameSource(
cc::BeginFrameSource* source) { cc::BeginFrameSource* source) {
} }

View file

@ -160,12 +160,9 @@ class OffScreenRenderWidgetHostView
bool defer_compositor_lock) override; bool defer_compositor_lock) override;
void DelegatedFrameHostResizeLockWasReleased(void) override; void DelegatedFrameHostResizeLockWasReleased(void) override;
void DelegatedFrameHostSendReclaimCompositorResources( void DelegatedFrameHostSendReclaimCompositorResources(
int output_surface_id, int output_surface_id,
bool is_swap_ack, bool is_swap_ack,
const cc::ReturnedResourceArray& resources) override; const cc::ReturnedResourceArray& resources) override;
void DelegatedFrameHostOnLostCompositorResources(void) override;
void DelegatedFrameHostUpdateVSyncParameters(
const base::TimeTicks &, const base::TimeDelta &) override;
void SetBeginFrameSource(cc::BeginFrameSource* source) override; void SetBeginFrameSource(cc::BeginFrameSource* source) override;
#endif // !defined(OS_MACOSX) #endif // !defined(OS_MACOSX)

View file

@ -12,7 +12,7 @@
#include "ui/display/screen.h" #include "ui/display/screen.h"
#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/wm/public/drag_drop_client.h" #include "ui/aura/client/drag_drop_client.h"
namespace atom { namespace atom {

View file

@ -18,6 +18,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "third_party/wtl/include/atlapp.h" #include "third_party/wtl/include/atlapp.h"
#include "third_party/wtl/include/atldlgs.h" #include "third_party/wtl/include/atldlgs.h"
@ -143,7 +144,7 @@ class FileDialog {
struct RunState { struct RunState {
base::Thread* dialog_thread; base::Thread* dialog_thread;
base::MessageLoop* ui_message_loop; scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner;
}; };
bool CreateDialogThread(RunState* run_state) { bool CreateDialogThread(RunState* run_state) {
@ -154,7 +155,7 @@ bool CreateDialogThread(RunState* run_state) {
return false; return false;
run_state->dialog_thread = thread.release(); run_state->dialog_thread = thread.release();
run_state->ui_message_loop = base::MessageLoop::current(); run_state->ui_task_runner = base::ThreadTaskRunnerHandle::Get();
return true; return true;
} }
@ -169,9 +170,9 @@ void RunOpenDialogInNewThread(const RunState& run_state,
std::vector<base::FilePath> paths; std::vector<base::FilePath> paths;
bool result = ShowOpenDialog(parent, title, button_label, default_path, bool result = ShowOpenDialog(parent, title, button_label, default_path,
filters, properties, &paths); filters, properties, &paths);
run_state.ui_message_loop->PostTask(FROM_HERE, run_state.ui_task_runner->PostTask(FROM_HERE,
base::Bind(callback, result, paths)); base::Bind(callback, result, paths));
run_state.ui_message_loop->DeleteSoon(FROM_HERE, run_state.dialog_thread); run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
} }
void RunSaveDialogInNewThread(const RunState& run_state, void RunSaveDialogInNewThread(const RunState& run_state,
@ -184,9 +185,9 @@ void RunSaveDialogInNewThread(const RunState& run_state,
base::FilePath path; base::FilePath path;
bool result = ShowSaveDialog(parent, title, button_label, default_path, bool result = ShowSaveDialog(parent, title, button_label, default_path,
filters, &path); filters, &path);
run_state.ui_message_loop->PostTask(FROM_HERE, run_state.ui_task_runner->PostTask(FROM_HERE,
base::Bind(callback, result, path)); base::Bind(callback, result, path));
run_state.ui_message_loop->DeleteSoon(FROM_HERE, run_state.dialog_thread); run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
} }
} // namespace } // namespace
@ -256,7 +257,7 @@ void ShowOpenDialog(atom::NativeWindow* parent,
return; return;
} }
run_state.dialog_thread->message_loop()->PostTask( run_state.dialog_thread->task_runner()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&RunOpenDialogInNewThread, run_state, parent, title, base::Bind(&RunOpenDialogInNewThread, run_state, parent, title,
button_label, default_path, filters, properties, callback)); button_label, default_path, filters, properties, callback));
@ -295,7 +296,7 @@ void ShowSaveDialog(atom::NativeWindow* parent,
return; return;
} }
run_state.dialog_thread->message_loop()->PostTask( run_state.dialog_thread->task_runner()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&RunSaveDialogInNewThread, run_state, parent, title, base::Bind(&RunSaveDialogInNewThread, run_state, parent, title,
button_label, default_path, filters, callback)); button_label, default_path, filters, callback));

View file

@ -233,7 +233,7 @@ void ShowMessageBox(NativeWindow* parent,
} }
base::Thread* unretained = thread.release(); base::Thread* unretained = thread.release();
unretained->message_loop()->PostTask( unretained->task_runner()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&RunMessageBoxInNewThread, base::Unretained(unretained), base::Bind(&RunMessageBoxInNewThread, base::Unretained(unretained),
parent, type, buttons, default_id, cancel_id, options, title, parent, type, buttons, default_id, cancel_id, options, title,

View file

@ -10,6 +10,7 @@
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
#include "ui/gfx/text_utils.h" #include "ui/gfx/text_utils.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/ink_drop_host_view.h" #include "ui/views/animation/ink_drop_host_view.h"
#include "ui/views/controls/button/label_button_border.h" #include "ui/views/controls/button/label_button_border.h"
@ -59,28 +60,20 @@ SubmenuButton::~SubmenuButton() {
std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple() std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
const { const {
return base::MakeUnique<views::FloodFillInkDropRipple>( std::unique_ptr<views::InkDropRipple> ripple(
GetLocalBounds(), new views::FloodFillInkDropRipple(
GetInkDropCenterBasedOnLastEvent(), size(),
GetInkDropBaseColor(), GetInkDropCenterBasedOnLastEvent(),
ink_drop_visible_opacity()); GetInkDropBaseColor(),
ink_drop_visible_opacity()));
return ripple;
} }
std::unique_ptr<views::InkDropHighlight> std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
SubmenuButton::CreateInkDropHighlight() const { std::unique_ptr<views::InkDropImpl> ink_drop =
if (!ShouldShowInkDropHighlight()) CustomButton::CreateDefaultInkDropImpl();
return nullptr; ink_drop->SetShowHighlightOnHover(false);
return std::move(ink_drop);
gfx::Size size = GetLocalBounds().size();
return base::MakeUnique<views::InkDropHighlight>(
size,
kInkDropSmallCornerRadius,
gfx::RectF(gfx::SizeF(size)).CenterPoint(),
GetInkDropBaseColor());
}
bool SubmenuButton::ShouldShowInkDropForFocus() const {
return false;
} }
void SubmenuButton::SetAcceleratorVisibility(bool visible) { void SubmenuButton::SetAcceleratorVisibility(bool visible) {

View file

@ -31,9 +31,7 @@ class SubmenuButton : public views::MenuButton {
// views::InkDropHostView: // views::InkDropHostView:
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() std::unique_ptr<views::InkDrop> CreateInkDrop() override;
const override;
bool ShouldShowInkDropForFocus() const override;
private: private:
bool GetUnderlinePosition(const base::string16& text, bool GetUnderlinePosition(const base::string16& text,

View file

@ -86,9 +86,8 @@ NotifyIconHost::~NotifyIconHost() {
if (atom_) if (atom_)
UnregisterClass(MAKEINTATOM(atom_), instance_); UnregisterClass(MAKEINTATOM(atom_), instance_);
NotifyIcons copied_container(notify_icons_); for (NotifyIcon* ptr : notify_icons_)
base::STLDeleteContainerPointers( delete ptr;
copied_container.begin(), copied_container.end());
} }
NotifyIcon* NotifyIconHost::CreateNotifyIcon() { NotifyIcon* NotifyIconHost::CreateNotifyIcon() {

View file

@ -38,7 +38,7 @@ class RefCountedTempDir
public: public:
RefCountedTempDir() { ignore_result(temp_dir_.CreateUniqueTempDir()); } RefCountedTempDir() { ignore_result(temp_dir_.CreateUniqueTempDir()); }
bool IsValid() const { return temp_dir_.IsValid(); } bool IsValid() const { return temp_dir_.IsValid(); }
const base::FilePath& GetPath() const { return temp_dir_.path(); } const base::FilePath& GetPath() const { return temp_dir_.GetPath(); }
private: private:
friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>; friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>;

View file

@ -418,7 +418,7 @@ void PrintJob::ControlledWorkerShutdown() {
// Delay shutdown until the worker terminates. We want this code path // Delay shutdown until the worker terminates. We want this code path
// to wait on the thread to quit before continuing. // to wait on the thread to quit before continuing.
if (worker_->IsRunning()) { if (worker_->IsRunning()) {
base::MessageLoop::current()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, FROM_HERE,
base::Bind(&PrintJob::ControlledWorkerShutdown, this), base::Bind(&PrintJob::ControlledWorkerShutdown, this),
base::TimeDelta::FromMilliseconds(100)); base::TimeDelta::FromMilliseconds(100));

View file

@ -36,7 +36,7 @@ ColorChooserDialog::ColorChooserDialog(views::ColorChooserListener* listener,
HWND owning_hwnd = views::HWNDForNativeWindow(owning_window); HWND owning_hwnd = views::HWNDForNativeWindow(owning_window);
ExecuteOpenParams execute_params(initial_color, BeginRun(owning_hwnd), ExecuteOpenParams execute_params(initial_color, BeginRun(owning_hwnd),
owning_hwnd); owning_hwnd);
execute_params.run_state.dialog_thread->message_loop()->PostTask(FROM_HERE, execute_params.run_state.dialog_thread->task_runner()->PostTask(FROM_HERE,
base::Bind(&ColorChooserDialog::ExecuteOpen, this, execute_params)); base::Bind(&ColorChooserDialog::ExecuteOpen, this, execute_params));
} }

View file

@ -105,30 +105,21 @@ bool PrintingHandlerWin::RenderPdfPageToMetafile(int page_number,
// original coordinates and we'll be able to print in full resolution. // original coordinates and we'll be able to print in full resolution.
// Before playback we'll need to counter the scaling up that will happen // Before playback we'll need to counter the scaling up that will happen
// in the service (print_system_win.cc). // in the service (print_system_win.cc).
*scale_factor = *scale_factor = gfx::CalculatePageScale(
gfx::CalculatePageScale(metafile.context(), metafile.context(), pdf_rendering_settings_.area.right(),
pdf_rendering_settings_.area().right(), pdf_rendering_settings_.area.bottom());
pdf_rendering_settings_.area().bottom());
gfx::ScaleDC(metafile.context(), *scale_factor); gfx::ScaleDC(metafile.context(), *scale_factor);
// The underlying metafile is of type Emf and ignores the arguments passed // The underlying metafile is of type Emf and ignores the arguments passed
// to StartPage. // to StartPage.
metafile.StartPage(gfx::Size(), gfx::Rect(), 1); metafile.StartPage(gfx::Size(), gfx::Rect(), 1);
if (!chrome_pdf::RenderPDFPageToDC( if (!chrome_pdf::RenderPDFPageToDC(
&pdf_data_.front(), &pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(),
pdf_data_.size(), pdf_rendering_settings_.dpi, pdf_rendering_settings_.area.x(),
page_number, pdf_rendering_settings_.area.y(),
metafile.context(), pdf_rendering_settings_.area.width(),
pdf_rendering_settings_.dpi(), pdf_rendering_settings_.area.height(), true, false, true, true,
pdf_rendering_settings_.area().x(), pdf_rendering_settings_.autorotate)) {
pdf_rendering_settings_.area().y(),
pdf_rendering_settings_.area().width(),
pdf_rendering_settings_.area().height(),
true,
false,
true,
true,
pdf_rendering_settings_.autorotate())) {
return false; return false;
} }
metafile.FinishPage(); metafile.FinishPage();

View file

@ -277,6 +277,7 @@
'msvs_disabled_warnings': [ 'msvs_disabled_warnings': [
4005, # (node.h) macro redefinition 4005, # (node.h) macro redefinition
4091, # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared 4091, # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared
4099, # (pdf_render_settings.h) type name first seen using 'class' now seen using 'struct'
4189, # local variable is initialized but not referenced 4189, # local variable is initialized but not referenced
4201, # (uv.h) nameless struct/union 4201, # (uv.h) nameless struct/union
4267, # conversion from 'size_t' to 'int', possible loss of data 4267, # conversion from 'size_t' to 'int', possible loss of data

View file

@ -9,7 +9,7 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \ BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent' 'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \ LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
'455a133fe14b5e33ac6b4fc7f8844ace1cd0a221' 'b71afafe59998daf0cb275b50140378b8c88b101'
PLATFORM = { PLATFORM = {
'cygwin': 'win32', 'cygwin': 'win32',

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit a400856b41aa0485a4b43ba1714c84fef4bb06f8 Subproject commit 51b4ff84b282d11d559a425253845f850bf3279b