OLD | NEW |
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/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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 WebKit::registerExtension(extensions_v8::BenchmarkingExtension::Get()); | 408 WebKit::registerExtension(extensions_v8::BenchmarkingExtension::Get()); |
409 | 409 |
410 if (command_line.HasSwitch(switches::kPlaybackMode) || | 410 if (command_line.HasSwitch(switches::kPlaybackMode) || |
411 command_line.HasSwitch(switches::kRecordMode) || | 411 command_line.HasSwitch(switches::kRecordMode) || |
412 command_line.HasSwitch(switches::kNoJsRandomness)) { | 412 command_line.HasSwitch(switches::kNoJsRandomness)) { |
413 WebKit::registerExtension(extensions_v8::PlaybackExtension::Get()); | 413 WebKit::registerExtension(extensions_v8::PlaybackExtension::Get()); |
414 } | 414 } |
415 | 415 |
416 if (RenderProcess::current()->initialized_media_library()) | 416 if (RenderProcess::current()->initialized_media_library()) |
417 WebKit::enableMediaPlayer(); | 417 WebKit::enableMediaPlayer(); |
418 | |
419 // Note: We are forcing --enable-databases to on with --enable-extensions so | |
420 // that extension developers can test databases. | |
421 if (command_line.HasSwitch(switches::kEnableDatabases) || | |
422 command_line.HasSwitch(switches::kEnableExtensions)) { | |
423 WebKit::enableDatabases(); | |
424 } | |
425 } | 418 } |
426 | 419 |
427 void RenderThread::OnExtensionMessageInvoke(const std::string& function_name, | 420 void RenderThread::OnExtensionMessageInvoke(const std::string& function_name, |
428 const ListValue& args) { | 421 const ListValue& args) { |
429 RendererExtensionBindings::Invoke(function_name, args, NULL); | 422 RendererExtensionBindings::Invoke(function_name, args, NULL); |
430 } | 423 } |
431 | 424 |
432 void RenderThread::OnPurgePluginListCache() { | 425 void RenderThread::OnPurgePluginListCache() { |
433 // The call below will cause a GetPlugins call with refresh=true, but at this | 426 // The call below will cause a GetPlugins call with refresh=true, but at this |
434 // point we already know that the browser has refreshed its list, so disable | 427 // point we already know that the browser has refreshed its list, so disable |
435 // refresh temporarily to prevent each renderer process causing the list to be | 428 // refresh temporarily to prevent each renderer process causing the list to be |
436 // regenerated. | 429 // regenerated. |
437 plugin_refresh_allowed_ = false; | 430 plugin_refresh_allowed_ = false; |
438 WebKit::resetPluginCache(); | 431 WebKit::resetPluginCache(); |
439 plugin_refresh_allowed_ = true; | 432 plugin_refresh_allowed_ = true; |
440 } | 433 } |
OLD | NEW |