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

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: 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
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect) 454 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect)
455 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded) 455 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded)
456 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke) 456 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke)
457 IPC_MESSAGE_HANDLER(ExtensionMsg_SetChannel, OnSetChannel) 457 IPC_MESSAGE_HANDLER(ExtensionMsg_SetChannel, OnSetChannel)
458 IPC_MESSAGE_HANDLER(ExtensionMsg_SetFunctionNames, OnSetFunctionNames) 458 IPC_MESSAGE_HANDLER(ExtensionMsg_SetFunctionNames, OnSetFunctionNames)
459 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist, 459 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist,
460 OnSetScriptingWhitelist) 460 OnSetScriptingWhitelist)
461 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont) 461 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont)
462 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend) 462 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend)
463 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend) 463 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend)
464 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs)
464 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded) 465 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded)
465 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions) 466 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions)
466 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateTabSpecificPermissions, 467 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateTabSpecificPermissions,
467 OnUpdateTabSpecificPermissions) 468 OnUpdateTabSpecificPermissions)
468 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateUserScripts, OnUpdateUserScripts) 469 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateUserScripts, OnUpdateUserScripts)
469 IPC_MESSAGE_HANDLER(ExtensionMsg_UsingWebRequestAPI, OnUsingWebRequestAPI) 470 IPC_MESSAGE_HANDLER(ExtensionMsg_UsingWebRequestAPI, OnUsingWebRequestAPI)
470 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages, 471 IPC_MESSAGE_FORWARD(ExtensionMsg_WatchPages,
471 content_watcher_.get(), 472 content_watcher_.get(),
472 ContentWatcher::OnWatchPages) 473 ContentWatcher::OnWatchPages)
473 IPC_MESSAGE_UNHANDLED(handled = false) 474 IPC_MESSAGE_UNHANDLED(handled = false)
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 void Dispatcher::OnSuspend(const std::string& extension_id) { 674 void Dispatcher::OnSuspend(const std::string& extension_id) {
674 // Dispatch the suspend event. This doesn't go through the standard event 675 // Dispatch the suspend event. This doesn't go through the standard event
675 // dispatch machinery because it requires special handling. We need to let 676 // dispatch machinery because it requires special handling. We need to let
676 // the browser know when we are starting and stopping the event dispatch, so 677 // the browser know when we are starting and stopping the event dispatch, so
677 // that it still considers the extension idle despite any activity the suspend 678 // that it still considers the extension idle despite any activity the suspend
678 // event creates. 679 // event creates.
679 DispatchEvent(extension_id, kOnSuspendEvent); 680 DispatchEvent(extension_id, kOnSuspendEvent);
680 RenderThread::Get()->Send(new ExtensionHostMsg_SuspendAck(extension_id)); 681 RenderThread::Get()->Send(new ExtensionHostMsg_SuspendAck(extension_id));
681 } 682 }
682 683
684 void Dispatcher::OnTransferBlobs(const std::vector<std::string>& blob_uuids) {
685 RenderThread::Get()->Send(new ExtensionHostMsg_TransferBlobsAck(blob_uuids));
686 }
687
683 void Dispatcher::OnUnloaded(const std::string& id) { 688 void Dispatcher::OnUnloaded(const std::string& id) {
684 extensions_.Remove(id); 689 extensions_.Remove(id);
685 active_extension_ids_.erase(id); 690 active_extension_ids_.erase(id);
686 691
687 // If the extension is later reloaded with a different set of permissions, 692 // If the extension is later reloaded with a different set of permissions,
688 // we'd like it to get a new isolated world ID, so that it can pick up the 693 // we'd like it to get a new isolated world ID, so that it can pick up the
689 // changed origin whitelist. 694 // changed origin whitelist.
690 user_script_slave_->RemoveIsolatedWorld(id); 695 user_script_slave_->RemoveIsolatedWorld(id);
691 696
692 // Invalidate all of the contexts that were removed. 697 // Invalidate all of the contexts that were removed.
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 return v8::Handle<v8::Object>(); 1218 return v8::Handle<v8::Object>();
1214 1219
1215 if (bind_name) 1220 if (bind_name)
1216 *bind_name = split.back(); 1221 *bind_name = split.back();
1217 1222
1218 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1223 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1219 : bind_object; 1224 : bind_object;
1220 } 1225 }
1221 1226
1222 } // namespace extensions 1227 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698