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

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

Issue 21272: janitorial: browser_render_process_host header/lint cleanup. (try 2) (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"
13 14
14 // These two strings are injected before and after the Greasemonkey API and 15 // These two strings are injected before and after the Greasemonkey API and
15 // user script to wrap it in an anonymous scope. 16 // user script to wrap it in an anonymous scope.
16 static const char kUserScriptHead[] = "(function (unsafeWindow) {\n"; 17 static const char kUserScriptHead[] = "(function (unsafeWindow) {\n";
17 static const char kUserScriptTail[] = "\n})(window);"; 18 static const char kUserScriptTail[] = "\n})(window);";
18 19
19 UserScriptSlave::UserScriptSlave() 20 UserScriptSlave::UserScriptSlave()
20 : shared_memory_(NULL), 21 : shared_memory_(NULL),
21 script_deleter_(&scripts_), 22 script_deleter_(&scripts_),
22 user_script_start_line_(0) { 23 user_script_start_line_(0) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 inject.append(script_contents_[*script].as_string()); 97 inject.append(script_contents_[*script].as_string());
97 inject.append(kUserScriptTail); 98 inject.append(kUserScriptTail);
98 frame->ExecuteJavaScript(inject, 99 frame->ExecuteJavaScript(inject,
99 GURL((*script)->url().spec()), 100 GURL((*script)->url().spec()),
100 -user_script_start_line_); 101 -user_script_start_line_);
101 } 102 }
102 } 103 }
103 104
104 return true; 105 return true;
105 } 106 }
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