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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
673 } | 673 } |
674 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: { | 674 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: { |
675 const bool is_nacl_plugin = | 675 const bool is_nacl_plugin = |
676 plugin.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName); | 676 plugin.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName); |
677 const bool is_nacl_mime_type = | 677 const bool is_nacl_mime_type = |
678 actual_mime_type == "application/x-nacl"; | 678 actual_mime_type == "application/x-nacl"; |
679 const bool is_pnacl_mime_type = | 679 const bool is_pnacl_mime_type = |
680 actual_mime_type == "application/x-pnacl"; | 680 actual_mime_type == "application/x-pnacl"; |
681 if (is_nacl_plugin || is_nacl_mime_type || is_pnacl_mime_type) { | 681 if (is_nacl_plugin || is_nacl_mime_type || is_pnacl_mime_type) { |
682 bool is_nacl_unrestricted = false; | 682 bool is_nacl_unrestricted = false; |
683 if (is_nacl_mime_type) { | 683 if (is_nacl_mime_type || is_pnacl_mime_type) { |
jvoung (off chromium)
2014/07/15 22:04:16
I don't think this preserves the original's meanin
teravest
2014/07/15 23:08:51
You're right, thanks for catching that.
| |
684 is_nacl_unrestricted = | 684 is_nacl_unrestricted = |
685 CommandLine::ForCurrentProcess()->HasSwitch( | 685 CommandLine::ForCurrentProcess()->HasSwitch( |
686 switches::kEnableNaCl); | 686 switches::kEnableNaCl); |
687 } else if (is_pnacl_mime_type) { | |
688 is_nacl_unrestricted = | |
689 !CommandLine::ForCurrentProcess()->HasSwitch( | |
690 switches::kDisablePnacl); | |
691 } | 687 } |
692 GURL manifest_url; | 688 GURL manifest_url; |
693 GURL app_url; | 689 GURL app_url; |
694 if (is_nacl_mime_type || is_pnacl_mime_type) { | 690 if (is_nacl_mime_type || is_pnacl_mime_type) { |
695 // Normal NaCl/PNaCl embed. The app URL is the page URL. | 691 // Normal NaCl/PNaCl embed. The app URL is the page URL. |
696 manifest_url = url; | 692 manifest_url = url; |
697 app_url = frame->top()->document().url(); | 693 app_url = frame->top()->document().url(); |
698 } else { | 694 } else { |
699 // NaCl is being invoked as a content handler. Look up the NaCl | 695 // NaCl is being invoked as a content handler. Look up the NaCl |
700 // module using the MIME type. The app URL is the manifest URL. | 696 // module using the MIME type. The app URL is the manifest URL. |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 | 1495 |
1500 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) | 1496 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) |
1501 return true; | 1497 return true; |
1502 | 1498 |
1503 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 1499 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
1504 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 1500 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
1505 #else | 1501 #else |
1506 return false; | 1502 return false; |
1507 #endif | 1503 #endif |
1508 } | 1504 } |
OLD | NEW |