OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 } | 1630 } |
1631 | 1631 |
1632 // Need to check this now and not on construction because otherwise it won't | 1632 // Need to check this now and not on construction because otherwise it won't |
1633 // work with browser_tests. | 1633 // work with browser_tests. |
1634 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1634 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1635 std::string allowed_list = | 1635 std::string allowed_list = |
1636 command_line.GetSwitchValueASCII(switches::kAllowNaClSocketAPI); | 1636 command_line.GetSwitchValueASCII(switches::kAllowNaClSocketAPI); |
1637 if (allowed_list == "*") { | 1637 if (allowed_list == "*") { |
1638 // The wildcard allows socket API only for packaged and platform apps. | 1638 // The wildcard allows socket API only for packaged and platform apps. |
1639 return extension && | 1639 return extension && |
1640 (extension->GetType() == Extension::TYPE_PACKAGED_APP || | 1640 (extension->GetType() == Extension::TYPE_LEGACY_PACKAGED_APP || |
1641 extension->GetType() == Extension::TYPE_PLATFORM_APP); | 1641 extension->GetType() == Extension::TYPE_PLATFORM_APP); |
1642 } else if (!allowed_list.empty()) { | 1642 } else if (!allowed_list.empty()) { |
1643 StringTokenizer t(allowed_list, ","); | 1643 StringTokenizer t(allowed_list, ","); |
1644 while (t.GetNext()) { | 1644 while (t.GetNext()) { |
1645 if (t.token() == host) | 1645 if (t.token() == host) |
1646 return true; | 1646 return true; |
1647 } | 1647 } |
1648 } | 1648 } |
1649 | 1649 |
1650 if (!extension) | 1650 if (!extension) |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 partition_id = extension->id(); | 1726 partition_id = extension->id(); |
1727 } | 1727 } |
1728 | 1728 |
1729 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1729 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
1730 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1730 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
1731 return partition_id; | 1731 return partition_id; |
1732 } | 1732 } |
1733 | 1733 |
1734 | 1734 |
1735 } // namespace chrome | 1735 } // namespace chrome |
OLD | NEW |