| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_extension_message_filter.h" | 5 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 extension_set.GetByID(it->extension_id); | 240 extension_set.GetByID(it->extension_id); |
| 241 if (!imported_extension) { | 241 if (!imported_extension) { |
| 242 NOTREACHED() << "Missing shared module " << it->extension_id; | 242 NOTREACHED() << "Missing shared module " << it->extension_id; |
| 243 continue; | 243 continue; |
| 244 } | 244 } |
| 245 paths_to_load.push_back(imported_extension->path()); | 245 paths_to_load.push_back(imported_extension->path()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // This blocks tab loading. Priority is inherited from the calling context. | 248 // This blocks tab loading. Priority is inherited from the calling context. |
| 249 base::PostTaskWithTraits( | 249 base::PostTaskWithTraits( |
| 250 FROM_HERE, base::TaskTraits().MayBlock(), | 250 FROM_HERE, {base::MayBlock()}, |
| 251 base::Bind(&ChromeExtensionMessageFilter::OnGetExtMessageBundleAsync, | 251 base::Bind(&ChromeExtensionMessageFilter::OnGetExtMessageBundleAsync, |
| 252 this, paths_to_load, extension_id, default_locale, reply_msg)); | 252 this, paths_to_load, extension_id, default_locale, reply_msg)); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void ChromeExtensionMessageFilter::OnGetExtMessageBundleAsync( | 255 void ChromeExtensionMessageFilter::OnGetExtMessageBundleAsync( |
| 256 const std::vector<base::FilePath>& extension_paths, | 256 const std::vector<base::FilePath>& extension_paths, |
| 257 const std::string& main_extension_id, | 257 const std::string& main_extension_id, |
| 258 const std::string& default_locale, | 258 const std::string& default_locale, |
| 259 IPC::Message* reply_msg) { | 259 IPC::Message* reply_msg) { |
| 260 std::unique_ptr<extensions::MessageBundle::SubstitutionMap> dictionary_map( | 260 std::unique_ptr<extensions::MessageBundle::SubstitutionMap> dictionary_map( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool ChromeExtensionMessageFilter::ShouldLogExtensionAction( | 329 bool ChromeExtensionMessageFilter::ShouldLogExtensionAction( |
| 330 const std::string& extension_id) const { | 330 const std::string& extension_id) const { |
| 331 // We only send these IPCs if activity logging is enabled, but due to race | 331 // We only send these IPCs if activity logging is enabled, but due to race |
| 332 // conditions (e.g. logging gets disabled but the renderer sends the message | 332 // conditions (e.g. logging gets disabled but the renderer sends the message |
| 333 // before it gets updated), we still need this check here. | 333 // before it gets updated), we still need this check here. |
| 334 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 334 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 335 return profile_ && | 335 return profile_ && |
| 336 g_browser_process->profile_manager()->IsValidProfile(profile_) && | 336 g_browser_process->profile_manager()->IsValidProfile(profile_) && |
| 337 activity_log_ && activity_log_->ShouldLog(extension_id); | 337 activity_log_ && activity_log_->ShouldLog(extension_id); |
| 338 } | 338 } |
| OLD | NEW |