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

Unified Diff: chrome/browser/idbbindingutilities_browsertest.cc

Issue 6995095: Move UtilityProcessHost to content and move the message sending/dispatching to the clients. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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: chrome/browser/idbbindingutilities_browsertest.cc
===================================================================
--- chrome/browser/idbbindingutilities_browsertest.cc (revision 88480)
+++ chrome/browser/idbbindingutilities_browsertest.cc (working copy)
@@ -4,12 +4,13 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/utility_process_host.h"
#include "chrome/test/in_process_browser_test.h"
#include "chrome/test/ui_test_utils.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
+#include "content/browser/utility_process_host.h"
#include "content/common/indexed_db_key.h"
#include "content/common/serialized_script_value.h"
+#include "content/common/utility_messages.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h"
@@ -119,9 +120,9 @@
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool ret =
- utility_process_host_->StartIDBKeysFromValuesAndKeyPath(
- id, serialized_values, key_path);
+ bool ret = utility_process_host_->Send(
+ new UtilityMsg_IDBKeysFromValuesAndKeyPath(
+ id, serialized_values, key_path));
ASSERT_TRUE(ret);
}
@@ -136,12 +137,27 @@
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool ret = utility_process_host_->StartInjectIDBKey(key, value, key_path);
+ bool ret = utility_process_host_->Send(new UtilityMsg_InjectIDBKey(
+ key, value, key_path));
ASSERT_TRUE(ret);
}
// UtilityProcessHost::Client
- virtual void OnIDBKeysFromValuesAndKeyPathSucceeded(
+ bool OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(IDBKeyPathHelper, message)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded,
+ OnIDBKeysFromValuesAndKeyPathSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed,
+ OnIDBKeysFromValuesAndKeyPathFailed)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_InjectIDBKey_Finished,
+ OnInjectIDBKeyFinished)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP_EX()
+ return handled;
+ }
+
+ void OnIDBKeysFromValuesAndKeyPathSucceeded(
int id, const std::vector<IndexedDBKey>& values) {
EXPECT_EQ(expected_id_, id);
EXPECT_FALSE(value_for_key_path_failed_);
@@ -160,14 +176,13 @@
new MessageLoop::QuitTask());
}
- virtual void OnIDBKeysFromValuesAndKeyPathFailed(int id) {
+ void OnIDBKeysFromValuesAndKeyPathFailed(int id) {
EXPECT_TRUE(value_for_key_path_failed_);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
new MessageLoop::QuitTask());
}
- virtual void OnInjectIDBKeyFinished(
- const SerializedScriptValue& new_value) {
+ void OnInjectIDBKeyFinished(const SerializedScriptValue& new_value) {
EXPECT_EQ(expected_value_.data(), new_value.data());
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
new MessageLoop::QuitTask());

Powered by Google App Engine
This is Rietveld 408576698