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

Unified Diff: content/browser/renderer_host/pepper/pepper_file_message_filter.cc

Issue 11092064: Use blocking worker pool for sync file operations in Pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/pepper_file_message_filter.cc
diff --git a/content/browser/renderer_host/pepper/pepper_file_message_filter.cc b/content/browser/renderer_host/pepper/pepper_file_message_filter.cc
index e07bb990a01974cab3aa72a76a4b58b9386e0b33..d785c72ad21ee61698be43eb7107bb9093fee5bd 100644
--- a/content/browser/renderer_host/pepper/pepper_file_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_file_message_filter.cc
@@ -8,7 +8,6 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
-#include "base/metrics/field_trial.h"
#include "base/platform_file.h"
#include "base/process_util.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -62,47 +61,11 @@ IPC::PlatformFileForTransit PlatformFileToPlatformFileForTransit(
return file;
}
-// Run a field trial comparing the effect of the FILE thread versus
-// blocking worker pool on hung-plugin reports.
-// TODO(shess): Remove once the workpool is proven superior.
-// http://crbug.com/153383
-const char* const kIOFieldTrialName = "FlapperIOThread";
-const char* const kPoolGroupName = "PoolThread";
-const char* const kFileGroupName = "FileThread";
-
-bool g_use_file_thread = true;
-
-void ActivateThreadFieldTrial() {
- static bool activated = false;
- if (activated)
- return;
-
- activated = true;
-
- // The field trial will expire on Jan 1st, 2014.
- scoped_refptr<base::FieldTrial> trial(
- base::FieldTrialList::FactoryGetFieldTrial(
- kIOFieldTrialName, 1000, kPoolGroupName, 2014, 1, 1, NULL));
-
- // 50% goes into the FILE thread group.
- trial->AppendGroup(kFileGroupName, 500);
-
- g_use_file_thread = (trial->group_name() == kFileGroupName);
-}
-
} // namespace
PepperFileMessageFilter::PepperFileMessageFilter(int child_id)
: child_id_(child_id),
channel_(NULL) {
- ActivateThreadFieldTrial();
-}
-
-void PepperFileMessageFilter::OverrideThreadForMessage(
- const IPC::Message& message,
- BrowserThread::ID* thread) {
- if (IPC_MESSAGE_CLASS(message) == PepperFileMsgStart && g_use_file_thread)
- *thread = BrowserThread::FILE;
}
base::TaskRunner* PepperFileMessageFilter::OverrideTaskRunnerForMessage(
@@ -115,11 +78,8 @@ base::TaskRunner* PepperFileMessageFilter::OverrideTaskRunnerForMessage(
// the plugin has multiple threads, it cannot make assumptions about
// ordering of IPC message sends, so it cannot make assumptions
// about ordering of operations caused by those IPC messages.
- if (IPC_MESSAGE_CLASS(message) == PepperFileMsgStart) {
- // Should never get here if using the FILE thread.
- DCHECK(!g_use_file_thread);
+ if (IPC_MESSAGE_CLASS(message) == PepperFileMsgStart)
return BrowserThread::GetBlockingPool();
- }
return NULL;
}
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_file_message_filter.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698