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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 280393003: Blobs: Catching browser-process created Blobs in extension code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clear out some stray includes Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/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/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect) 455 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect)
456 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded) 456 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded)
457 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke) 457 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke)
458 IPC_MESSAGE_HANDLER(ExtensionMsg_SetChannel, OnSetChannel) 458 IPC_MESSAGE_HANDLER(ExtensionMsg_SetChannel, OnSetChannel)
459 IPC_MESSAGE_HANDLER(ExtensionMsg_SetFunctionNames, OnSetFunctionNames) 459 IPC_MESSAGE_HANDLER(ExtensionMsg_SetFunctionNames, OnSetFunctionNames)
460 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist, 460 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist,
461 OnSetScriptingWhitelist) 461 OnSetScriptingWhitelist)
462 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont) 462 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont)
463 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend) 463 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend)
464 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend) 464 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend)
465 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs)
465 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded) 466 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded)
466 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions) 467 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions)
467 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateTabSpecificPermissions, 468 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateTabSpecificPermissions,
468 OnUpdateTabSpecificPermissions) 469 OnUpdateTabSpecificPermissions)
469 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateUserScripts, OnUpdateUserScripts) 470 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateUserScripts, OnUpdateUserScripts)
470 IPC_MESSAGE_HANDLER(ExtensionMsg_UsingWebRequestAPI, OnUsingWebRequestAPI) 471 IPC_MESSAGE_HANDLER(ExtensionMsg_UsingWebRequestAPI, OnUsingWebRequestAPI)
471 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages, 472 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages,
472 content_watcher_.get(), 473 content_watcher_.get(),
473 ContentWatcher::OnWatchPages) 474 ContentWatcher::OnWatchPages)
474 IPC_MESSAGE_UNHANDLED(handled = false) 475 IPC_MESSAGE_UNHANDLED(handled = false)
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 void Dispatcher::OnSuspend(const std::string& extension_id) { 675 void Dispatcher::OnSuspend(const std::string& extension_id) {
675 // Dispatch the suspend event. This doesn't go through the standard event 676 // Dispatch the suspend event. This doesn't go through the standard event
676 // dispatch machinery because it requires special handling. We need to let 677 // dispatch machinery because it requires special handling. We need to let
677 // the browser know when we are starting and stopping the event dispatch, so 678 // the browser know when we are starting and stopping the event dispatch, so
678 // that it still considers the extension idle despite any activity the suspend 679 // that it still considers the extension idle despite any activity the suspend
679 // event creates. 680 // event creates.
680 DispatchEvent(extension_id, kOnSuspendEvent); 681 DispatchEvent(extension_id, kOnSuspendEvent);
681 RenderThread::Get()->Send(new ExtensionHostMsg_SuspendAck(extension_id)); 682 RenderThread::Get()->Send(new ExtensionHostMsg_SuspendAck(extension_id));
682 } 683 }
683 684
685 void Dispatcher::OnTransferBlobs(int routing_id,
686 const std::vector<std::string>& blob_uuids) {
687 RenderThread::Get()->Send(
688 new ExtensionHostMsg_TransferBlobsAck(routing_id, blob_uuids));
689 }
690
684 void Dispatcher::OnUnloaded(const std::string& id) { 691 void Dispatcher::OnUnloaded(const std::string& id) {
685 extensions_.Remove(id); 692 extensions_.Remove(id);
686 active_extension_ids_.erase(id); 693 active_extension_ids_.erase(id);
687 694
688 // If the extension is later reloaded with a different set of permissions, 695 // If the extension is later reloaded with a different set of permissions,
689 // we'd like it to get a new isolated world ID, so that it can pick up the 696 // we'd like it to get a new isolated world ID, so that it can pick up the
690 // changed origin whitelist. 697 // changed origin whitelist.
691 user_script_slave_->RemoveIsolatedWorld(id); 698 user_script_slave_->RemoveIsolatedWorld(id);
692 699
693 // Invalidate all of the contexts that were removed. 700 // Invalidate all of the contexts that were removed.
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 return v8::Handle<v8::Object>(); 1219 return v8::Handle<v8::Object>();
1213 1220
1214 if (bind_name) 1221 if (bind_name)
1215 *bind_name = split.back(); 1222 *bind_name = split.back();
1216 1223
1217 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1224 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1218 : bind_object; 1225 : bind_object;
1219 } 1226 }
1220 1227
1221 } // namespace extensions 1228 } // namespace extensions
OLDNEW
« extensions/browser/extension_function.cc ('K') | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698