| Index: content/renderer/mojo_context_state.cc
|
| diff --git a/content/renderer/mojo_context_state.cc b/content/renderer/mojo_context_state.cc
|
| index 5495fb9785e650f740fd6b6760671dc20fa8e82b..d9e70e9250a59af9d7a281e1d8c30a0be955bc74 100644
|
| --- a/content/renderer/mojo_context_state.cc
|
| +++ b/content/renderer/mojo_context_state.cc
|
| @@ -170,28 +170,30 @@ void MojoContextState::FetchModule(const std::string& id) {
|
| blink::WebURLRequest::FrameTypeNone,
|
| ResourceFetcher::PLATFORM_LOADER,
|
| base::Bind(&MojoContextState::OnFetchModuleComplete,
|
| - base::Unretained(this), fetcher));
|
| + base::Unretained(this), fetcher, id));
|
| }
|
|
|
| void MojoContextState::OnFetchModuleComplete(
|
| ResourceFetcher* fetcher,
|
| + const std::string& id,
|
| const blink::WebURLResponse& response,
|
| const std::string& data) {
|
| - DCHECK_EQ(module_prefix_,
|
| - response.url().string().utf8().substr(0, module_prefix_.size()));
|
| - const std::string module =
|
| - response.url().string().utf8().substr(module_prefix_.size());
|
| + if (response.isNull()) {
|
| + LOG(ERROR) << "Failed to fetch source for module \"" << id << "\"";
|
| + return;
|
| + }
|
| + DCHECK_EQ(module_prefix_ + id, response.url().string().utf8());
|
| // We can't delete fetch right now as the arguments to this function come from
|
| // it and are used below. Instead use a scope_ptr to cleanup.
|
| scoped_ptr<ResourceFetcher> deleter(fetcher);
|
| module_fetchers_.weak_erase(
|
| std::find(module_fetchers_.begin(), module_fetchers_.end(), fetcher));
|
| if (data.empty()) {
|
| - NOTREACHED();
|
| - return; // TODO(sky): log something?
|
| + LOG(ERROR) << "Fetched empty source for module \"" << id << "\"";
|
| + return;
|
| }
|
|
|
| - runner_->Run(data, module);
|
| + runner_->Run(data, id);
|
| }
|
|
|
| void MojoContextState::OnDidAddPendingModule(
|
|
|