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

Unified Diff: extensions/renderer/dispatcher.h

Issue 1142993002: Don't send unnecessary ExtensionMsg_Loaded IPCs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a test Created 5 years, 7 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/renderer/dispatcher.h
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h
index 5ec0c6cb473aeb1d6170098479f1d7126b1a5b1a..51a7f6b4441e6644fb45b4e126541ec12850a0f5 100644
--- a/extensions/renderer/dispatcher.h
+++ b/extensions/renderer/dispatcher.h
@@ -137,10 +137,18 @@ class Dispatcher : public content::RenderProcessObserver,
bool WasWebRequestUsedBySomeExtensions() const { return webrequest_used_; }
private:
+ // The RendererPermissionsPolicyDelegateTest.CannotScriptWebstore test needs
+ // to call InsertExtensionForTest and the OnActivateExtension IPCs.
Devlin 2015/06/03 20:53:37 There is no InsertExtensionForTest ;)
not at google - send to devlin 2015/06/03 21:53:03 LoadExtensionForTest, oops.
friend class ::ChromeRenderViewTest;
FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest,
CannotScriptWebstore);
+ // Inserts an Extension into |extensions_|. Normally the only way to do this
+ // would be through the ExtensionMsg_Loaded IPC (OnLoaded) but this can't be
+ // triggered for tests, because in the process of serializing then
+ // deserializing the IPC, Extension IDs manually set for testing are lost.
+ void LoadExtensionForTest(const Extension* extension);
+
// RenderProcessObserver implementation:
bool OnControlMessageReceived(const IPC::Message& message) override;
void WebKitInitialized() override;
@@ -158,7 +166,6 @@ class Dispatcher : public content::RenderProcessObserver,
void OnDispatchOnDisconnect(int port_id, const std::string& error_message);
void OnLoaded(
const std::vector<ExtensionMsg_Loaded_Params>& loaded_extensions);
- void OnLoadedInternal(scoped_refptr<const Extension> extension);
void OnMessageInvoke(const std::string& extension_id,
const std::string& module_name,
const std::string& function_name,

Powered by Google App Engine
This is Rietveld 408576698