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

Side by Side Diff: chrome/renderer/user_script_slave.cc

Issue 20276: Reverting 9594. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « chrome/renderer/user_script_slave.h ('k') | chrome/renderer/webmediaplayer_delegate_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/renderer/user_script_slave.h" 5 #include "chrome/renderer/user_script_slave.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "chrome/common/resource_bundle.h" 10 #include "chrome/common/resource_bundle.h"
11 #include "chrome/renderer/renderer_resources.h" 11 #include "chrome/renderer/renderer_resources.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 #include "webkit/glue/webframe.h"
14 13
15 // These two strings are injected before and after the Greasemonkey API and 14 // These two strings are injected before and after the Greasemonkey API and
16 // user script to wrap it in an anonymous scope. 15 // user script to wrap it in an anonymous scope.
17 static const char kUserScriptHead[] = "(function (unsafeWindow) {\n"; 16 static const char kUserScriptHead[] = "(function (unsafeWindow) {\n";
18 static const char kUserScriptTail[] = "\n})(window);"; 17 static const char kUserScriptTail[] = "\n})(window);";
19 18
20 UserScriptSlave::UserScriptSlave() 19 UserScriptSlave::UserScriptSlave()
21 : shared_memory_(NULL), 20 : shared_memory_(NULL),
22 script_deleter_(&scripts_), 21 script_deleter_(&scripts_),
23 user_script_start_line_(0) { 22 user_script_start_line_(0) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 inject.append(script_contents_[*script].as_string()); 96 inject.append(script_contents_[*script].as_string());
98 inject.append(kUserScriptTail); 97 inject.append(kUserScriptTail);
99 frame->ExecuteJavaScript(inject, 98 frame->ExecuteJavaScript(inject,
100 GURL((*script)->url().spec()), 99 GURL((*script)->url().spec()),
101 -user_script_start_line_); 100 -user_script_start_line_);
102 } 101 }
103 } 102 }
104 103
105 return true; 104 return true;
106 } 105 }
OLDNEW
« no previous file with comments | « chrome/renderer/user_script_slave.h ('k') | chrome/renderer/webmediaplayer_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698