Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2929)

Unified Diff: chrome/renderer/render_process_impl.cc

Issue 6537022: Move media library path resolution into Chrome path provider. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: And again, this time with working tests... Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/render_process_impl.cc
diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc
index e3ff26353c74abd28722076227a8178d97e83c5d..d3bf2e0eb62f9bd950cc0bb63b9ab96e9e2cf860 100644
--- a/chrome/renderer/render_process_impl.cc
+++ b/chrome/renderer/render_process_impl.cc
@@ -130,21 +130,18 @@ RenderProcessImpl::RenderProcessImpl()
base::StatisticsRecorder::set_dump_on_exit(true);
}
-#if defined(OS_MACOSX)
- FilePath bundle_path = base::mac::MainAppBundlePath();
-
- initialized_media_library_ =
- media::InitializeMediaLibrary(bundle_path.Append("Libraries"));
-#else
- FilePath module_path;
- initialized_media_library_ =
- PathService::Get(base::DIR_MODULE, &module_path) &&
- media::InitializeMediaLibrary(module_path);
+ // Note that under Linux, the media library will normally already have
+ // been initialized by the Zygote before this instance became a Renderer.
+ FilePath media_path;
+ if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path))
+ media::InitializeMediaLibrary(media_path);
+#if !defined(OS_MACOSX)
// TODO(hclam): Add more checks here. Currently this is not used.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (media::IsMediaLibraryInitialized() &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableOpenMax)) {
- media::InitializeOpenMaxLibrary(module_path);
+ media::InitializeOpenMaxLibrary(media_path);
}
#endif
@@ -265,7 +262,7 @@ bool RenderProcessImpl::UseInProcessPlugins() const {
}
bool RenderProcessImpl::HasInitializedMediaLibrary() const {
- return initialized_media_library_;
+ return media::IsMediaLibraryInitialized();
}
bool RenderProcessImpl::GetTransportDIBFromCache(TransportDIB** mem,

Powered by Google App Engine
This is Rietveld 408576698