forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add message_loop_type to GpuPreferences
Currently, the GPU process checks ui::OzonePlatform to determine the type of message loop it should use. This means GPU process needs to access ui::OzonePlatform instance before the instance is properly initialized. If we check ui::OzonePlatform on the GPU host side and send it to the GPU process via GpuPreferences, we can avoid accessing ui::OzonePlatform before it being initialized. BUG=958387 Change-Id: I7817cd317455f24fb55c5c8f5b8ea078a51b84b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678160 Reviewed-by: kylechar <kylechar@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Mohsen Izadi <mohsen@chromium.org> Cr-Commit-Position: refs/heads/master@{#677743}
- Loading branch information
Mohsen Izadi
authored and
Commit Bot
committed
Jul 16, 2019
1 parent
4509ea8
commit d66900e
Showing
18 changed files
with
191 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2019 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. | ||
|
||
mojom = "//mojo/public/mojom/base/message_loop_type.mojom" | ||
public_headers = [ "//base/message_loop/message_loop.h" ] | ||
traits_headers = [ "//mojo/public/cpp/base/message_loop_type_mojom_traits.h" ] | ||
sources = [ | ||
"//mojo/public/cpp/base/message_loop_type_mojom_traits.cc", | ||
"//mojo/public/cpp/base/message_loop_type_mojom_traits.h", | ||
] | ||
public_deps = [ | ||
"//base", | ||
] | ||
type_mappings = [ "mojo_base.mojom.MessageLoopType=base::MessageLoop::Type" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2019 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 "mojo/public/cpp/base/message_loop_type_mojom_traits.h" | ||
#include "build/build_config.h" | ||
|
||
namespace mojo { | ||
|
||
// static | ||
mojo_base::mojom::MessageLoopType | ||
EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type>::ToMojom( | ||
base::MessageLoop::Type input) { | ||
switch (input) { | ||
case base::MessageLoop::TYPE_DEFAULT: | ||
return mojo_base::mojom::MessageLoopType::kDefault; | ||
case base::MessageLoop::TYPE_UI: | ||
return mojo_base::mojom::MessageLoopType::kUi; | ||
case base::MessageLoop::TYPE_CUSTOM: | ||
return mojo_base::mojom::MessageLoopType::kCustom; | ||
case base::MessageLoop::TYPE_IO: | ||
return mojo_base::mojom::MessageLoopType::kIo; | ||
#if defined(OS_ANDROID) | ||
case base::MessageLoop::TYPE_JAVA: | ||
return mojo_base::mojom::MessageLoopType::kJava; | ||
#endif | ||
#if defined(OS_MACOSX) | ||
case base::MessageLoop::Type::NS_RUNLOOP: | ||
return mojo_base::mojom::MessageLoopType::kNsRunloop; | ||
#endif | ||
#if defined(OS_WIN) | ||
case base::MessageLoop::Type::UI_WITH_WM_QUIT_SUPPORT: | ||
return mojo_base::mojom::MessageLoopType::kUiWithWmQuitSupport; | ||
#endif | ||
} | ||
NOTREACHED(); | ||
return mojo_base::mojom::MessageLoopType::kDefault; | ||
} | ||
|
||
// static | ||
bool EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type>:: | ||
FromMojom(mojo_base::mojom::MessageLoopType input, | ||
base::MessageLoop::Type* output) { | ||
switch (input) { | ||
case mojo_base::mojom::MessageLoopType::kDefault: | ||
*output = base::MessageLoop::TYPE_DEFAULT; | ||
return true; | ||
case mojo_base::mojom::MessageLoopType::kUi: | ||
*output = base::MessageLoop::TYPE_UI; | ||
return true; | ||
case mojo_base::mojom::MessageLoopType::kCustom: | ||
*output = base::MessageLoop::TYPE_CUSTOM; | ||
return true; | ||
case mojo_base::mojom::MessageLoopType::kIo: | ||
*output = base::MessageLoop::TYPE_IO; | ||
return true; | ||
#if defined(OS_ANDROID) | ||
case mojo_base::mojom::MessageLoopType::kJava: | ||
*output = base::MessageLoop::TYPE_JAVA; | ||
return true; | ||
#endif | ||
#if defined(OS_MACOSX) | ||
case mojo_base::mojom::MessageLoopType::kNsRunloop: | ||
*output = base::MessageLoop::Type::NS_RUNLOOP; | ||
return true; | ||
#endif | ||
#if defined(OS_WIN) | ||
case mojo_base::mojom::MessageLoopType::kUiWithWmQuitSupport: | ||
*output = base::MessageLoop::Type::UI_WITH_WM_QUIT_SUPPORT; | ||
return true; | ||
#endif | ||
} | ||
return false; | ||
} | ||
|
||
} // namespace mojo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2019 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. | ||
|
||
#ifndef MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ | ||
#define MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ | ||
|
||
#include "base/component_export.h" | ||
#include "base/message_loop/message_loop.h" | ||
#include "mojo/public/cpp/bindings/struct_traits.h" | ||
#include "mojo/public/mojom/base/message_loop_type.mojom.h" | ||
|
||
namespace mojo { | ||
|
||
template <> | ||
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) | ||
EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type> { | ||
static mojo_base::mojom::MessageLoopType ToMojom( | ||
base::MessageLoop::Type input); | ||
static bool FromMojom(mojo_base::mojom::MessageLoopType input, | ||
base::MessageLoop::Type* output); | ||
}; | ||
|
||
} // namespace mojo | ||
|
||
#endif // MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.