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

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

Issue 7821021: Enable nacl_helper by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also re-enable NaCl for 32-bit Linux Created 9 years, 3 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/nacl/nacl_fork_delegate_linux.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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // Delay loading plugins if prerendering. 399 // Delay loading plugins if prerendering.
400 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { 400 if (prerender::PrerenderHelper::IsPrerendering(render_view)) {
401 return CreatePluginPlaceholder( 401 return CreatePluginPlaceholder(
402 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, 402 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML,
403 IDS_PLUGIN_LOAD, true, true); 403 IDS_PLUGIN_LOAD, true, true);
404 } 404 }
405 405
406 // Enforce Chrome WebStore restriction on the Native Client plugin. 406 // Enforce Chrome WebStore restriction on the Native Client plugin.
407 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) { 407 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) {
408 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl); 408 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl);
409 // TODO(elijahtaylor) Remove this #if when crbug.com/92964 is fixed. 409 // TODO(elijahtaylor) Remove this #if when crbug.com/92964 is fixed.
elijahtaylor (use chromium) 2011/09/01 19:49:53 please remove TODO
410 #if !(defined(OS_LINUX) && ARCH_CPU_32_BITS)
411 if (!allow_nacl) { 410 if (!allow_nacl) {
412 const char* kNaClPluginMimeType = "application/x-nacl"; 411 const char* kNaClPluginMimeType = "application/x-nacl";
413 const char* kNaClPluginManifestAttribute = "nacl"; 412 const char* kNaClPluginManifestAttribute = "nacl";
414 413
415 GURL nexe_url; 414 GURL nexe_url;
416 if (actual_mime_type == kNaClPluginMimeType) { 415 if (actual_mime_type == kNaClPluginMimeType) {
417 nexe_url = url; // Normal embedded NaCl plugin. 416 nexe_url = url; // Normal embedded NaCl plugin.
418 } else { 417 } else {
419 // Content type handling NaCl plugin; the "nacl" param on the 418 // Content type handling NaCl plugin; the "nacl" param on the
420 // MIME type holds the nexe URL. 419 // MIME type holds the nexe URL.
(...skipping 17 matching lines...) Expand all
438 // Create the NaCl plugin only if the .nexe is part of an extension 437 // Create the NaCl plugin only if the .nexe is part of an extension
439 // that was installed from the Chrome Web Store, or part of a component 438 // that was installed from the Chrome Web Store, or part of a component
440 // extension, or part of an unpacked extension. 439 // extension, or part of an unpacked extension.
441 const Extension* extension = 440 const Extension* extension =
442 extension_dispatcher_->extensions()->GetByURL(nexe_url); 441 extension_dispatcher_->extensions()->GetByURL(nexe_url);
443 allow_nacl = extension && 442 allow_nacl = extension &&
444 (extension->from_webstore() || 443 (extension->from_webstore() ||
445 extension->location() == Extension::COMPONENT || 444 extension->location() == Extension::COMPONENT ||
446 extension->location() == Extension::LOAD); 445 extension->location() == Extension::LOAD);
447 } 446 }
448 #endif // !(defined(OS_LINUX) && ARCH_CPU_32_BITS)
449 447
450 if (!allow_nacl) { 448 if (!allow_nacl) {
451 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and 449 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and
452 // we return NULL. Prepare a patch to fix that, and return NULL here. 450 // we return NULL. Prepare a patch to fix that, and return NULL here.
453 return CreatePluginPlaceholder( 451 return CreatePluginPlaceholder(
454 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, 452 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML,
455 IDS_PLUGIN_BLOCKED, false, false); 453 IDS_PLUGIN_BLOCKED, false, false);
456 } 454 }
457 } 455 }
458 456
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 if (spellcheck_.get()) 769 if (spellcheck_.get())
772 thread->RemoveObserver(spellcheck_.get()); 770 thread->RemoveObserver(spellcheck_.get());
773 SpellCheck* new_spellcheck = new SpellCheck(); 771 SpellCheck* new_spellcheck = new SpellCheck();
774 if (spellcheck_provider_) 772 if (spellcheck_provider_)
775 spellcheck_provider_->SetSpellCheck(new_spellcheck); 773 spellcheck_provider_->SetSpellCheck(new_spellcheck);
776 spellcheck_.reset(new_spellcheck); 774 spellcheck_.reset(new_spellcheck);
777 thread->AddObserver(new_spellcheck); 775 thread->AddObserver(new_spellcheck);
778 } 776 }
779 777
780 } // namespace chrome 778 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/nacl/nacl_fork_delegate_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698