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

Side by Side Diff: chrome/renderer/plugins/plugin_placeholder.cc

Issue 23771002: Fix check for removed plug-in while loading a blocked plug-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | 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) 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/plugins/plugin_placeholder.h" 5 #include "chrome/renderer/plugins/plugin_placeholder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/string_escape.h" 9 #include "base/json/string_escape.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // initialization. 316 // initialization.
317 WebElement element = container->element(); 317 WebElement element = container->element();
318 if (!new_plugin->initialize(container)) { 318 if (!new_plugin->initialize(container)) {
319 // We couldn't initialize the new plug-in. Restore the old one and abort. 319 // We couldn't initialize the new plug-in. Restore the old one and abort.
320 container->setPlugin(plugin_); 320 container->setPlugin(plugin_);
321 return; 321 return;
322 } 322 }
323 323
324 // The plug-in has been removed from the page. Destroy the old plug-in 324 // The plug-in has been removed from the page. Destroy the old plug-in
325 // (which will destroy us). 325 // (which will destroy us).
326 if (element.parentNode().isNull()) { 326 if (!element.pluginContainer()) {
327 plugin_->destroy(); 327 plugin_->destroy();
328 return; 328 return;
329 } 329 }
330 330
331 // During initialization, the new plug-in might have replaced itself in turn 331 // During initialization, the new plug-in might have replaced itself in turn
332 // with another plug-in. Make sure not to use the passed in |new_plugin| after 332 // with another plug-in. Make sure not to use the passed in |new_plugin| after
333 // this point. 333 // this point.
334 new_plugin = container->plugin(); 334 new_plugin = container->plugin();
335 335
336 plugin_->RestoreTitleText(); 336 plugin_->RestoreTitleText();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, 617 bool PluginPlaceholder::IsYouTubeURL(const GURL& url,
618 const std::string& mime_type) { 618 const std::string& mime_type) {
619 std::string host = url.host(); 619 std::string host = url.host();
620 bool is_youtube = EndsWith(host, "youtube.com", true) || 620 bool is_youtube = EndsWith(host, "youtube.com", true) ||
621 EndsWith(host, "youtube-nocookie.com", true); 621 EndsWith(host, "youtube-nocookie.com", true);
622 622
623 return is_youtube && IsValidYouTubeVideo(url.path()) && 623 return is_youtube && IsValidYouTubeVideo(url.path()) &&
624 LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType); 624 LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType);
625 } 625 }
626 #endif 626 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698