Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 5 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
| 10 #include <sys/wait.h> | 10 #include <sys/wait.h> |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
| 22 #include "content/browser/browser_thread.h" | 22 #include "content/browser/browser_thread.h" |
| 23 #include "content/common/url_constants.h" | 23 #include "content/common/url_constants.h" |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const char* kAllowedIds[] = { | 28 const char* kAllowedIds[] = { |
| 29 "haiffjcadagjlijoggckpgfnoeiflnem", | 29 "haiffjcadagjlijoggckpgfnoeiflnem", |
| 30 "gnedhmakppccajfpfiihfcdlnpgomkcf", | 30 "gnedhmakppccajfpfiihfcdlnpgomkcf", |
| 31 "fjcibdnjlbfnbfdjneajpipnlcppleek" | 31 "fjcibdnjlbfnbfdjneajpipnlcppleek", |
| 32 "okddffdblfhhnmhodogpojmfkjmhinfp" | |
|
Denis Lagno
2011/09/08 13:53:57
shouldn't we put a brief comment about purpose of
| |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 class OriginValidator { | 35 class OriginValidator { |
| 35 public: | 36 public: |
| 36 OriginValidator() { | 37 OriginValidator() { |
| 37 chromeos::FillWithExtensionsIdsWithPrivateAccess(&allowed_ids_); | 38 chromeos::FillWithExtensionsIdsWithPrivateAccess(&allowed_ids_); |
| 38 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 39 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 39 DCHECK(command_line); | 40 DCHECK(command_line); |
| 40 std::string allowed_list = | 41 std::string allowed_list = |
| 41 command_line->GetSwitchValueASCII(switches::kAllowWebSocketProxy); | 42 command_line->GetSwitchValueASCII(switches::kAllowWebSocketProxy); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 const std::string& extension_id, | 190 const std::string& extension_id, |
| 190 const std::string& hostname, | 191 const std::string& hostname, |
| 191 unsigned short port, | 192 unsigned short port, |
| 192 ConnectionFlags flags) { | 193 ConnectionFlags flags) { |
| 193 return g_validator.Get().CheckCredentials( | 194 return g_validator.Get().CheckCredentials( |
| 194 extension_id, hostname, port, flags); | 195 extension_id, hostname, port, flags); |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace chromeos | 198 } // namespace chromeos |
| 198 | 199 |
| OLD | NEW |