Fix Debug building on Windows
authorCheng Zhao <zcbenz@gmail.com>
Thu, 26 Jan 2017 07:10:28 +0000 (16:10 +0900)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 6 Feb 2017 18:34:29 +0000 (10:34 -0800)
15 files changed:
atom/browser/osr/osr_render_widget_host_view.cc
atom/browser/osr/osr_render_widget_host_view.h
atom/browser/ui/drag_util_views.cc
atom/browser/ui/file_dialog_win.cc
atom/browser/ui/message_box_win.cc
atom/browser/ui/views/submenu_button.cc
atom/browser/ui/views/submenu_button.h
atom/browser/ui/win/notify_icon_host.cc
chromium_src/chrome/browser/printing/pdf_to_emf_converter.cc
chromium_src/chrome/browser/printing/print_job.cc
chromium_src/chrome/browser/ui/views/color_chooser_dialog.cc
chromium_src/chrome/utility/printing_handler_win.cc
common.gypi
script/lib/config.py
vendor/brightray

index d5452a7..7355f1a 100644 (file)
@@ -20,6 +20,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/context_factory.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_type.h"
 #include "ui/events/latency_info.h"
@@ -349,14 +350,16 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
       is_showing_(!render_widget_host_->is_hidden()),
       size_(native_window->GetSize()),
       painting_(true),
-#if !defined(OS_MACOSX)
-      delegated_frame_host_(new content::DelegatedFrameHost(this)),
-#endif
       weak_ptr_factory_(this) {
   DCHECK(render_widget_host_);
   render_widget_host_->SetView(this);
 
 #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));
 #endif
 
@@ -743,16 +746,6 @@ OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
       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(
     cc::BeginFrameSource* source) {
 }
index ca5dae5..7380476 100644 (file)
@@ -160,12 +160,9 @@ class OffScreenRenderWidgetHostView
     bool defer_compositor_lock) override;
   void DelegatedFrameHostResizeLockWasReleased(void) override;
   void DelegatedFrameHostSendReclaimCompositorResources(
-    int output_surface_id,
-    bool is_swap_ack,
-    const cc::ReturnedResourceArray& resources) override;
-  void DelegatedFrameHostOnLostCompositorResources(void) override;
-  void DelegatedFrameHostUpdateVSyncParameters(
-    const base::TimeTicks &, const base::TimeDelta &) override;
+      int output_surface_id,
+      bool is_swap_ack,
+      const cc::ReturnedResourceArray& resources) override;
   void SetBeginFrameSource(cc::BeginFrameSource* source) override;
 #endif  // !defined(OS_MACOSX)
 
index 058aed4..2c78574 100644 (file)
@@ -12,7 +12,7 @@
 #include "ui/display/screen.h"
 #include "ui/gfx/geometry/point.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 {
 
index cab4e21..8e97343 100644 (file)
@@ -18,6 +18,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread.h"
+#include "base/threading/thread_task_runner_handle.h"
 #include "base/win/registry.h"
 #include "third_party/wtl/include/atlapp.h"
 #include "third_party/wtl/include/atldlgs.h"
@@ -143,7 +144,7 @@ class FileDialog {
 
 struct RunState {
   base::Thread* dialog_thread;
-  base::MessageLoop* ui_message_loop;
+  scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner;
 };
 
 bool CreateDialogThread(RunState* run_state) {
@@ -154,7 +155,7 @@ bool CreateDialogThread(RunState* run_state) {
     return false;
 
   run_state->dialog_thread = thread.release();
-  run_state->ui_message_loop = base::MessageLoop::current();
+  run_state->ui_task_runner = base::ThreadTaskRunnerHandle::Get();
   return true;
 }
 
@@ -169,9 +170,9 @@ void RunOpenDialogInNewThread(const RunState& run_state,
   std::vector<base::FilePath> paths;
   bool result = ShowOpenDialog(parent, title, button_label, default_path,
                                filters, properties, &paths);
-  run_state.ui_message_loop->PostTask(FROM_HERE,
+  run_state.ui_task_runner->PostTask(FROM_HERE,
                                       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,
@@ -184,9 +185,9 @@ void RunSaveDialogInNewThread(const RunState& run_state,
   base::FilePath path;
   bool result = ShowSaveDialog(parent, title, button_label, default_path,
                                filters, &path);
-  run_state.ui_message_loop->PostTask(FROM_HERE,
-                                      base::Bind(callback, result, path));
-  run_state.ui_message_loop->DeleteSoon(FROM_HERE, run_state.dialog_thread);
+  run_state.ui_task_runner->PostTask(FROM_HERE,
+                                     base::Bind(callback, result, path));
+  run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
 }
 
 }  // namespace
@@ -256,7 +257,7 @@ void ShowOpenDialog(atom::NativeWindow* parent,
     return;
   }
 
-  run_state.dialog_thread->message_loop()->PostTask(
+  run_state.dialog_thread->task_runner()->PostTask(
       FROM_HERE,
       base::Bind(&RunOpenDialogInNewThread, run_state, parent, title,
                  button_label, default_path, filters, properties, callback));
@@ -295,7 +296,7 @@ void ShowSaveDialog(atom::NativeWindow* parent,
     return;
   }
 
-  run_state.dialog_thread->message_loop()->PostTask(
+  run_state.dialog_thread->task_runner()->PostTask(
       FROM_HERE,
       base::Bind(&RunSaveDialogInNewThread, run_state, parent, title,
                  button_label, default_path, filters, callback));
index 074e13b..b6777fb 100644 (file)
@@ -233,7 +233,7 @@ void ShowMessageBox(NativeWindow* parent,
   }
 
   base::Thread* unretained = thread.release();
-  unretained->message_loop()->PostTask(
+  unretained->task_runner()->PostTask(
       FROM_HERE,
       base::Bind(&RunMessageBoxInNewThread, base::Unretained(unretained),
                  parent, type, buttons, default_id, cancel_id, options, title,
index f8257b0..d2a4cb6 100644 (file)
@@ -10,6 +10,7 @@
 #include "ui/gfx/color_utils.h"
 #include "ui/gfx/text_utils.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/controls/button/label_button_border.h"
 
@@ -59,28 +60,20 @@ SubmenuButton::~SubmenuButton() {
 
 std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
     const {
-  return base::MakeUnique<views::FloodFillInkDropRipple>(
-      GetLocalBounds(),
-      GetInkDropCenterBasedOnLastEvent(),
-      GetInkDropBaseColor(),
-      ink_drop_visible_opacity());
+  std::unique_ptr<views::InkDropRipple> ripple(
+      new views::FloodFillInkDropRipple(
+          size(),
+          GetInkDropCenterBasedOnLastEvent(),
+          GetInkDropBaseColor(),
+          ink_drop_visible_opacity()));
+  return ripple;
 }
 
-std::unique_ptr<views::InkDropHighlight>
-    SubmenuButton::CreateInkDropHighlight() const {
-  if (!ShouldShowInkDropHighlight())
-    return nullptr;
-
-  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;
+std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
+  std::unique_ptr<views::InkDropImpl> ink_drop =
+      CustomButton::CreateDefaultInkDropImpl();
+  ink_drop->SetShowHighlightOnHover(false);
+  return std::move(ink_drop);
 }
 
 void SubmenuButton::SetAcceleratorVisibility(bool visible) {
index 02e25cd..901234f 100644 (file)
@@ -31,9 +31,7 @@ class SubmenuButton : public views::MenuButton {
 
   // views::InkDropHostView:
   std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
-  std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
-      const override;
-  bool ShouldShowInkDropForFocus() const override;
+  std::unique_ptr<views::InkDrop> CreateInkDrop() override;
 
  private:
   bool GetUnderlinePosition(const base::string16& text,
index d63df90..ee5c8ba 100644 (file)
@@ -86,9 +86,8 @@ NotifyIconHost::~NotifyIconHost() {
   if (atom_)
     UnregisterClass(MAKEINTATOM(atom_), instance_);
 
-  NotifyIcons copied_container(notify_icons_);
-  base::STLDeleteContainerPointers(
-      copied_container.begin(), copied_container.end());
+  for (NotifyIcon* ptr : notify_icons_)
+    delete ptr;
 }
 
 NotifyIcon* NotifyIconHost::CreateNotifyIcon() {
index 17c3796..503d192 100644 (file)
@@ -38,7 +38,7 @@ class RefCountedTempDir
  public:
   RefCountedTempDir() { ignore_result(temp_dir_.CreateUniqueTempDir()); }
   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:
   friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>;
index 1707a6f..5dce9cc 100644 (file)
@@ -418,7 +418,7 @@ void PrintJob::ControlledWorkerShutdown() {
   // Delay shutdown until the worker terminates.  We want this code path
   // to wait on the thread to quit before continuing.
   if (worker_->IsRunning()) {
-    base::MessageLoop::current()->PostDelayedTask(
+    base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
         FROM_HERE,
         base::Bind(&PrintJob::ControlledWorkerShutdown, this),
         base::TimeDelta::FromMilliseconds(100));
index 347f104..5c7882b 100644 (file)
@@ -36,7 +36,7 @@ ColorChooserDialog::ColorChooserDialog(views::ColorChooserListener* listener,
   HWND owning_hwnd = views::HWNDForNativeWindow(owning_window);
   ExecuteOpenParams execute_params(initial_color, BeginRun(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));
 }
 
index 105e574..c29dd5f 100644 (file)
@@ -105,30 +105,21 @@ bool PrintingHandlerWin::RenderPdfPageToMetafile(int page_number,
   // 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
   // in the service (print_system_win.cc).
-  *scale_factor =
-      gfx::CalculatePageScale(metafile.context(),
-                              pdf_rendering_settings_.area().right(),
-                              pdf_rendering_settings_.area().bottom());
+  *scale_factor = gfx::CalculatePageScale(
+      metafile.context(), pdf_rendering_settings_.area.right(),
+      pdf_rendering_settings_.area.bottom());
   gfx::ScaleDC(metafile.context(), *scale_factor);
 
   // The underlying metafile is of type Emf and ignores the arguments passed
   // to StartPage.
   metafile.StartPage(gfx::Size(), gfx::Rect(), 1);
   if (!chrome_pdf::RenderPDFPageToDC(
-          &pdf_data_.front(),
-          pdf_data_.size(),
-          page_number,
-          metafile.context(),
-          pdf_rendering_settings_.dpi(),
-          pdf_rendering_settings_.area().x(),
-          pdf_rendering_settings_.area().y(),
-          pdf_rendering_settings_.area().width(),
-          pdf_rendering_settings_.area().height(),
-          true,
-          false,
-          true,
-          true,
-          pdf_rendering_settings_.autorotate())) {
+          &pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(),
+          pdf_rendering_settings_.dpi, pdf_rendering_settings_.area.x(),
+          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;
   }
   metafile.FinishPage();
index 58c0854..21685f1 100644 (file)
     'msvs_disabled_warnings': [
       4005,  # (node.h) macro redefinition
       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
       4201,  # (uv.h) nameless struct/union
       4267,  # conversion from 'size_t' to 'int', possible loss of data
index ae4d448..6cfffc7 100644 (file)
@@ -9,7 +9,7 @@ import sys
 BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
     'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
 LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
-    '455a133fe14b5e33ac6b4fc7f8844ace1cd0a221'
+    'b71afafe59998daf0cb275b50140378b8c88b101'
 
 PLATFORM = {
   'cygwin': 'win32',
index a400856..51b4ff8 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a400856b41aa0485a4b43ba1714c84fef4bb06f8
+Subproject commit 51b4ff84b282d11d559a425253845f850bf3279b