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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7621068: Disable NaCl on 32-bit linux, also disable NaCl extension/store tests for that platform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_nacl_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 using WebKit::WebPluginParams; 91 using WebKit::WebPluginParams;
92 using WebKit::WebSecurityPolicy; 92 using WebKit::WebSecurityPolicy;
93 using WebKit::WebString; 93 using WebKit::WebString;
94 using WebKit::WebURLError; 94 using WebKit::WebURLError;
95 using WebKit::WebURLRequest; 95 using WebKit::WebURLRequest;
96 using WebKit::WebURLResponse; 96 using WebKit::WebURLResponse;
97 using WebKit::WebVector; 97 using WebKit::WebVector;
98 98
99 namespace { 99 namespace {
100 100
101 const char* kNaClPluginMimeType = "application/x-nacl";
102 const char* kNaClPluginManifestAttribute = "nacl";
103
104 // Constants for UMA statistic collection. 101 // Constants for UMA statistic collection.
105 static const char kPluginTypeMismatch[] = "Plugin.PluginTypeMismatch"; 102 static const char kPluginTypeMismatch[] = "Plugin.PluginTypeMismatch";
106 static const char kApplicationOctetStream[] = "application/octet-stream"; 103 static const char kApplicationOctetStream[] = "application/octet-stream";
107 enum { 104 enum {
108 PLUGIN_TYPE_MISMATCH_NONE = 0, 105 PLUGIN_TYPE_MISMATCH_NONE = 0,
109 PLUGIN_TYPE_MISMATCH_ORIG_EMPTY, 106 PLUGIN_TYPE_MISMATCH_ORIG_EMPTY,
110 PLUGIN_TYPE_MISMATCH_ORIG_OCTETSTREAM, 107 PLUGIN_TYPE_MISMATCH_ORIG_OCTETSTREAM,
111 PLUGIN_TYPE_MISMATCH_ORIG_OTHER, 108 PLUGIN_TYPE_MISMATCH_ORIG_OTHER,
112 PLUGIN_TYPE_MISMATCH_NUM_EVENTS, 109 PLUGIN_TYPE_MISMATCH_NUM_EVENTS,
113 }; 110 };
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // Delay loading plugins if prerendering. 390 // Delay loading plugins if prerendering.
394 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { 391 if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
395 return CreatePluginPlaceholder( 392 return CreatePluginPlaceholder(
396 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, 393 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML,
397 IDS_PLUGIN_LOAD, true, true); 394 IDS_PLUGIN_LOAD, true, true);
398 } 395 }
399 396
400 // Enforce Chrome WebStore restriction on the Native Client plugin. 397 // Enforce Chrome WebStore restriction on the Native Client plugin.
401 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) { 398 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) {
402 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl); 399 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl);
400 // TODO(elijahtaylor) Remove this #if when crbug.com/92964 is fixed.
401 #if !(defined(OS_LINUX) && ARCH_CPU_32_BITS)
403 if (!allow_nacl) { 402 if (!allow_nacl) {
403 const char* kNaClPluginMimeType = "application/x-nacl";
404 const char* kNaClPluginManifestAttribute = "nacl";
405
404 GURL nexe_url; 406 GURL nexe_url;
405 if (actual_mime_type == kNaClPluginMimeType) { 407 if (actual_mime_type == kNaClPluginMimeType) {
406 nexe_url = url; // Normal embedded NaCl plugin. 408 nexe_url = url; // Normal embedded NaCl plugin.
407 } else { 409 } else {
408 // Content type handling NaCl plugin; the "nacl" param on the 410 // Content type handling NaCl plugin; the "nacl" param on the
409 // MIME type holds the nexe URL. 411 // MIME type holds the nexe URL.
410 string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute); 412 string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute);
411 for (size_t i = 0; i < info.mime_types.size(); ++i) { 413 for (size_t i = 0; i < info.mime_types.size(); ++i) {
412 if (info.mime_types[i].mime_type == actual_mime_type) { 414 if (info.mime_types[i].mime_type == actual_mime_type) {
413 const webkit::WebPluginMimeType& content_type = 415 const webkit::WebPluginMimeType& content_type =
(...skipping 13 matching lines...) Expand all
427 // Create the NaCl plugin only if the .nexe is part of an extension 429 // Create the NaCl plugin only if the .nexe is part of an extension
428 // that was installed from the Chrome Web Store, or part of a component 430 // that was installed from the Chrome Web Store, or part of a component
429 // extension, or part of an unpacked extension. 431 // extension, or part of an unpacked extension.
430 const Extension* extension = 432 const Extension* extension =
431 extension_dispatcher_->extensions()->GetByURL(nexe_url); 433 extension_dispatcher_->extensions()->GetByURL(nexe_url);
432 allow_nacl = extension && 434 allow_nacl = extension &&
433 (extension->from_webstore() || 435 (extension->from_webstore() ||
434 extension->location() == Extension::COMPONENT || 436 extension->location() == Extension::COMPONENT ||
435 extension->location() == Extension::LOAD); 437 extension->location() == Extension::LOAD);
436 } 438 }
439 #endif // !(Linux 32-bit)
awong 2011/08/18 17:36:27 Usually the comment repeats the exact conditional.
elijahtaylor (use chromium) 2011/08/18 17:44:21 Done.
437 440
438 if (!allow_nacl) { 441 if (!allow_nacl) {
439 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and 442 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and
440 // we return NULL. Prepare a patch to fix that, and return NULL here. 443 // we return NULL. Prepare a patch to fix that, and return NULL here.
441 return CreatePluginPlaceholder( 444 return CreatePluginPlaceholder(
442 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, 445 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML,
443 IDS_PLUGIN_BLOCKED, false, false); 446 IDS_PLUGIN_BLOCKED, false, false);
444 } 447 }
445 } 448 }
446 449
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if (spellcheck_.get()) 717 if (spellcheck_.get())
715 thread->RemoveObserver(spellcheck_.get()); 718 thread->RemoveObserver(spellcheck_.get());
716 SpellCheck* new_spellcheck = new SpellCheck(); 719 SpellCheck* new_spellcheck = new SpellCheck();
717 if (spellcheck_provider_) 720 if (spellcheck_provider_)
718 spellcheck_provider_->SetSpellCheck(new_spellcheck); 721 spellcheck_provider_->SetSpellCheck(new_spellcheck);
719 spellcheck_.reset(new_spellcheck); 722 spellcheck_.reset(new_spellcheck);
720 thread->AddObserver(new_spellcheck); 723 thread->AddObserver(new_spellcheck);
721 } 724 }
722 725
723 } // namespace chrome 726 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_nacl_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698