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.
Inject GPUDataManager support into ash to abstract a content dependency.
http://crbug.com/332504 R=oshima@chromium.org Review URL: https://codereview.chromium.org/138223004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245010 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
ben@chromium.org
committed
Jan 15, 2014
1 parent
9ac9a8e
commit ac12ae9
Showing
18 changed files
with
187 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include_rules = [ | ||
# TODO(beng): It may make sense to have a broad permit of content/public | ||
# in this file, but I'm starting out conservative. | ||
"+content/public/browser/gpu_data_manager.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
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,32 @@ | ||
// Copyright 2014 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 "ash/content_support/gpu_support_impl.h" | ||
|
||
#include "content/public/browser/gpu_data_manager.h" | ||
#include "gpu/config/gpu_feature_type.h" | ||
|
||
namespace ash { | ||
|
||
GPUSupportImpl::GPUSupportImpl() { | ||
} | ||
|
||
GPUSupportImpl::~GPUSupportImpl() { | ||
} | ||
|
||
bool GPUSupportImpl::IsPanelFittingDisabled() const { | ||
return content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | ||
gpu::GPU_FEATURE_TYPE_PANEL_FITTING); | ||
} | ||
|
||
void GPUSupportImpl::DisableGpuWatchdog() { | ||
content::GpuDataManager::GetInstance()->DisableGpuWatchdog(); | ||
} | ||
|
||
void GPUSupportImpl::GetGpuProcessHandles( | ||
const GetGpuProcessHandlesCallback& callback) const { | ||
content::GpuDataManager::GetInstance()->GetGpuProcessHandles(callback); | ||
} | ||
|
||
} // namespace ash |
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,29 @@ | ||
// Copyright 2014 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 ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_H_ | ||
#define ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_H_ | ||
|
||
#include "ash/gpu_support.h" | ||
|
||
namespace ash { | ||
|
||
class GPUSupportImpl : public GPUSupport { | ||
public: | ||
GPUSupportImpl(); | ||
virtual ~GPUSupportImpl(); | ||
|
||
private: | ||
// Overridden from GPUSupport: | ||
virtual bool IsPanelFittingDisabled() const OVERRIDE; | ||
virtual void DisableGpuWatchdog() OVERRIDE; | ||
virtual void GetGpuProcessHandles( | ||
const GetGpuProcessHandlesCallback& callback) const OVERRIDE; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(GPUSupportImpl); | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2014 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 "ash/content_support/inject.h" | ||
|
||
#include "ash/content_support/gpu_support_impl.h" | ||
#include "ash/shell.h" | ||
|
||
namespace ash { | ||
|
||
void InitContentSupport() { | ||
scoped_ptr<GPUSupportImpl> gpu_support(new GPUSupportImpl); | ||
Shell::GetInstance()->SetGPUSupport(gpu_support.Pass()); | ||
} | ||
|
||
} // namespace ash |
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,16 @@ | ||
// Copyright 2014 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 ASH_CONTENT_SUPPORT_INJECT_H_ | ||
#define ASH_CONTENT_SUPPORT_INJECT_H_ | ||
|
||
#include "ash/content_support/ash_with_content_export.h" | ||
|
||
namespace ash { | ||
|
||
ASH_WITH_CONTENT_EXPORT void InitContentSupport(); | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_CONTENT_SUPPORT_INJECT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2014 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 ASH_GPU_SUPPORT_H_ | ||
#define ASH_GPU_SUPPORT_H_ | ||
|
||
#include <list> | ||
|
||
#include "base/callback_forward.h" | ||
#include "base/process/process.h" | ||
|
||
namespace ash { | ||
|
||
// An interface to allow use of content::GpuDataManager to be injected in | ||
// configurations that permit a dependency on content. | ||
class GPUSupport { | ||
public: | ||
typedef base::Callback<void(const std::list<base::ProcessHandle>&)> | ||
GetGpuProcessHandlesCallback; | ||
|
||
virtual ~GPUSupport() {} | ||
|
||
virtual bool IsPanelFittingDisabled() const = 0; | ||
|
||
virtual void DisableGpuWatchdog() = 0; | ||
|
||
virtual void GetGpuProcessHandles( | ||
const GetGpuProcessHandlesCallback& callback) const = 0; | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_GPU_SUPPORT_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
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