Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2596)

Unified Diff: extensions/browser/api/execute_code_function.h

Issue 2301713002: Remove some UI->FILE->UI thread hops in ExecuteCodeFunction (Closed)
Patch Set: sync, move changes from accessibility_manager.cc -> accessibility_extension_loader.cc Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/execute_code_function.h
diff --git a/extensions/browser/api/execute_code_function.h b/extensions/browser/api/execute_code_function.h
index 3ba96e21317feb317c80eedc95e299434b9f52dd..dbf8639e9ff06378db37fc269e8c8c7b1364b5f7 100644
--- a/extensions/browser/api/execute_code_function.h
+++ b/extensions/browser/api/execute_code_function.h
@@ -52,17 +52,27 @@ class ExecuteCodeFunction : public AsyncExtensionFunction {
std::unique_ptr<api::extension_types::InjectDetails> details_;
private:
- // Called when contents from the file whose path is specified in JSON
- // arguments has been loaded.
- void DidLoadFile(bool success, std::unique_ptr<std::string> data);
-
- // Runs on FILE thread. Loads message bundles for the extension and
- // localizes the CSS data. Calls back DidLoadAndLocalizeFile on the UI thread.
- void GetFileURLAndLocalizeCSS(ScriptExecutor::ScriptType script_type,
- std::unique_ptr<std::string> data,
- const std::string& extension_id,
- const base::FilePath& extension_path,
- const std::string& extension_default_locale);
+ // Retrieves the file url for the given |extension_path| and optionally
+ // localizes |data|.
+ // Localization depends on whether |might_require_localization| was specified.
+ // Only CSS file content needs to be localized.
+ void GetFileURLAndMaybeLocalizeOnFileThread(
+ const std::string& extension_id,
+ const base::FilePath& extension_path,
+ const std::string& extension_default_locale,
+ bool might_require_localization,
+ std::string* data);
+
+ // Retrieves the file url for the given |extension_path| and optionally
+ // localizes |data|.
+ // Similar to GetFileURLAndMaybeLocalizeOnFileThread, but only applies to
+ // component extension resource.
+ void GetFileURLAndLocalizeComponentResourceOnFileThread(
+ std::unique_ptr<std::string> data,
+ const std::string& extension_id,
+ const base::FilePath& extension_path,
+ const std::string& extension_default_locale,
+ bool might_require_localization);
// Run in UI thread. Code string contains the code to be executed. Returns
// true on success. If true is returned, this does an AddRef.

Powered by Google App Engine
This is Rietveld 408576698