|
|
Chromium Code Reviews
DescriptionSetup DiscardableMemory for ash process
Move DiscardableMemory client side setup code from MusClient to
WIndowTreeClient, so the discardable memory will work not only
in regular mus clients but also in the window manager (ash).
BUG=654678
Review-Url: https://codereview.chromium.org/2741063002
Cr-Commit-Position: refs/heads/master@{#457081}
Committed: https://chromium.googlesource.com/chromium/src/+/23063f03278074e92ea6b70efa36280e95df05a5
Patch Set 1 #
Total comments: 3
Patch Set 2 : WIP #
Total comments: 2
Patch Set 3 : Fix issues. #
Total comments: 4
Patch Set 4 : Fix review issues #Patch Set 5 : Fix mash_unittests #Patch Set 6 : Rebase #
Messages
Total messages: 58 (36 generated)
The CQ bit was checked by penghuang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
penghuang@chromium.org changed reviewers: + jamescook@chromium.org
Hi James, PTAL. Thanks.
Thanks for looking at this. https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... File ash/mus/window_manager_application.cc (right): https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... ash/mus/window_manager_application.cc:119: "ash_mus_resources_200.pak", io_task_runner, Can you add a comment somewhere (maybe in the AuraInit constructor) that emphasizes that the IO task runner parameter really is for IPC and not for file IO? At first I thought the task runner was related to loading the .pak files and hence should be the FILE thread. https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... ash/mus/window_manager_application.cc:123: discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; This block of code seems like it should live down in //ui/views/mus. It seems like discardable memory could be used by anyone who uses skia. AuraInit sometimes constructs a MusClient and MusClient creates a discardable memory allocator, so it seems like it should go down there. WDYT?
On 2017/03/09 21:00:22, James Cook wrote: > Thanks for looking at this. > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > File ash/mus/window_manager_application.cc (right): > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > ash/mus/window_manager_application.cc:119: "ash_mus_resources_200.pak", > io_task_runner, > Can you add a comment somewhere (maybe in the AuraInit constructor) that > emphasizes that the IO task runner parameter really is for IPC and not for file > IO? At first I thought the task runner was related to loading the .pak files and > hence should be the FILE thread. > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > ash/mus/window_manager_application.cc:123: > discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; > This block of code seems like it should live down in //ui/views/mus. It seems > like discardable memory could be used by anyone who uses skia. AuraInit > sometimes constructs a MusClient and MusClient creates a discardable memory > allocator, so it seems like it should go down there. WDYT? You might ask sky or sadrul for an opinion on this -- I'm not too familiar with the aura/mus init down in src/ui.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
penghuang@chromium.org changed reviewers: + sky@chromium.org
Hi Scott, what's your opinion about where should we put the discardable memory allocator? Thanks. https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... File ash/mus/window_manager_application.cc (right): https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... ash/mus/window_manager_application.cc:123: discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; On 2017/03/09 21:00:21, James Cook wrote: > This block of code seems like it should live down in //ui/views/mus. It seems > like discardable memory could be used by anyone who uses skia. AuraInit > sometimes constructs a MusClient and MusClient creates a discardable memory > allocator, so it seems like it should go down there. WDYT? +sky, for his opinion.
On 2017/03/09 21:35:43, Peng wrote: > Hi Scott, what's your opinion about where should we put the discardable memory > allocator? Thanks. > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > File ash/mus/window_manager_application.cc (right): > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > ash/mus/window_manager_application.cc:123: > discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; > On 2017/03/09 21:00:21, James Cook wrote: > > This block of code seems like it should live down in //ui/views/mus. It seems > > like discardable memory could be used by anyone who uses skia. AuraInit > > sometimes constructs a MusClient and MusClient creates a discardable memory > > allocator, so it seems like it should go down there. WDYT? > > +sky, for his opinion. I'm not familiar with discardable_memory::ClientDiscardableSharedMemoryManager. What code requires it's use? If any app using aura-mus needs to use discardable_memory::ClientDiscardableSharedMemoryManager, then ui/aura/mus/WindowTreeClient is likely the place to own discardable_memory::ClientDiscardableSharedMemoryManager.
On 2017/03/09 23:27:33, sky wrote: > On 2017/03/09 21:35:43, Peng wrote: > > Hi Scott, what's your opinion about where should we put the discardable memory > > allocator? Thanks. > > > > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > > File ash/mus/window_manager_application.cc (right): > > > > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > > ash/mus/window_manager_application.cc:123: > > discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; > > On 2017/03/09 21:00:21, James Cook wrote: > > > This block of code seems like it should live down in //ui/views/mus. It > seems > > > like discardable memory could be used by anyone who uses skia. AuraInit > > > sometimes constructs a MusClient and MusClient creates a discardable memory > > > allocator, so it seems like it should go down there. WDYT? > > > > +sky, for his opinion. > > I'm not familiar with discardable_memory::ClientDiscardableSharedMemoryManager. > What code requires it's use? If any app using aura-mus needs to use > discardable_memory::ClientDiscardableSharedMemoryManager, then > ui/aura/mus/WindowTreeClient is likely the place to own > discardable_memory::ClientDiscardableSharedMemoryManager. I found views::MusClient, ash::mus::WindowManager and ash::mus::WindowManagerApplication have some similar code. Maybe we can merge some similar code, and let ash use views::MusClient as well. In that case, all mus related services will be initialized in MusClient (including discardable memory). WDYT?
The common class all use now is ui/aura/mus/WindowTreeClientClient. Is it possible to upt the code there? On Fri, Mar 10, 2017 at 8:31 AM, <penghuang@chromium.org> wrote: > On 2017/03/09 23:27:33, sky wrote: >> On 2017/03/09 21:35:43, Peng wrote: >> > Hi Scott, what's your opinion about where should we put the discardable > memory >> > allocator? Thanks. >> > >> > >> > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... >> > File ash/mus/window_manager_application.cc (right): >> > >> > >> > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... >> > ash/mus/window_manager_application.cc:123: >> > discardable_memory::mojom::DiscardableSharedMemoryManagerPtr >> > manager_ptr; >> > On 2017/03/09 21:00:21, James Cook wrote: >> > > This block of code seems like it should live down in //ui/views/mus. >> > > It >> seems >> > > like discardable memory could be used by anyone who uses skia. >> > > AuraInit >> > > sometimes constructs a MusClient and MusClient creates a discardable > memory >> > > allocator, so it seems like it should go down there. WDYT? >> > >> > +sky, for his opinion. >> >> I'm not familiar with > discardable_memory::ClientDiscardableSharedMemoryManager. >> What code requires it's use? If any app using aura-mus needs to use >> discardable_memory::ClientDiscardableSharedMemoryManager, then >> ui/aura/mus/WindowTreeClient is likely the place to own >> discardable_memory::ClientDiscardableSharedMemoryManager. > > I found views::MusClient, ash::mus::WindowManager and > ash::mus::WindowManagerApplication have some > similar code. Maybe we can merge some similar code, and let ash use > views::MusClient as well. > In that case, all mus related services will be initialized in MusClient > (including discardable memory). > WDYT? > > https://codereview.chromium.org/2741063002/ -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by penghuang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Setup DiscardableMemory in ash process BUG=654678 ========== to ========== Setup DiscardableMemory in ash process Move DiscardableMemory client side setup code from MusClient to WIndowTreeClient, so the discardable memory will work not only in regular mus clients but also in the window manager (ash). BUG=654678 ==========
Description was changed from ========== Setup DiscardableMemory in ash process Move DiscardableMemory client side setup code from MusClient to WIndowTreeClient, so the discardable memory will work not only in regular mus clients but also in the window manager (ash). BUG=654678 ========== to ========== Setup DiscardableMemory for ash process Move DiscardableMemory client side setup code from MusClient to WIndowTreeClient, so the discardable memory will work not only in regular mus clients but also in the window manager (ash). BUG=654678 ==========
I updated the CL to put it in ui/aura/mus/window_tree_client.cc. PTAL. Thanks. On 2017/03/10 20:23:52, sky wrote: > The common class all use now is ui/aura/mus/WindowTreeClientClient. Is > it possible to upt the code there? > > On Fri, Mar 10, 2017 at 8:31 AM, <mailto:penghuang@chromium.org> wrote: > > On 2017/03/09 23:27:33, sky wrote: > >> On 2017/03/09 21:35:43, Peng wrote: > >> > Hi Scott, what's your opinion about where should we put the discardable > > memory > >> > allocator? Thanks. > >> > > >> > > >> > > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > >> > File ash/mus/window_manager_application.cc (right): > >> > > >> > > >> > > > https://codereview.chromium.org/2741063002/diff/1/ash/mus/window_manager_appl... > >> > ash/mus/window_manager_application.cc:123: > >> > discardable_memory::mojom::DiscardableSharedMemoryManagerPtr > >> > manager_ptr; > >> > On 2017/03/09 21:00:21, James Cook wrote: > >> > > This block of code seems like it should live down in //ui/views/mus. > >> > > It > >> seems > >> > > like discardable memory could be used by anyone who uses skia. > >> > > AuraInit > >> > > sometimes constructs a MusClient and MusClient creates a discardable > > memory > >> > > allocator, so it seems like it should go down there. WDYT? > >> > > >> > +sky, for his opinion. > >> > >> I'm not familiar with > > discardable_memory::ClientDiscardableSharedMemoryManager. > >> What code requires it's use? If any app using aura-mus needs to use > >> discardable_memory::ClientDiscardableSharedMemoryManager, then > >> ui/aura/mus/WindowTreeClient is likely the place to own > >> discardable_memory::ClientDiscardableSharedMemoryManager. > > > > I found views::MusClient, ash::mus::WindowManager and > > ash::mus::WindowManagerApplication have some > > similar code. Maybe we can merge some similar code, and let ash use > > views::MusClient as well. > > In that case, all mus related services will be initialized in MusClient > > (including discardable memory). > > WDYT? > > > > https://codereview.chromium.org/2741063002/ > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org. >
LGTM but I'm not very knowledgeable about this code. https://codereview.chromium.org/2741063002/diff/20001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2741063002/diff/20001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.cc:199: if (!io_task_runner) { nit: Maybe document when io_task_runner can be null. Tests? Certain mus apps?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by penghuang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.cc:233: if (discardable_shared_memory_manager_) Should this be null'd out after the thread is shutdown? https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.h (right): https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.h:103: bool create_discardable_memory = true); Document what create_discardable_memory means and why false might be used.
The CQ bit was checked by penghuang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2741063002/diff/20001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2741063002/diff/20001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.cc:199: if (!io_task_runner) { On 2017/03/13 21:17:15, James Cook wrote: > nit: Maybe document when io_task_runner can be null. Tests? Certain mus apps. Done https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.cc:233: if (discardable_shared_memory_manager_) On 2017/03/14 03:15:34, sky wrote: > Should this be null'd out after the thread is shutdown? SetInstance(nullptr) will prevent the manager being used anymore. And we have to delete the manager before the shutdown the IO thread. See[1], the manager uses the IOThread to destroy the mojo interface ptr. [1]https://cs.chromium.org/chromium/src/components/discardable_memory/client/client_discardable_shared_memory_manager.cc?rcl=5a17deed92877ccc6589dcde406a32a5d21756a5&l=130 https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... File ui/aura/mus/window_tree_client.h (right): https://codereview.chromium.org/2741063002/diff/40001/ui/aura/mus/window_tree... ui/aura/mus/window_tree_client.h:103: bool create_discardable_memory = true); On 2017/03/14 03:15:34, sky wrote: > Document what create_discardable_memory means and why false might be used. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by penghuang@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Ok, LGTM
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by penghuang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jamescook@chromium.org Link to the patchset: https://codereview.chromium.org/2741063002/#ps80001 (title: "Fix mash_unittests")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
penghuang@chromium.org changed reviewers: + reveman@chromium.org
+reveman@chromium.org for DEPS. Hi David, PTAL. Thanks.
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
DEPS changes lgtm
The CQ bit was checked by penghuang@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for ui/views/mus/mus_client.cc:
While running git apply --index -p1;
error: patch failed: ui/views/mus/mus_client.cc:127
error: ui/views/mus/mus_client.cc: patch does not apply
Patch: ui/views/mus/mus_client.cc
Index: ui/views/mus/mus_client.cc
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc
index
d03fe330023562bae0eb1a4c7501bae58b50e42f..c4f26286739f6314295b7ca079de709d26265698
100644
--- a/ui/views/mus/mus_client.cc
+++ b/ui/views/mus/mus_client.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/threading/thread.h"
-#include
"components/discardable_memory/client/client_discardable_shared_memory_manager.h"
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/public/cpp/gpu/gpu.h"
@@ -86,15 +85,6 @@ MusClient::MusClient(service_manager::Connector* connector,
if (create_wm_state)
wm_state_ = base::MakeUnique<wm::WMState>();
- discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
- connector->BindInterface(ui::mojom::kServiceName, &manager_ptr);
-
- discardable_shared_memory_manager_ = base::MakeUnique<
- discardable_memory::ClientDiscardableSharedMemoryManager>(
- std::move(manager_ptr), io_task_runner);
- base::DiscardableMemoryAllocator::SetInstance(
- discardable_shared_memory_manager_.get());
-
window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>(
connector, this, nullptr /* window_manager_delegate */,
nullptr /* window_tree_client_request */, std::move(io_task_runner));
@@ -127,7 +117,6 @@ MusClient::~MusClient() {
ViewsDelegate::NativeWidgetFactory());
}
- base::DiscardableMemoryAllocator::SetInstance(nullptr);
DCHECK_EQ(instance_, this);
instance_ = nullptr;
DCHECK(aura::Env::GetInstance());
The CQ bit was checked by penghuang@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for ui/views/mus/mus_client.cc:
While running git apply --index -p1;
error: patch failed: ui/views/mus/mus_client.cc:127
error: ui/views/mus/mus_client.cc: patch does not apply
Patch: ui/views/mus/mus_client.cc
Index: ui/views/mus/mus_client.cc
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc
index
d03fe330023562bae0eb1a4c7501bae58b50e42f..c4f26286739f6314295b7ca079de709d26265698
100644
--- a/ui/views/mus/mus_client.cc
+++ b/ui/views/mus/mus_client.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/threading/thread.h"
-#include
"components/discardable_memory/client/client_discardable_shared_memory_manager.h"
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/public/cpp/gpu/gpu.h"
@@ -86,15 +85,6 @@ MusClient::MusClient(service_manager::Connector* connector,
if (create_wm_state)
wm_state_ = base::MakeUnique<wm::WMState>();
- discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
- connector->BindInterface(ui::mojom::kServiceName, &manager_ptr);
-
- discardable_shared_memory_manager_ = base::MakeUnique<
- discardable_memory::ClientDiscardableSharedMemoryManager>(
- std::move(manager_ptr), io_task_runner);
- base::DiscardableMemoryAllocator::SetInstance(
- discardable_shared_memory_manager_.get());
-
window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>(
connector, this, nullptr /* window_manager_delegate */,
nullptr /* window_tree_client_request */, std::move(io_task_runner));
@@ -127,7 +117,6 @@ MusClient::~MusClient() {
ViewsDelegate::NativeWidgetFactory());
}
- base::DiscardableMemoryAllocator::SetInstance(nullptr);
DCHECK_EQ(instance_, this);
instance_ = nullptr;
DCHECK(aura::Env::GetInstance());
The CQ bit was checked by penghuang@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jamescook@chromium.org, reveman@chromium.org, sky@chromium.org Link to the patchset: https://codereview.chromium.org/2741063002/#ps100001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1489586900251440,
"parent_rev": "f235d928f6d89dd7decb34082353a0bde50c6597", "commit_rev":
"23063f03278074e92ea6b70efa36280e95df05a5"}
Message was sent while issue was closed.
Description was changed from ========== Setup DiscardableMemory for ash process Move DiscardableMemory client side setup code from MusClient to WIndowTreeClient, so the discardable memory will work not only in regular mus clients but also in the window manager (ash). BUG=654678 ========== to ========== Setup DiscardableMemory for ash process Move DiscardableMemory client side setup code from MusClient to WIndowTreeClient, so the discardable memory will work not only in regular mus clients but also in the window manager (ash). BUG=654678 Review-Url: https://codereview.chromium.org/2741063002 Cr-Commit-Position: refs/heads/master@{#457081} Committed: https://chromium.googlesource.com/chromium/src/+/23063f03278074e92ea6b70efa36... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/23063f03278074e92ea6b70efa36... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
