Commit 4b717264 authored by cm.sanchi's avatar cm.sanchi Committed by Commit Bot

chrome: Move Pepper files out of chrome namespace.

From discussion on chromium-dev, it was decided to remove 'chrome'
namespace.

Bug: 289619
Change-Id: Ibc473af04b1e28f59ebcec8a4e1cb5616d4eb8cb
Reviewed-on: https://chromium-review.googlesource.com/771091Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#517779}
parent 16938949
......@@ -183,8 +183,8 @@ bool NaClBrowserDelegateImpl::IsNonSfiModeAllowed(
#if BUILDFLAG(ENABLE_EXTENSIONS)
const extensions::ExtensionSet* extension_set =
&GetExtensionInfoMap(profile_directory)->extensions();
return chrome::IsExtensionOrSharedModuleWhitelisted(
manifest_url, extension_set, allowed_nonsfi_origins_);
return IsExtensionOrSharedModuleWhitelisted(manifest_url, extension_set,
allowed_nonsfi_origins_);
#else
return false;
#endif
......
......@@ -458,7 +458,7 @@ void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesAsync(
// ChromeOS used to store the device ID in a file but this is no longer used.
// Wipe that file.
const base::FilePath& device_id_path =
chrome::DeviceIDFetcher::GetLegacyDeviceIDPath(profile_path);
DeviceIDFetcher::GetLegacyDeviceIDPath(profile_path);
bool success = base::DeleteFile(device_id_path, false);
BrowserThread::PostTask(
......
......@@ -59,10 +59,10 @@ bool ChromeContentBrowserClientPluginsPart::
&extensions::ExtensionRegistry::Get(profile)->enabled_extensions();
}
return chrome::IsExtensionOrSharedModuleWhitelisted(
url, extension_set, allowed_file_handle_origins) ||
chrome::IsHostAllowedByCommandLine(
url, extension_set, ::switches::kAllowNaClFileHandleAPI);
return IsExtensionOrSharedModuleWhitelisted(url, extension_set,
allowed_file_handle_origins) ||
IsHostAllowedByCommandLine(url, extension_set,
::switches::kAllowNaClFileHandleAPI);
#else
return false;
#endif
......@@ -84,7 +84,7 @@ bool ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI(
if (private_api) {
// Access to private socket APIs is controlled by the whitelist.
if (chrome::IsExtensionOrSharedModuleWhitelisted(url, extension_set,
if (IsExtensionOrSharedModuleWhitelisted(url, extension_set,
allowed_socket_origin)) {
return true;
}
......@@ -113,7 +113,7 @@ bool ChromeContentBrowserClientPluginsPart::AllowPepperSocketAPI(
}
// Allow both public and private APIs if the command line says so.
return chrome::IsHostAllowedByCommandLine(url, extension_set,
return IsHostAllowedByCommandLine(url, extension_set,
::switches::kAllowNaClSocketAPI);
#else
return false;
......@@ -167,8 +167,8 @@ bool ChromeContentBrowserClientPluginsPart::IsPluginAllowedToUseDevChannelAPIs(
}
// Allow access for whitelisted applications.
if (chrome::IsExtensionOrSharedModuleWhitelisted(
url, extension_set, allowed_dev_channel_origins)) {
if (IsExtensionOrSharedModuleWhitelisted(url, extension_set,
allowed_dev_channel_origins)) {
return true;
}
#endif
......
......@@ -47,14 +47,13 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
switch (message.type()) {
case PpapiHostMsg_Broker_Create::ID: {
scoped_refptr<ResourceMessageFilter> broker_filter(
new chrome::PepperBrokerMessageFilter(instance, host_));
new PepperBrokerMessageFilter(instance, host_));
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, broker_filter));
}
case PpapiHostMsg_PlatformVerification_Create::ID: {
scoped_refptr<ResourceMessageFilter> pv_filter(
new chrome::PepperPlatformVerificationMessageFilter(host_,
instance));
new PepperPlatformVerificationMessageFilter(host_, instance));
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, pv_filter));
}
......@@ -74,16 +73,16 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
switch (message.type()) {
case PpapiHostMsg_Flash_Create::ID:
return std::unique_ptr<ResourceHost>(
new chrome::PepperFlashBrowserHost(host_, instance, resource));
new PepperFlashBrowserHost(host_, instance, resource));
case PpapiHostMsg_FlashClipboard_Create::ID: {
scoped_refptr<ResourceMessageFilter> clipboard_filter(
new chrome::PepperFlashClipboardMessageFilter);
new PepperFlashClipboardMessageFilter);
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, clipboard_filter));
}
case PpapiHostMsg_FlashDRM_Create::ID:
return std::unique_ptr<ResourceHost>(
new chrome::PepperFlashDRMHost(host_, instance, resource));
new PepperFlashDRMHost(host_, instance, resource));
}
}
......@@ -94,8 +93,8 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
// whitelisted apps which may not have access to the other private
// interfaces.
if (message.type() == PpapiHostMsg_IsolatedFileSystem_Create::ID) {
chrome::PepperIsolatedFileSystemMessageFilter* isolated_fs_filter =
chrome::PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
PepperIsolatedFileSystemMessageFilter* isolated_fs_filter =
PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
if (!isolated_fs_filter)
return std::unique_ptr<ResourceHost>();
return std::unique_ptr<ResourceHost>(
......
......@@ -35,8 +35,6 @@ using content::BrowserPpapiHost;
using content::BrowserThread;
using content::RenderProcessHost;
namespace chrome {
namespace {
const char kDRMIdentifierFile[] = "Pepper DRM ID.0";
......@@ -211,5 +209,3 @@ void DeviceIDFetcher::RunCallbackOnIOThread(const std::string& id,
in_progress_ = false;
callback_.Run(id, result);
}
} // namespace chrome
......@@ -20,8 +20,6 @@ namespace user_prefs {
class PrefRegistrySyncable;
}
namespace chrome {
// This class allows asynchronously fetching a unique device ID. The callback
// passed in when calling Start() will be called when the ID has been fetched
// or on error.
......@@ -74,6 +72,4 @@ class DeviceIDFetcher : public base::RefCountedThreadSafe<DeviceIDFetcher> {
DISALLOW_COPY_AND_ASSIGN(DeviceIDFetcher);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_DEVICE_ID_FETCHER_H_
......@@ -12,8 +12,6 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
namespace chrome {
// MonitorFinder maps a RenderFrameHost to the display ID on which the widget
// is painting. This class operates on the IO thread while the RenderFrameHost
// is on the UI thread, so the value returned by GetMonitor() may be 0 until
......@@ -47,6 +45,4 @@ class MonitorFinder : public base::RefCountedThreadSafe<MonitorFinder> {
DISALLOW_COPY_AND_ASSIGN(MonitorFinder);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_MONITOR_FINDER_MAC_H_
......@@ -9,8 +9,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
namespace chrome {
MonitorFinder::MonitorFinder(int process_id, int render_frame_id)
: process_id_(process_id),
render_frame_id_(render_frame_id),
......@@ -58,5 +56,3 @@ void MonitorFinder::FetchMonitorFromWidget() {
request_sent_ = false;
display_id_ = display_id;
}
} // namespace chrome
......@@ -23,8 +23,6 @@ using content::BrowserPpapiHost;
using content::BrowserThread;
using content::RenderProcessHost;
namespace chrome {
PepperBrokerMessageFilter::PepperBrokerMessageFilter(PP_Instance instance,
BrowserPpapiHost* host)
: document_url_(host->GetDocumentURLForInstance(instance)) {
......@@ -72,5 +70,3 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
return PP_OK;
return PP_ERROR_FAILED;
}
} // namespace chrome
......@@ -23,8 +23,6 @@ struct HostMessageContext;
}
}
namespace chrome {
// This filter handles messages for the PepperBrokerHost on the UI thread.
class PepperBrokerMessageFilter : public ppapi::host::ResourceMessageFilter {
public:
......@@ -49,6 +47,4 @@ class PepperBrokerMessageFilter : public ppapi::host::ResourceMessageFilter {
DISALLOW_COPY_AND_ASSIGN(PepperBrokerMessageFilter);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROKER_MESSAGE_FILTER_H_
......@@ -38,8 +38,6 @@ using content::BrowserThread;
using content::RenderProcessHost;
using content::ServiceManagerConnection;
namespace chrome {
namespace {
// Get the CookieSettings on the UI thread for the given render process ID.
......@@ -209,5 +207,3 @@ device::mojom::WakeLock* PepperFlashBrowserHost::GetWakeLock() {
std::move(request));
return wake_lock_.get();
}
} // namespace chrome
......@@ -29,8 +29,6 @@ class CookieSettings;
class GURL;
namespace chrome {
class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
public:
PepperFlashBrowserHost(content::BrowserPpapiHost* host,
......@@ -74,6 +72,4 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_BROWSER_HOST_H_
......@@ -23,8 +23,6 @@
using content::BrowserThread;
namespace chrome {
namespace {
const size_t kMaxClipboardWriteSize = 1000000;
......@@ -370,5 +368,3 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgGetSequenceNumber(
PpapiPluginMsg_FlashClipboard_GetSequenceNumberReply(sequence_number);
return PP_OK;
}
} // namespace chrome
......@@ -25,8 +25,6 @@ namespace ui {
class ScopedClipboardWriter;
}
namespace chrome {
// Resource message filter for accessing the clipboard in Pepper. Pepper
// supports reading/writing custom formats from the clipboard. Currently, all
// custom formats that are read/written from the clipboard through pepper are
......@@ -75,6 +73,4 @@ class PepperFlashClipboardMessageFilter
DISALLOW_COPY_AND_ASSIGN(PepperFlashClipboardMessageFilter);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_CLIPBOARD_MESSAGE_FILTER_H_
......@@ -35,8 +35,6 @@
using content::BrowserPpapiHost;
namespace chrome {
namespace {
const char kVoucherFilename[] = "plugin.vch";
}
......@@ -198,5 +196,3 @@ void PepperFlashDRMHost::GotDeviceID(
host()->SendReply(reply_context,
PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id));
}
} // namespace chrome
......@@ -23,7 +23,6 @@ namespace IPC {
class Message;
}
namespace chrome {
class MonitorFinder;
class PepperFlashDRMHost : public ppapi::host::ResourceHost {
......@@ -58,6 +57,4 @@ class PepperFlashDRMHost : public ppapi::host::ResourceHost {
DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMHost);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_
......@@ -32,8 +32,6 @@
#include "extensions/common/extension_set.h"
#endif
namespace chrome {
namespace {
const char* kPredefinedAllowedCrxFsOrigins[] = {
......@@ -200,5 +198,3 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(
context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid);
return PP_OK;
}
} // namespace chrome
......@@ -31,8 +31,6 @@ struct HostMessageContext;
} // namespace host
} // namespace ppapi
namespace chrome {
class PepperIsolatedFileSystemMessageFilter
: public ppapi::host::ResourceMessageFilter {
public:
......@@ -81,6 +79,4 @@ class PepperIsolatedFileSystemMessageFilter
DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H_
......@@ -23,8 +23,6 @@
#include "chrome/browser/profiles/profile.h"
#endif
namespace chrome {
namespace {
#if BUILDFLAG(ENABLE_CDM_STORAGE_ID)
......@@ -165,5 +163,3 @@ void PepperPlatformVerificationMessageFilter::GetStorageIdCallback(
SendReply(reply_context,
PpapiHostMsg_PlatformVerification_GetStorageIdReply(storage_id));
}
} // namespace chrome
......@@ -28,8 +28,6 @@ struct HostMessageContext;
} // namespace host
} // namespace ppapi
namespace chrome {
// This filter handles messages for platform verification on the UI thread.
class PepperPlatformVerificationMessageFilter
: public ppapi::host::ResourceMessageFilter {
......@@ -76,6 +74,4 @@ class PepperPlatformVerificationMessageFilter
DISALLOW_COPY_AND_ASSIGN(PepperPlatformVerificationMessageFilter);
};
} // namespace chrome
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_PLATFORM_VERIFICATION_MESSAGE_FILTER_H_
......@@ -19,8 +19,6 @@ using extensions::Extension;
using extensions::Manifest;
using extensions::SharedModuleInfo;
namespace chrome {
namespace {
std::string HashHost(const std::string& host) {
......@@ -103,5 +101,3 @@ bool IsHostAllowedByCommandLine(const GURL& url,
return false;
}
} // namespace chrome
......@@ -14,8 +14,6 @@ namespace extensions {
class ExtensionSet;
}
namespace chrome {
// Returns true if the extension (or an imported module if any) is whitelisted.
// Module imports are at most one level deep (ie, a module that exports cannot
// import another extension). The extension is identified by the host of |url|
......@@ -36,6 +34,4 @@ bool IsExtensionOrSharedModuleWhitelisted(
bool IsHostAllowedByCommandLine(const GURL& url,
const extensions::ExtensionSet* extension_set,
const char* command_line_switch);
} // namespace chrome
#endif // CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
......@@ -16,8 +16,6 @@
#include "extensions/common/features/feature_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
using chrome::IsExtensionOrSharedModuleWhitelisted;
namespace extensions {
namespace {
......
......@@ -1395,11 +1395,11 @@ bool ChromeContentRendererClient::IsExternalPepperPlugin(
#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
bool ChromeContentRendererClient::IsExtensionOrSharedModuleWhitelisted(
const GURL& url, const std::set<std::string>& whitelist) {
const GURL& url,
const std::set<std::string>& whitelist) {
const extensions::ExtensionSet* extension_set =
extensions::RendererExtensionRegistry::Get()->GetMainThreadExtensionSet();
return chrome::IsExtensionOrSharedModuleWhitelisted(url, extension_set,
whitelist);
return ::IsExtensionOrSharedModuleWhitelisted(url, extension_set, whitelist);
}
#endif
......
......@@ -238,7 +238,8 @@ class ChromeContentRendererClient
#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS)
static bool IsExtensionOrSharedModuleWhitelisted(
const GURL& url, const std::set<std::string>& whitelist);
const GURL& url,
const std::set<std::string>& whitelist);
#endif
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment