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

Unified Diff: chrome/browser/extensions/extension_web_socket_proxy_private_api.cc

Issue 9317013: Add a centralized mechanism for whitelisting access to extension permissions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 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/browser/extensions/extension_web_socket_proxy_private_api.cc
diff --git a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
index 367bdfb835026065675c05461a78de1f3363c283..700aa8820c9ce70a95678f15e7e578a5652bcb90 100644
--- a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
+++ b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
@@ -26,11 +26,6 @@
#include "chrome/browser/chromeos/web_socket_proxy_controller.h"
#endif
-namespace {
-const char kPermissionDeniedError[] =
- "Extension does not have permission to use this method.";
-}
-
WebSocketProxyPrivate::WebSocketProxyPrivate()
: port_(-1),
listening_port_(-1),
@@ -106,24 +101,16 @@ bool WebSocketProxyPrivate::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &hostname_));
EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &port_));
- if (chromeos::WebSocketProxyController::CheckCredentials(
- extension_id(), hostname_, port_,
- do_tls_ ? chromeos::WebSocketProxyController::TLS_OVER_TCP :
- chromeos::WebSocketProxyController::PLAIN_TCP)) {
- listening_port_ = chromeos::WebSocketProxyController::GetPort();
- if (listening_port_ < 1) {
- delay_response = true;
- registrar_.Add(
- this, chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED,
- content::NotificationService::AllSources());
- }
- map_["hostname"] = hostname_;
- map_["port"] = base::IntToString(port_);
- map_["extension_id"] = extension_id();
- } else {
- error_ = kPermissionDeniedError;
- return false;
+ listening_port_ = chromeos::WebSocketProxyController::GetPort();
+ if (listening_port_ < 1) {
+ delay_response = true;
+ registrar_.Add(
+ this, chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED,
+ content::NotificationService::AllSources());
}
+ map_["hostname"] = hostname_;
+ map_["port"] = base::IntToString(port_);
+ map_["extension_id"] = extension_id();
if (delay_response) {
const int kTimeout = 12;

Powered by Google App Engine
This is Rietveld 408576698