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/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
11 #include "chrome/common/child_process_logging.h" | 11 #include "chrome/common/child_process_logging.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/chrome_version_info.h" | 13 #include "chrome/common/chrome_version_info.h" |
14 #include "chrome/common/extensions/api/extension_api.h" | 14 #include "chrome/common/extensions/api/extension_api.h" |
15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
16 #include "chrome/common/extensions/extension_messages.h" | 16 #include "chrome/common/extensions/extension_messages.h" |
17 #include "chrome/common/extensions/manifest.h" | 17 #include "chrome/common/extensions/manifest.h" |
18 #include "chrome/common/extensions/message_bundle.h" | |
18 #include "chrome/common/extensions/permissions/permission_set.h" | 19 #include "chrome/common/extensions/permissions/permission_set.h" |
19 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
20 #include "chrome/common/view_type.h" | 21 #include "chrome/common/view_type.h" |
21 #include "chrome/renderer/chrome_render_process_observer.h" | 22 #include "chrome/renderer/chrome_render_process_observer.h" |
22 #include "chrome/renderer/extensions/api_definitions_natives.h" | 23 #include "chrome/renderer/extensions/api_definitions_natives.h" |
23 #include "chrome/renderer/extensions/app_bindings.h" | 24 #include "chrome/renderer/extensions/app_bindings.h" |
24 #include "chrome/renderer/extensions/app_runtime_custom_bindings.h" | 25 #include "chrome/renderer/extensions/app_runtime_custom_bindings.h" |
25 #include "chrome/renderer/extensions/app_window_custom_bindings.h" | 26 #include "chrome/renderer/extensions/app_window_custom_bindings.h" |
26 #include "chrome/renderer/extensions/chrome_v8_context.h" | 27 #include "chrome/renderer/extensions/chrome_v8_context.h" |
27 #include "chrome/renderer/extensions/chrome_v8_extension.h" | 28 #include "chrome/renderer/extensions/chrome_v8_extension.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 extensions_.Remove(id); | 508 extensions_.Remove(id); |
508 active_extension_ids_.erase(id); | 509 active_extension_ids_.erase(id); |
509 | 510 |
510 // If the extension is later reloaded with a different set of permissions, | 511 // If the extension is later reloaded with a different set of permissions, |
511 // we'd like it to get a new isolated world ID, so that it can pick up the | 512 // we'd like it to get a new isolated world ID, so that it can pick up the |
512 // changed origin whitelist. | 513 // changed origin whitelist. |
513 user_script_slave_->RemoveIsolatedWorld(id); | 514 user_script_slave_->RemoveIsolatedWorld(id); |
514 | 515 |
515 v8_context_set_.OnExtensionUnloaded(id); | 516 v8_context_set_.OnExtensionUnloaded(id); |
516 | 517 |
518 // Invalidates messages map for id incase extension is reloaded with | |
Devlin
2013/02/22 19:59:07
"Invalidates _the_ messages map for the extension
Patrick Riordan
2013/02/26 05:05:20
Done.
| |
519 // new messages map. | |
520 EraseL10nMessagesMap(id); | |
521 | |
517 // We don't do anything with existing platform-app stylesheets. They will | 522 // We don't do anything with existing platform-app stylesheets. They will |
518 // stay resident, but the URL pattern corresponding to the unloaded | 523 // stay resident, but the URL pattern corresponding to the unloaded |
519 // extension's URL just won't match anything anymore. | 524 // extension's URL just won't match anything anymore. |
520 } | 525 } |
521 | 526 |
522 void Dispatcher::OnSetScriptingWhitelist( | 527 void Dispatcher::OnSetScriptingWhitelist( |
523 const Extension::ScriptingWhitelist& extension_ids) { | 528 const Extension::ScriptingWhitelist& extension_ids) { |
524 Extension::SetScriptingWhitelist(extension_ids); | 529 Extension::SetScriptingWhitelist(extension_ids); |
525 } | 530 } |
526 | 531 |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1149 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1154 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
1150 v8::ThrowException( | 1155 v8::ThrowException( |
1151 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1156 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
1152 return false; | 1157 return false; |
1153 } | 1158 } |
1154 | 1159 |
1155 return true; | 1160 return true; |
1156 } | 1161 } |
1157 | 1162 |
1158 } // namespace extensions | 1163 } // namespace extensions |
OLD | NEW |