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: chrome/renderer/render_thread.cc

Issue 99168: Replace window.external with a v8::extension. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/renderer/external_js_object.cc ('k') | chrome/renderer/render_view.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/render_thread.h" 5 #include "chrome/renderer/render_thread.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/plugin/plugin_channel.h" 22 #include "chrome/plugin/plugin_channel.h"
23 #else 23 #else
24 #include "base/scoped_handle.h" 24 #include "base/scoped_handle.h"
25 #include "chrome/plugin/plugin_channel_base.h" 25 #include "chrome/plugin/plugin_channel_base.h"
26 #include "webkit/glue/weburlrequest.h" 26 #include "webkit/glue/weburlrequest.h"
27 #endif 27 #endif
28 #include "chrome/renderer/devtools_agent_filter.h" 28 #include "chrome/renderer/devtools_agent_filter.h"
29 #include "chrome/renderer/extensions/event_bindings.h" 29 #include "chrome/renderer/extensions/event_bindings.h"
30 #include "chrome/renderer/extensions/extension_process_bindings.h" 30 #include "chrome/renderer/extensions/extension_process_bindings.h"
31 #include "chrome/renderer/extensions/renderer_extension_bindings.h" 31 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
32 #include "chrome/renderer/external_extension.h"
32 #include "chrome/renderer/js_only_v8_extensions.h" 33 #include "chrome/renderer/js_only_v8_extensions.h"
33 #include "chrome/renderer/loadtimes_extension_bindings.h" 34 #include "chrome/renderer/loadtimes_extension_bindings.h"
34 #include "chrome/renderer/net/render_dns_master.h" 35 #include "chrome/renderer/net/render_dns_master.h"
35 #include "chrome/renderer/render_process.h" 36 #include "chrome/renderer/render_process.h"
36 #include "chrome/renderer/render_view.h" 37 #include "chrome/renderer/render_view.h"
37 #include "chrome/renderer/renderer_webkitclient_impl.h" 38 #include "chrome/renderer/renderer_webkitclient_impl.h"
38 #include "chrome/renderer/user_script_slave.h" 39 #include "chrome/renderer/user_script_slave.h"
39 #include "chrome/renderer/visitedlink_slave.h" 40 #include "chrome/renderer/visitedlink_slave.h"
40 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" 41 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
41 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" 42 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // chrome-ui pages should not be accessible by normal content, and should 293 // chrome-ui pages should not be accessible by normal content, and should
293 // also be unable to script anything but themselves (to help limit the damage 294 // also be unable to script anything but themselves (to help limit the damage
294 // that a corrupt chrome-ui page could cause). 295 // that a corrupt chrome-ui page could cause).
295 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); 296 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme));
296 WebKit::registerURLSchemeAsLocal(chrome_ui_scheme); 297 WebKit::registerURLSchemeAsLocal(chrome_ui_scheme);
297 WebKit::registerURLSchemeAsNoAccess(chrome_ui_scheme); 298 WebKit::registerURLSchemeAsNoAccess(chrome_ui_scheme);
298 299
299 WebKit::registerExtension(extensions_v8::GearsExtension::Get()); 300 WebKit::registerExtension(extensions_v8::GearsExtension::Get());
300 WebKit::registerExtension(extensions_v8::IntervalExtension::Get()); 301 WebKit::registerExtension(extensions_v8::IntervalExtension::Get());
301 WebKit::registerExtension(extensions_v8::LoadTimesExtension::Get()); 302 WebKit::registerExtension(extensions_v8::LoadTimesExtension::Get());
303 WebKit::registerExtension(extensions_v8::ExternalExtension::Get());
302 304
303 WebKit::registerExtension(ExtensionProcessBindings::Get(), 305 WebKit::registerExtension(ExtensionProcessBindings::Get(),
304 WebKit::WebString::fromUTF8(chrome::kExtensionScheme)); 306 WebKit::WebString::fromUTF8(chrome::kExtensionScheme));
305 307
306 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 308 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
307 309
308 // TODO(aa): Add a way to restrict extensions to the content script context 310 // TODO(aa): Add a way to restrict extensions to the content script context
309 // only so that we don't have to gate these on --enable-extensions. 311 // only so that we don't have to gate these on --enable-extensions.
310 if (command_line.HasSwitch(switches::kEnableExtensions)) { 312 if (command_line.HasSwitch(switches::kEnableExtensions)) {
311 WebKit::registerExtension(BaseJsV8Extension::Get()); 313 WebKit::registerExtension(BaseJsV8Extension::Get());
(...skipping 30 matching lines...) Expand all
342 344
343 void RenderThread::OnPurgePluginListCache() { 345 void RenderThread::OnPurgePluginListCache() {
344 // The call below will cause a GetPlugins call with refresh=true, but at this 346 // The call below will cause a GetPlugins call with refresh=true, but at this
345 // point we already know that the browser has refreshed its list, so disable 347 // point we already know that the browser has refreshed its list, so disable
346 // refresh temporarily to prevent each renderer process causing the list to be 348 // refresh temporarily to prevent each renderer process causing the list to be
347 // regenerated. 349 // regenerated.
348 plugin_refresh_allowed_ = false; 350 plugin_refresh_allowed_ = false;
349 WebKit::resetPluginCache(); 351 WebKit::resetPluginCache();
350 plugin_refresh_allowed_ = true; 352 plugin_refresh_allowed_ = true;
351 } 353 }
OLDNEW
« no previous file with comments | « chrome/renderer/external_js_object.cc ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698