OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/renderer_host/buffered_resource_handler.h" | 5 #include "chrome/browser/renderer_host/buffered_resource_handler.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "net/base/mime_sniffer.h" | 10 #include "net/base/mime_sniffer.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 return true; | 412 return true; |
413 } | 413 } |
414 } else { | 414 } else { |
415 DCHECK(NPAPI::PluginList::Singleton()->PluginsLoaded()); | 415 DCHECK(NPAPI::PluginList::Singleton()->PluginsLoaded()); |
416 } | 416 } |
417 | 417 |
418 // Finally, check the plugin list. | 418 // Finally, check the plugin list. |
419 WebPluginInfo info; | 419 WebPluginInfo info; |
420 bool allow_wildcard = false; | 420 bool allow_wildcard = false; |
421 return !NPAPI::PluginList::Singleton()->GetPluginInfo( | 421 return !NPAPI::PluginList::Singleton()->GetPluginInfo( |
422 GURL(), type, "", allow_wildcard, &info, NULL); | 422 GURL(), type, allow_wildcard, &info, NULL); |
423 } | 423 } |
424 | 424 |
425 void BufferedResourceHandler::LoadPlugins(BufferedResourceHandler* handler, | 425 void BufferedResourceHandler::LoadPlugins(BufferedResourceHandler* handler, |
426 MessageLoop* main_message_loop) { | 426 MessageLoop* main_message_loop) { |
427 std::vector<WebPluginInfo> plugins; | 427 std::vector<WebPluginInfo> plugins; |
428 NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); | 428 NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); |
429 | 429 |
430 // Note, we want to get to the IO thread now, but the file thread outlives it | 430 // Note, we want to get to the IO thread now, but the file thread outlives it |
431 // so we can't post a task to it directly as it might be in the middle of | 431 // so we can't post a task to it directly as it might be in the middle of |
432 // destruction. So hop through the main thread, where the destruction of the | 432 // destruction. So hop through the main thread, where the destruction of the |
(...skipping 13 matching lines...) Expand all Loading... |
446 wait_for_plugins_ = false; | 446 wait_for_plugins_ = false; |
447 if (request_) { | 447 if (request_) { |
448 ResourceDispatcherHostRequestInfo* info = | 448 ResourceDispatcherHostRequestInfo* info = |
449 ResourceDispatcherHost::InfoForRequest(request_); | 449 ResourceDispatcherHost::InfoForRequest(request_); |
450 host_->PauseRequest(info->child_id(), info->request_id(), false); | 450 host_->PauseRequest(info->child_id(), info->request_id(), false); |
451 if (!CompleteResponseStarted(info->request_id(), false)) | 451 if (!CompleteResponseStarted(info->request_id(), false)) |
452 host_->CancelRequest(info->child_id(), info->request_id(), false); | 452 host_->CancelRequest(info->child_id(), info->request_id(), false); |
453 } | 453 } |
454 Release(); | 454 Release(); |
455 } | 455 } |
OLD | NEW |