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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 7104144: Get rid of the following dependencies from content: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 years, 6 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
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | content/browser/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_process_observer.cc
===================================================================
--- chrome/renderer/chrome_render_process_observer.cc (revision 88923)
+++ chrome/renderer/chrome_render_process_observer.cc (working copy)
@@ -26,6 +26,8 @@
#include "content/renderer/render_view.h"
#include "content/renderer/render_view_visitor.h"
#include "crypto/nss_util.h"
+#include "media/base/media.h"
+#include "media/base/media_switches.h"
#include "net/base/net_errors.h"
#include "net/base/net_module.h"
#include "third_party/sqlite/sqlite3.h"
@@ -34,6 +36,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflightResultCache.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "v8/include/v8.h"
@@ -49,6 +52,7 @@
using WebKit::WebCache;
using WebKit::WebCrossOriginPreflightResultCache;
using WebKit::WebFontCache;
+using WebKit::WebRuntimeFeatures;
namespace {
@@ -379,6 +383,22 @@
std::string error;
base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error);
#endif
+
+ // 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;
+ PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path);
+ if (!media_path.empty())
+ media::InitializeMediaLibrary(media_path);
+
+#if !defined(OS_MACOSX)
+ // TODO(hclam): Add more checks here. Currently this is not used.
+ if (media::IsMediaLibraryInitialized() &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOpenMax)) {
+ media::InitializeOpenMaxLibrary(media_path);
+ }
+#endif
}
ChromeRenderProcessObserver::~ChromeRenderProcessObserver() {
@@ -405,6 +425,15 @@
return handled;
}
+void ChromeRenderProcessObserver::WebKitInitialized() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ WebRuntimeFeatures::enableMediaPlayer(media::IsMediaLibraryInitialized());
+
+ WebRuntimeFeatures::enableSpellCheckAPI(
+ !command_line.HasSwitch(switches::kDisableSpellcheckAPI));
+}
+
void ChromeRenderProcessObserver::OnSetIsIncognitoProcess(
bool is_incognito_process) {
is_incognito_process_ = is_incognito_process;
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | content/browser/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698