| 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/browser/extensions/updater/extension_downloader.h" | 5 #include "chrome/browser/extensions/updater/extension_downloader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 // Begins (or queues up) download of an updated extension. | 540 // Begins (or queues up) download of an updated extension. |
| 541 void ExtensionDownloader::FetchUpdatedExtension(const std::string& id, | 541 void ExtensionDownloader::FetchUpdatedExtension(const std::string& id, |
| 542 const GURL& url, | 542 const GURL& url, |
| 543 const std::string& hash, | 543 const std::string& hash, |
| 544 const std::string& version) { | 544 const std::string& version) { |
| 545 if (!url.is_valid()) { | 545 if (!url.is_valid()) { |
| 546 // TODO(asargent): This can sometimes be invalid. See crbug.com/130881. | 546 // TODO(asargent): This can sometimes be invalid. See crbug.com/130881. |
| 547 LOG(ERROR) << "Invalid URL: " << url.spec(); | 547 LOG(ERROR) << "Invalid URL: '" << url.possibly_invalid_spec() |
| 548 << "' for extension " << id; |
| 548 return; | 549 return; |
| 549 } | 550 } |
| 550 | 551 |
| 551 for (std::deque<ExtensionFetch>::const_iterator iter = | 552 for (std::deque<ExtensionFetch>::const_iterator iter = |
| 552 extensions_pending_.begin(); | 553 extensions_pending_.begin(); |
| 553 iter != extensions_pending_.end(); ++iter) { | 554 iter != extensions_pending_.end(); ++iter) { |
| 554 if (iter->id == id || iter->url == url) { | 555 if (iter->id == id || iter->url == url) { |
| 555 return; // already scheduled | 556 return; // already scheduled |
| 556 } | 557 } |
| 557 } | 558 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 } | 649 } |
| 649 | 650 |
| 650 void ExtensionDownloader::NotifyUpdateFound(const std::string& id) { | 651 void ExtensionDownloader::NotifyUpdateFound(const std::string& id) { |
| 651 content::NotificationService::current()->Notify( | 652 content::NotificationService::current()->Notify( |
| 652 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 653 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
| 653 content::NotificationService::AllBrowserContextsAndSources(), | 654 content::NotificationService::AllBrowserContextsAndSources(), |
| 654 content::Details<const std::string>(&id)); | 655 content::Details<const std::string>(&id)); |
| 655 } | 656 } |
| 656 | 657 |
| 657 } // namespace extensions | 658 } // namespace extensions |
| OLD | NEW |