From c76db0ba1d51a2100a0d920f099dfc4d9226cd4b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 29 Dec 2015 16:41:44 +0800 Subject: [PATCH] Fix coding styles --- atom/app/atom_content_client.cc | 32 +++++----------------- atom/browser/atom_browser_client.cc | 2 +- atom/renderer/atom_renderer_client.cc | 2 +- atom/renderer/atom_renderer_client.h | 1 + .../pepper/widevine_cdm_message_filter.cc | 4 +-- chromium_src/chrome/common/chrome_paths.cc | 3 +- 6 files changed, 13 insertions(+), 31 deletions(-) diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index 18bc36f..997f664 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -19,13 +19,10 @@ #include "content/public/common/pepper_plugin_info.h" #include "content/public/common/user_agent.h" #include "ppapi/shared_impl/ppapi_permissions.h" -#include "url/url_constants.h" - #include "third_party/widevine/cdm/stub/widevine_cdm_version.h" +#include "url/url_constants.h" -// The following must be after widevine_cdm_version.h. #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) -// && !defined(WIDEVINE_CDM_IS_COMPONENT) #include "chrome/common/widevine_cdm_constants.h" #endif @@ -73,10 +70,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, return plugin; } - #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) -//&& !defined(WIDEVINE_CDM_IS_COMPONENT) - content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path, const std::string& version) { content::PepperPluginInfo widevine_cdm; @@ -113,11 +107,7 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path, return widevine_cdm; } - #endif -// defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && -// !defined(WIDEVINE_CDM_IS_COMPONENT) - void ConvertStringWithSeparatorToVector(std::vector* vec, const char* separator, @@ -148,12 +138,11 @@ void AddPepperFlashFromCommandLine( } #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) -//&& !defined(WIDEVINE_CDM_IS_COMPONENT) void AddWidevineCdmFromCommandLine( std::vector* plugins) { auto command_line = base::CommandLine::ForCurrentProcess(); auto widevine_cdm_path = command_line->GetSwitchValueNative( - switches::kWidevineCdmPath); + switches::kWidevineCdmPath); if (widevine_cdm_path.empty()) return; @@ -161,19 +150,14 @@ void AddWidevineCdmFromCommandLine( return; auto widevine_cdm_version = command_line->GetSwitchValueASCII( - switches::kWidevineCdmVersion); + switches::kWidevineCdmVersion); if (widevine_cdm_version.empty()) return; - plugins->push_back( - CreateWidevineCdmInfo(base::FilePath(widevine_cdm_path), - widevine_cdm_version)); + plugins->push_back(CreateWidevineCdmInfo(base::FilePath(widevine_cdm_path), + widevine_cdm_version)); } #endif -// defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && -// !defined(WIDEVINE_CDM_IS_COMPONENT) - - AtomContentClient::AtomContentClient() { } @@ -207,11 +191,9 @@ void AtomContentClient::AddAdditionalSchemes( void AtomContentClient::AddPepperPlugins( std::vector* plugins) { AddPepperFlashFromCommandLine(plugins); - - #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) - //&& !defined(WIDEVINE_CDM_IS_COMPONENT) +#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) AddWidevineCdmFromCommandLine(plugins); - #endif +#endif } void AtomContentClient::AddServiceWorkerSchemes( diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index 87653a6..5ad8e69 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -107,7 +107,7 @@ void AtomBrowserClient::RenderProcessWillLaunch( host->AddFilter(new printing::PrintingMessageFilter(process_id)); host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext())); host->AddFilter( - new WidevineCdmMessageFilter(process_id, host->GetBrowserContext())); + new WidevineCdmMessageFilter(process_id, host->GetBrowserContext())); } content::SpeechRecognitionManagerDelegate* diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index ab2ac39..6abe839 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -237,7 +237,7 @@ void AtomRendererClient::EnableWebRuntimeFeatures() { } void AtomRendererClient::AddKeySystems( - std::vector* key_systems) { + std::vector* key_systems) { AddChromeKeySystems(key_systems); } diff --git a/atom/renderer/atom_renderer_client.h b/atom/renderer/atom_renderer_client.h index e6da536..ee082e9 100644 --- a/atom/renderer/atom_renderer_client.h +++ b/atom/renderer/atom_renderer_client.h @@ -60,6 +60,7 @@ class AtomRendererClient : public content::ContentRendererClient, const content::RenderFrame* render_frame, blink::WebPageVisibilityState* override_state) override; void AddKeySystems(std::vector* key_systems) override; + void EnableWebRuntimeFeatures(); scoped_ptr node_bindings_; diff --git a/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc b/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc index 869bf85..c926b9e 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc @@ -9,6 +9,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/common/webplugininfo.h" #include "content/public/browser/plugin_service.h" + using content::PluginService; using content::WebPluginInfo; using content::BrowserThread; @@ -39,7 +40,6 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType( bool* is_available, std::vector* additional_param_names, std::vector* additional_param_values) { - std::vector plugins; PluginService::GetInstance()->GetInternalPlugins(&plugins); @@ -67,4 +67,4 @@ void WidevineCdmMessageFilter::OnDestruct() const { } WidevineCdmMessageFilter::~WidevineCdmMessageFilter() { -} \ No newline at end of file +} diff --git a/chromium_src/chrome/common/chrome_paths.cc b/chromium_src/chrome/common/chrome_paths.cc index 3cc7b02..293ea26 100644 --- a/chromium_src/chrome/common/chrome_paths.cc +++ b/chromium_src/chrome/common/chrome_paths.cc @@ -16,6 +16,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths_internal.h" #include "chrome/common/widevine_cdm_constants.h" +#include "third_party/widevine/cdm/stub/widevine_cdm_version.h" #if defined(OS_ANDROID) #include "base/android/path_utils.h" @@ -32,8 +33,6 @@ #include "base/win/registry.h" #endif -#include "third_party/widevine/cdm/stub/widevine_cdm_version.h" - namespace { // The Pepper Flash plugins are in a directory with this name. -- 2.7.4