Index: chrome/browser/external_protocol/external_protocol_handler.cc |
diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc |
index 657709cfda5279ebdee016eb399a1c5a991c3874..5fa8ddc93303d9cff0853e3b653c88f7b6e36633 100644 |
--- a/chrome/browser/external_protocol/external_protocol_handler.cc |
+++ b/chrome/browser/external_protocol/external_protocol_handler.cc |
@@ -38,14 +38,16 @@ static bool g_accept_requests = true; |
namespace { |
// Functions enabling unit testing. Using a NULL delegate will use the default |
-// behavior; if a delegate is provided it will be used instead. |
+// behavior; if a delegate is provided it will be used instead. Also, Ownership |
+// of |observer| is passed to the new worker. |
shell_integration::DefaultProtocolClientWorker* CreateShellWorker( |
shell_integration::DefaultWebClientObserver* observer, |
const std::string& protocol, |
ExternalProtocolHandler::Delegate* delegate) { |
if (!delegate) |
- return new shell_integration::DefaultProtocolClientWorker(observer, |
- protocol); |
+ return new shell_integration::DefaultProtocolClientWorker( |
+ observer, protocol, |
+ /*delete_observer=*/true); |
return delegate->CreateShellWorker(observer, protocol); |
} |
@@ -146,8 +148,6 @@ class ExternalDefaultProtocolObserver |
escaped_url_, render_process_host_id_, tab_contents_id_, delegate_); |
} |
- bool IsOwnedByWorker() override { return true; } |
- |
private: |
ExternalProtocolHandler::Delegate* delegate_; |
const GURL escaped_url_; |