Index: chrome/renderer/extensions/user_script_scheduler.cc |
=================================================================== |
--- chrome/renderer/extensions/user_script_scheduler.cc (revision 186214) |
+++ chrome/renderer/extensions/user_script_scheduler.cc (working copy) |
@@ -5,10 +5,13 @@ |
#include "chrome/renderer/extensions/user_script_scheduler.h" |
#include "base/bind.h" |
+#include "base/logging.h" |
#include "base/message_loop.h" |
#include "chrome/common/extensions/extension_manifest_constants.h" |
#include "chrome/common/extensions/extension_messages.h" |
+#include "chrome/renderer/chrome_render_process_observer.h" |
#include "chrome/renderer/extensions/dispatcher.h" |
+#include "chrome/renderer/extensions/dom_activity_logger.h" |
#include "chrome/renderer/extensions/extension_groups.h" |
#include "chrome/renderer/extensions/extension_helper.h" |
#include "chrome/renderer/extensions/user_script_slave.h" |
@@ -201,17 +204,29 @@ |
scoped_ptr<content::V8ValueConverter> v8_converter( |
content::V8ValueConverter::create()); |
v8::Handle<v8::Value> script_value; |
+ |
if (params.in_main_world) { |
+ DOMActivityLogger::AttachToWorld( |
+ DOMActivityLogger::kMainWorldId, |
+ extension->id(), |
+ UserScriptSlave::GetDataSourceURLForFrame(child_frame), |
+ child_frame->document().title()); |
script_value = child_frame->executeScriptAndReturnValue(source); |
} else { |
WebKit::WebVector<v8::Local<v8::Value> > results; |
std::vector<WebScriptSource> sources; |
sources.push_back(source); |
+ int isolated_world_id = |
+ dispatcher_->user_script_slave()->GetIsolatedWorldIdForExtension( |
+ extension, child_frame); |
+ DOMActivityLogger::AttachToWorld( |
+ isolated_world_id, |
+ extension->id(), |
+ UserScriptSlave::GetDataSourceURLForFrame(child_frame), |
+ child_frame->document().title()); |
child_frame->executeScriptInIsolatedWorld( |
- dispatcher_->user_script_slave()-> |
- GetIsolatedWorldIdForExtension(extension, child_frame), |
- &sources.front(), sources.size(), EXTENSION_GROUP_CONTENT_SCRIPTS, |
- &results); |
+ isolated_world_id, &sources.front(), |
+ sources.size(), EXTENSION_GROUP_CONTENT_SCRIPTS, &results); |
// We only expect one value back since we only pushed one source |
if (results.size() == 1 && !results[0].IsEmpty()) |
script_value = results[0]; |