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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 8804006: Reland 8688002: PPB_TCPSocket_Private/PPB_UDPSocket_Private are exposed to Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix destruction issue Created 9 years 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_content_renderer_client.h ('k') | chrome/test/ui/ppapi_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 776e35cc714f040e6edc398bd87b488c0d7bea37..692c89a69bd2f71c718d77dca2f65f60db6d7b17 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
+#include "base/string_tokenizer.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/child_process_logging.h"
@@ -103,6 +104,10 @@ using content::RenderThread;
namespace {
+const char* kPredefinedAllowedSocketOrigins[] = {
+ "okddffdblfhhnmhodogpojmfkjmhinfp" // SSH Client
+};
+
static void AppendParams(const std::vector<string16>& additional_names,
const std::vector<string16>& additional_values,
WebVector<WebString>* existing_names,
@@ -136,6 +141,18 @@ namespace chrome {
ChromeContentRendererClient::ChromeContentRendererClient()
: spellcheck_provider_(NULL) {
+ for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i)
+ allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]);
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ std::string allowed_list =
+ command_line.GetSwitchValueASCII(switches::kAllowNaClSocketAPI);
+ if (!allowed_list.empty()) {
+ StringTokenizer t(allowed_list, ",");
+ while (t.GetNext()) {
+ allowed_socket_origins_.insert(t.token());
+ }
+ }
}
ChromeContentRendererClient::~ChromeContentRendererClient() {
@@ -795,4 +812,9 @@ void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories(
factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory);
}
+bool ChromeContentRendererClient::AllowSocketAPI(const GURL& url) {
+ return allowed_socket_origins_.find(url.host()) !=
+ allowed_socket_origins_.end();
+}
+
} // namespace chrome
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | chrome/test/ui/ppapi_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698