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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { |
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) { | 687 } else if (is_pnacl_mime_type) { |
688 is_nacl_unrestricted = | 688 is_nacl_unrestricted = true; |
689 !CommandLine::ForCurrentProcess()->HasSwitch( | |
690 switches::kDisablePnacl); | |
691 } | 689 } |
692 GURL manifest_url; | 690 GURL manifest_url; |
693 GURL app_url; | 691 GURL app_url; |
694 if (is_nacl_mime_type || is_pnacl_mime_type) { | 692 if (is_nacl_mime_type || is_pnacl_mime_type) { |
695 // Normal NaCl/PNaCl embed. The app URL is the page URL. | 693 // Normal NaCl/PNaCl embed. The app URL is the page URL. |
696 manifest_url = url; | 694 manifest_url = url; |
697 app_url = frame->top()->document().url(); | 695 app_url = frame->top()->document().url(); |
698 } else { | 696 } else { |
699 // NaCl is being invoked as a content handler. Look up the NaCl | 697 // 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. | 698 // 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 | 1497 |
1500 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) | 1498 if (IsExtensionOrSharedModuleWhitelisted(url, allowed_video_decode_origins_)) |
1501 return true; | 1499 return true; |
1502 | 1500 |
1503 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 1501 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
1504 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 1502 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
1505 #else | 1503 #else |
1506 return false; | 1504 return false; |
1507 #endif | 1505 #endif |
1508 } | 1506 } |
OLD | NEW |