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

Side by Side Diff: webkit/glue/webframe_impl.cc

Issue 262002: Make all content scripts from an extension run in the same (Closed)
Patch Set: Created 11 years, 2 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
« no previous file with comments | « webkit/glue/webframe_impl.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 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 for (unsigned i = 0; i < num_sources; ++i) { 621 for (unsigned i = 0; i < num_sources; ++i) {
622 sources.append(WebCore::ScriptSourceCode( 622 sources.append(WebCore::ScriptSourceCode(
623 webkit_glue::WebStringToString(sources_in[i].code), 623 webkit_glue::WebStringToString(sources_in[i].code),
624 webkit_glue::WebURLToKURL(sources_in[i].url), 624 webkit_glue::WebURLToKURL(sources_in[i].url),
625 sources_in[i].startLine)); 625 sources_in[i].startLine));
626 } 626 }
627 627
628 frame_->script()->evaluateInNewContext(sources, extension_group); 628 frame_->script()->evaluateInNewContext(sources, extension_group);
629 } 629 }
630 630
631 void WebFrameImpl::executeScriptInNewWorld( 631 void WebFrameImpl::executeScriptInIsolatedWorld(
632 const WebScriptSource* sources_in, unsigned num_sources, 632 int world_id, const WebScriptSource* sources_in, unsigned num_sources,
633 int extension_group) { 633 int extension_group) {
634 Vector<WebCore::ScriptSourceCode> sources; 634 Vector<WebCore::ScriptSourceCode> sources;
635 635
636 for (unsigned i = 0; i < num_sources; ++i) { 636 for (unsigned i = 0; i < num_sources; ++i) {
637 sources.append(WebCore::ScriptSourceCode( 637 sources.append(WebCore::ScriptSourceCode(
638 webkit_glue::WebStringToString(sources_in[i].code), 638 webkit_glue::WebStringToString(sources_in[i].code),
639 webkit_glue::WebURLToKURL(sources_in[i].url), 639 webkit_glue::WebURLToKURL(sources_in[i].url),
640 sources_in[i].startLine)); 640 sources_in[i].startLine));
641 } 641 }
642 642
643 frame_->script()->evaluateInNewWorld(sources, extension_group); 643 frame_->script()->evaluateInIsolatedWorld(world_id, sources, extension_group);
644 } 644 }
645 645
646 void WebFrameImpl::addMessageToConsole(const WebConsoleMessage& message) { 646 void WebFrameImpl::addMessageToConsole(const WebConsoleMessage& message) {
647 ASSERT(frame()); 647 ASSERT(frame());
648 648
649 WebCore::MessageLevel webcore_message_level; 649 WebCore::MessageLevel webcore_message_level;
650 switch (message.level) { 650 switch (message.level) {
651 case WebConsoleMessage::LevelTip: 651 case WebConsoleMessage::LevelTip:
652 webcore_message_level = WebCore::TipMessageLevel; 652 webcore_message_level = WebCore::TipMessageLevel;
653 break; 653 break;
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 1900
1901 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); 1901 SecurityOrigin* security_origin = frame_->document()->securityOrigin();
1902 1902
1903 if (!frame_->redirectScheduler()->locationChangePending()) { 1903 if (!frame_->redirectScheduler()->locationChangePending()) {
1904 frame_->loader()->stopAllLoaders(); 1904 frame_->loader()->stopAllLoaders();
1905 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); 1905 frame_->loader()->begin(frame_->loader()->url(), true, security_origin);
1906 frame_->loader()->write(script_result); 1906 frame_->loader()->write(script_result);
1907 frame_->loader()->end(); 1907 frame_->loader()->end();
1908 } 1908 }
1909 } 1909 }
OLDNEW
« no previous file with comments | « webkit/glue/webframe_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698