Move Tuple to base namespace.
Namespace change only, no functionality change. The only non-search-and-replace change is in generate_gmock_mutant.py which changes some line wrapping logic for the generated gmock_mutant header. NOPRESUBMIT=true (No presubmit due to long lines in the generated gmock_mutant.h header). R=sky Review URL: https://codereview.chromium.org/1159553007 Cr-Commit-Position: refs/heads/master@{#332058}
This commit is contained in:
base
chrome
browser
apps
app_shim
extensions
api
web_request
password_manager
safe_browsing
search
spellchecker
translate
ui
common
renderer
autofill
autofill_renderer_browsertest.ccform_autocomplete_browsertest.ccpassword_autofill_agent_browsertest.cc
spellchecker
translate
utility
components
autofill
content
gcm_driver
guest_view
renderer
login
nacl
loader
password_manager
content
printing
content
browser
devtools
frame_host
renderer_host
input
media
p2p
pepper
render_widget_host_impl.ccrender_widget_host_unittest.ccrender_widget_host_view_aura_unittest.ccrender_widget_host_view_mac_unittest.mmservice_worker
shared_worker
web_contents
child
common
gpu
renderer
accessibility
browser_plugin
external_popup_menu_browsertest.ccinput
media
pepper
render_frame_proxy.ccrender_view_browsertest.ccrender_widget_unittest.ccscreen_orientation
extensions
browser
common
utility
ipc
net/quic
ppapi
host
proxy
printing
sandbox/linux/bpf_dsl
storage/browser/fileapi
copy_or_move_operation_delegate.ccfile_system_operation_impl.ccfile_system_operation_runner.ccobfuscated_file_util.ccsandbox_file_stream_writer.cc
testing
tools/ipc_fuzzer/fuzzer
ui
base
ozone
platform
shell_dialogs
@ -172,8 +172,8 @@ class ObserverListThreadSafe
|
||||
void Notify(const tracked_objects::Location& from_here,
|
||||
Method m,
|
||||
const Params&... params) {
|
||||
UnboundMethod<ObserverType, Method, Tuple<Params...>> method(
|
||||
m, MakeTuple(params...));
|
||||
UnboundMethod<ObserverType, Method, base::Tuple<Params...>> method(
|
||||
m, base::MakeTuple(params...));
|
||||
|
||||
base::AutoLock lock(list_lock_);
|
||||
for (const auto& entry : observer_lists_) {
|
||||
@ -182,7 +182,7 @@ class ObserverListThreadSafe
|
||||
from_here,
|
||||
base::Bind(
|
||||
&ObserverListThreadSafe<ObserverType>::template NotifyWrapper<
|
||||
Method, Tuple<Params...>>,
|
||||
Method, base::Tuple<Params...>>,
|
||||
this, context, method));
|
||||
}
|
||||
}
|
||||
|
10
base/tuple.h
10
base/tuple.h
@ -30,6 +30,8 @@
|
||||
|
||||
#include "base/bind_helpers.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
// Index sequences
|
||||
//
|
||||
// Minimal clone of the similarly-named C++14 functionality.
|
||||
@ -181,9 +183,9 @@ struct TupleLeaf {
|
||||
// Allows accessing an arbitrary tuple element by index.
|
||||
//
|
||||
// Example usage:
|
||||
// Tuple<int, double> t2;
|
||||
// get<0>(t2) = 42;
|
||||
// get<1>(t2) = 3.14;
|
||||
// base::Tuple<int, double> t2;
|
||||
// base::get<0>(t2) = 42;
|
||||
// base::get<1>(t2) = 3.14;
|
||||
|
||||
template <size_t I, typename T>
|
||||
T& get(TupleLeaf<I, T>& leaf) {
|
||||
@ -329,4 +331,6 @@ inline void DispatchToMethod(ObjT* obj,
|
||||
MakeIndexSequence<sizeof...(OutTs)>());
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // BASE_TUPLE_H_
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
namespace {
|
||||
|
||||
void DoAdd(int a, int b, int c, int* res) {
|
||||
@ -30,14 +32,15 @@ struct Addz {
|
||||
} // namespace
|
||||
|
||||
TEST(TupleTest, Basic) {
|
||||
Tuple<> t0 = MakeTuple();
|
||||
base::Tuple<> t0 = base::MakeTuple();
|
||||
ALLOW_UNUSED_LOCAL(t0);
|
||||
Tuple<int> t1(1);
|
||||
Tuple<int, const char*> t2 = MakeTuple(1, static_cast<const char*>("wee"));
|
||||
Tuple<int, int, int> t3(1, 2, 3);
|
||||
Tuple<int, int, int, int*> t4(1, 2, 3, &get<0>(t1));
|
||||
Tuple<int, int, int, int, int*> t5(1, 2, 3, 4, &get<0>(t4));
|
||||
Tuple<int, int, int, int, int, int*> t6(1, 2, 3, 4, 5, &get<0>(t4));
|
||||
base::Tuple<int> t1(1);
|
||||
base::Tuple<int, const char*> t2 =
|
||||
base::MakeTuple(1, static_cast<const char*>("wee"));
|
||||
base::Tuple<int, int, int> t3(1, 2, 3);
|
||||
base::Tuple<int, int, int, int*> t4(1, 2, 3, &get<0>(t1));
|
||||
base::Tuple<int, int, int, int, int*> t5(1, 2, 3, 4, &get<0>(t4));
|
||||
base::Tuple<int, int, int, int, int, int*> t6(1, 2, 3, 4, 5, &get<0>(t4));
|
||||
|
||||
EXPECT_EQ(1, get<0>(t1));
|
||||
EXPECT_EQ(1, get<0>(t2));
|
||||
@ -62,7 +65,7 @@ TEST(TupleTest, Basic) {
|
||||
EXPECT_EQ(6, get<0>(t1));
|
||||
|
||||
int res = 0;
|
||||
DispatchToFunction(&DoAdd, MakeTuple(9, 8, 7, &res));
|
||||
DispatchToFunction(&DoAdd, base::MakeTuple(9, 8, 7, &res));
|
||||
EXPECT_EQ(24, res);
|
||||
|
||||
Addy addy;
|
||||
@ -108,7 +111,7 @@ TEST(TupleTest, Copying) {
|
||||
bool res = false;
|
||||
|
||||
// Creating the tuple should copy the class to store internally in the tuple.
|
||||
Tuple<CopyLogger, CopyLogger*, bool*> tuple(logger, &logger, &res);
|
||||
base::Tuple<CopyLogger, CopyLogger*, bool*> tuple(logger, &logger, &res);
|
||||
get<1>(tuple) = &get<0>(tuple);
|
||||
EXPECT_EQ(2, CopyLogger::TimesConstructed);
|
||||
EXPECT_EQ(1, CopyLogger::TimesCopied);
|
||||
@ -127,3 +130,5 @@ TEST(TupleTest, Copying) {
|
||||
EXPECT_EQ(3, CopyLogger::TimesConstructed);
|
||||
EXPECT_EQ(2, CopyLogger::TimesCopied);
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
@ -74,7 +74,7 @@ class AppShimHostTest : public testing::Test,
|
||||
EXPECT_EQ(AppShimMsg_LaunchApp_Done::ID, message->type());
|
||||
AppShimMsg_LaunchApp_Done::Param param;
|
||||
AppShimMsg_LaunchApp_Done::Read(message, ¶m);
|
||||
return get<0>(param);
|
||||
return base::get<0>(param);
|
||||
}
|
||||
|
||||
void SimulateDisconnect() {
|
||||
|
@ -121,9 +121,9 @@ void GetPartOfMessageArguments(IPC::Message* message,
|
||||
ExtensionMsg_MessageInvoke::Param* param) {
|
||||
ASSERT_EQ(ExtensionMsg_MessageInvoke::ID, message->type());
|
||||
ASSERT_TRUE(ExtensionMsg_MessageInvoke::Read(message, param));
|
||||
ASSERT_GE(get<3>(*param).GetSize(), 2u);
|
||||
ASSERT_GE(base::get<3>(*param).GetSize(), 2u);
|
||||
const base::Value* value = NULL;
|
||||
ASSERT_TRUE(get<3>(*param).Get(1, &value));
|
||||
ASSERT_TRUE(base::get<3>(*param).Get(1, &value));
|
||||
const base::ListValue* list = NULL;
|
||||
ASSERT_TRUE(value->GetAsList(&list));
|
||||
ASSERT_EQ(1u, list->GetSize());
|
||||
@ -925,7 +925,7 @@ TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) {
|
||||
continue;
|
||||
ExtensionMsg_MessageInvoke::Param message_tuple;
|
||||
ExtensionMsg_MessageInvoke::Read(message, &message_tuple);
|
||||
base::ListValue& args = get<3>(message_tuple);
|
||||
base::ListValue& args = base::get<3>(message_tuple);
|
||||
|
||||
std::string event_name;
|
||||
if (!args.GetString(0, &event_name) ||
|
||||
|
@ -119,9 +119,9 @@ bool ChromePasswordManagerClientTest::WasLoggingActivationMessageSent(
|
||||
process()->sink().GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<bool> param;
|
||||
base::Tuple<bool> param;
|
||||
AutofillMsg_SetLoggingState::Read(message, ¶m);
|
||||
*activation_flag = get<0>(param);
|
||||
*activation_flag = base::get<0>(param);
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
}
|
||||
|
@ -325,9 +325,9 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
|
||||
SafeBrowsingMsg_StartPhishingDetection::ID);
|
||||
if (url) {
|
||||
ASSERT_TRUE(msg);
|
||||
Tuple<GURL> actual_url;
|
||||
base::Tuple<GURL> actual_url;
|
||||
SafeBrowsingMsg_StartPhishingDetection::Read(msg, &actual_url);
|
||||
EXPECT_EQ(*url, get<0>(actual_url));
|
||||
EXPECT_EQ(*url, base::get<0>(actual_url));
|
||||
EXPECT_EQ(rvh()->GetRoutingID(), msg->routing_id());
|
||||
process()->sink().ClearMessages();
|
||||
} else {
|
||||
|
@ -109,8 +109,8 @@ TEST_F(InstantServiceEnabledTest, SendsSearchURLsToRenderer) {
|
||||
ASSERT_TRUE(msg);
|
||||
ChromeViewMsg_SetSearchURLs::Param params;
|
||||
ChromeViewMsg_SetSearchURLs::Read(msg, ¶ms);
|
||||
std::vector<GURL> search_urls = get<0>(params);
|
||||
GURL new_tab_page_url = get<1>(params);
|
||||
std::vector<GURL> search_urls = base::get<0>(params);
|
||||
GURL new_tab_page_url = base::get<1>(params);
|
||||
EXPECT_EQ(2U, search_urls.size());
|
||||
EXPECT_EQ("https://www.google.com/alt#quux=", search_urls[0].spec());
|
||||
EXPECT_EQ("https://www.google.com/url?bar=", search_urls[1].spec());
|
||||
|
@ -52,7 +52,7 @@ IN_PROC_BROWSER_TEST_F(SpellCheckMessageFilterMacBrowserTest,
|
||||
SpellCheckMsg_RespondTextCheck::Param params;
|
||||
bool ok = SpellCheckMsg_RespondTextCheck::Read(
|
||||
target->sent_messages_[0], ¶ms);
|
||||
std::vector<SpellCheckResult> sent_results = get<1>(params);
|
||||
std::vector<SpellCheckResult> sent_results = base::get<1>(params);
|
||||
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(1U, sent_results.size());
|
||||
|
@ -104,10 +104,10 @@ TEST(SpellCheckMessageFilterTest, OnTextCheckCompleteTestCustomDictionary) {
|
||||
SpellCheckMsg_RespondSpellingService::Param params;
|
||||
bool ok = SpellCheckMsg_RespondSpellingService::Read(
|
||||
filter->sent_messages[0], ¶ms);
|
||||
int sent_identifier = get<0>(params);
|
||||
bool sent_success = get<1>(params);
|
||||
base::string16 sent_text = get<2>(params);
|
||||
std::vector<SpellCheckResult> sent_results = get<3>(params);
|
||||
int sent_identifier = base::get<0>(params);
|
||||
bool sent_success = base::get<1>(params);
|
||||
base::string16 sent_text = base::get<2>(params);
|
||||
std::vector<SpellCheckResult> sent_results = base::get<3>(params);
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(kCallbackId, sent_identifier);
|
||||
EXPECT_EQ(kSuccess, sent_success);
|
||||
@ -135,8 +135,8 @@ TEST(SpellCheckMessageFilterTest, OnTextCheckCompleteTest) {
|
||||
SpellCheckMsg_RespondSpellingService::Param params;
|
||||
bool ok = SpellCheckMsg_RespondSpellingService::Read(
|
||||
filter->sent_messages[0], & params);
|
||||
base::string16 sent_text = get<2>(params);
|
||||
std::vector<SpellCheckResult> sent_results = get<3>(params);
|
||||
base::string16 sent_text = base::get<2>(params);
|
||||
std::vector<SpellCheckResult> sent_results = base::get<3>(params);
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(static_cast<size_t>(2), sent_results.size());
|
||||
}
|
||||
|
@ -135,14 +135,14 @@ class TranslateManagerRenderViewHostTest
|
||||
ChromeViewMsg_TranslatePage::ID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<int, std::string, std::string, std::string> translate_param;
|
||||
base::Tuple<int, std::string, std::string, std::string> translate_param;
|
||||
ChromeViewMsg_TranslatePage::Read(message, &translate_param);
|
||||
// Ignore get<0>(translate_param) which is the page seq no.
|
||||
// Ignore get<1>(translate_param) which is the script injected in the page.
|
||||
if (original_lang)
|
||||
*original_lang = get<2>(translate_param);
|
||||
*original_lang = base::get<2>(translate_param);
|
||||
if (target_lang)
|
||||
*target_lang = get<3>(translate_param);
|
||||
*target_lang = base::get<3>(translate_param);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -529,13 +529,13 @@ TEST_F(TestUsePrerenderPage, SetEmbeddedSearchRequestParams) {
|
||||
ASSERT_TRUE(message);
|
||||
|
||||
// Verify the IPC message params.
|
||||
Tuple<base::string16, EmbeddedSearchRequestParams> params;
|
||||
base::Tuple<base::string16, EmbeddedSearchRequestParams> params;
|
||||
ChromeViewMsg_SearchBoxSubmit::Read(message, ¶ms);
|
||||
EXPECT_EQ("foo", base::UTF16ToASCII(get<0>(params)));
|
||||
EXPECT_EQ("f", base::UTF16ToASCII(get<1>(params).original_query));
|
||||
EXPECT_EQ("utf-8", base::UTF16ToASCII(get<1>(params).input_encoding));
|
||||
EXPECT_EQ("", base::UTF16ToASCII(get<1>(params).rlz_parameter_value));
|
||||
EXPECT_EQ("foo", base::UTF16ToASCII(base::get<0>(params)));
|
||||
EXPECT_EQ("f", base::UTF16ToASCII(base::get<1>(params).original_query));
|
||||
EXPECT_EQ("utf-8", base::UTF16ToASCII(base::get<1>(params).input_encoding));
|
||||
EXPECT_EQ("", base::UTF16ToASCII(base::get<1>(params).rlz_parameter_value));
|
||||
EXPECT_EQ("chrome...0",
|
||||
base::UTF16ToASCII(get<1>(params).assisted_query_stats));
|
||||
base::UTF16ToASCII(base::get<1>(params).assisted_query_stats));
|
||||
}
|
||||
#endif
|
||||
|
@ -162,10 +162,11 @@ class SearchIPCRouterTest : public BrowserWithTestWindowTest {
|
||||
const IPC::Message* message = process()->sink().GetFirstMessageMatching(
|
||||
ChromeViewMsg_SearchBoxSetDisplayInstantResults::ID);
|
||||
EXPECT_NE(static_cast<const IPC::Message*>(NULL), message);
|
||||
Tuple<bool> display_instant_results_param;
|
||||
base::Tuple<bool> display_instant_results_param;
|
||||
ChromeViewMsg_SearchBoxSetDisplayInstantResults::Read(
|
||||
message, &display_instant_results_param);
|
||||
EXPECT_EQ(expected_param_value, get<0>(display_instant_results_param));
|
||||
EXPECT_EQ(expected_param_value,
|
||||
base::get<0>(display_instant_results_param));
|
||||
}
|
||||
|
||||
MockSearchIPCRouterDelegate* mock_delegate() { return &delegate_; }
|
||||
|
@ -190,8 +190,8 @@ TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMatch) {
|
||||
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Param params;
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Read(message, ¶ms);
|
||||
EXPECT_EQ(test_identity, get<0>(params));
|
||||
ASSERT_TRUE(get<1>(params));
|
||||
EXPECT_EQ(test_identity, base::get<0>(params));
|
||||
ASSERT_TRUE(base::get<1>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMatchSlightlyDifferentGmail) {
|
||||
@ -213,8 +213,8 @@ TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMatchSlightlyDifferentGmail) {
|
||||
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Param params;
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Read(message, ¶ms);
|
||||
EXPECT_EQ(test_identity, get<0>(params));
|
||||
ASSERT_TRUE(get<1>(params));
|
||||
EXPECT_EQ(test_identity, base::get<0>(params));
|
||||
ASSERT_TRUE(base::get<1>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMatchSlightlyDifferentGmail2) {
|
||||
@ -237,8 +237,8 @@ TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMatchSlightlyDifferentGmail2) {
|
||||
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Param params;
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Read(message, ¶ms);
|
||||
EXPECT_EQ(test_identity, get<0>(params));
|
||||
ASSERT_TRUE(get<1>(params));
|
||||
EXPECT_EQ(test_identity, base::get<0>(params));
|
||||
ASSERT_TRUE(base::get<1>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMismatch) {
|
||||
@ -257,8 +257,8 @@ TEST_F(SearchTabHelperTest, OnChromeIdentityCheckMismatch) {
|
||||
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Param params;
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Read(message, ¶ms);
|
||||
EXPECT_EQ(test_identity, get<0>(params));
|
||||
ASSERT_FALSE(get<1>(params));
|
||||
EXPECT_EQ(test_identity, base::get<0>(params));
|
||||
ASSERT_FALSE(base::get<1>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnChromeIdentityCheckSignedOutMismatch) {
|
||||
@ -277,8 +277,8 @@ TEST_F(SearchTabHelperTest, OnChromeIdentityCheckSignedOutMismatch) {
|
||||
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Param params;
|
||||
ChromeViewMsg_ChromeIdentityCheckResult::Read(message, ¶ms);
|
||||
EXPECT_EQ(test_identity, get<0>(params));
|
||||
ASSERT_FALSE(get<1>(params));
|
||||
EXPECT_EQ(test_identity, base::get<0>(params));
|
||||
ASSERT_FALSE(base::get<1>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnHistorySyncCheckSyncing) {
|
||||
@ -296,7 +296,7 @@ TEST_F(SearchTabHelperTest, OnHistorySyncCheckSyncing) {
|
||||
|
||||
ChromeViewMsg_HistorySyncCheckResult::Param params;
|
||||
ChromeViewMsg_HistorySyncCheckResult::Read(message, ¶ms);
|
||||
ASSERT_TRUE(get<0>(params));
|
||||
ASSERT_TRUE(base::get<0>(params));
|
||||
}
|
||||
|
||||
TEST_F(SearchTabHelperTest, OnHistorySyncCheckNotSyncing) {
|
||||
@ -314,7 +314,7 @@ TEST_F(SearchTabHelperTest, OnHistorySyncCheckNotSyncing) {
|
||||
|
||||
ChromeViewMsg_HistorySyncCheckResult::Param params;
|
||||
ChromeViewMsg_HistorySyncCheckResult::Read(message, ¶ms);
|
||||
ASSERT_FALSE(get<0>(params));
|
||||
ASSERT_FALSE(base::get<0>(params));
|
||||
}
|
||||
|
||||
class TabTitleObserver : public content::WebContentsObserver {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#if defined(OS_WIN)
|
||||
// A vector of filters, each being a Tuple containing a display string (i.e.
|
||||
// "Text Files") and a filter pattern (i.e. "*.txt").
|
||||
typedef std::vector<Tuple<base::string16, base::string16>>
|
||||
typedef std::vector<base::Tuple<base::string16, base::string16>>
|
||||
GetOpenFileNameFilter;
|
||||
#endif // OS_WIN
|
||||
|
||||
|
@ -37,8 +37,8 @@ using blink::WebVector;
|
||||
|
||||
namespace autofill {
|
||||
|
||||
typedef Tuple<int, autofill::FormData, autofill::FormFieldData, gfx::RectF>
|
||||
AutofillQueryParam;
|
||||
typedef base::Tuple<int, autofill::FormData, autofill::FormFieldData,
|
||||
gfx::RectF> AutofillQueryParam;
|
||||
|
||||
class AutofillRendererTest : public ChromeRenderViewTest {
|
||||
public:
|
||||
@ -86,7 +86,7 @@ TEST_F(AutofillRendererTest, SendForms) {
|
||||
ASSERT_NE(nullptr, message);
|
||||
AutofillHostMsg_FormsSeen::Param params;
|
||||
AutofillHostMsg_FormsSeen::Read(message, ¶ms);
|
||||
std::vector<FormData> forms = get<0>(params);
|
||||
std::vector<FormData> forms = base::get<0>(params);
|
||||
ASSERT_EQ(1UL, forms.size());
|
||||
ASSERT_EQ(4UL, forms[0].fields.size());
|
||||
|
||||
@ -149,7 +149,7 @@ TEST_F(AutofillRendererTest, SendForms) {
|
||||
AutofillHostMsg_FormsSeen::ID);
|
||||
ASSERT_NE(nullptr, message);
|
||||
AutofillHostMsg_FormsSeen::Read(message, ¶ms);
|
||||
forms = get<0>(params);
|
||||
forms = base::get<0>(params);
|
||||
ASSERT_EQ(1UL, forms.size());
|
||||
ASSERT_EQ(3UL, forms[0].fields.size());
|
||||
|
||||
@ -181,7 +181,7 @@ TEST_F(AutofillRendererTest, EnsureNoFormSeenIfTooFewFields) {
|
||||
ASSERT_NE(nullptr, message);
|
||||
AutofillHostMsg_FormsSeen::Param params;
|
||||
AutofillHostMsg_FormsSeen::Read(message, ¶ms);
|
||||
const std::vector<FormData>& forms = get<0>(params);
|
||||
const std::vector<FormData>& forms = base::get<0>(params);
|
||||
ASSERT_EQ(0UL, forms.size());
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ TEST_F(AutofillRendererTest, DynamicallyAddedUnownedFormElements) {
|
||||
ASSERT_NE(nullptr, message);
|
||||
AutofillHostMsg_FormsSeen::Param params;
|
||||
AutofillHostMsg_FormsSeen::Read(message, ¶ms);
|
||||
std::vector<FormData> forms = get<0>(params);
|
||||
std::vector<FormData> forms = base::get<0>(params);
|
||||
ASSERT_EQ(1UL, forms.size());
|
||||
ASSERT_EQ(7UL, forms[0].fields.size());
|
||||
|
||||
@ -227,7 +227,7 @@ TEST_F(AutofillRendererTest, DynamicallyAddedUnownedFormElements) {
|
||||
AutofillHostMsg_FormsSeen::ID);
|
||||
ASSERT_NE(nullptr, message);
|
||||
AutofillHostMsg_FormsSeen::Read(message, ¶ms);
|
||||
forms = get<0>(params);
|
||||
forms = base::get<0>(params);
|
||||
ASSERT_EQ(1UL, forms.size());
|
||||
ASSERT_EQ(9UL, forms[0].fields.size());
|
||||
|
||||
|
@ -38,26 +38,27 @@ void VerifyReceivedRendererMessages(content::MockRenderThread* render_thread,
|
||||
ASSERT_EQ(expect_submitted_message, submitted_message != NULL);
|
||||
|
||||
// The tuple also includes a timestamp, which is ignored.
|
||||
Tuple<FormData, base::TimeTicks> will_submit_forms;
|
||||
base::Tuple<FormData, base::TimeTicks> will_submit_forms;
|
||||
AutofillHostMsg_WillSubmitForm::Read(will_submit_message, &will_submit_forms);
|
||||
ASSERT_EQ(2U, get<0>(will_submit_forms).fields.size());
|
||||
ASSERT_EQ(2U, base::get<0>(will_submit_forms).fields.size());
|
||||
|
||||
FormFieldData& will_submit_form_field = get<0>(will_submit_forms).fields[0];
|
||||
FormFieldData& will_submit_form_field =
|
||||
base::get<0>(will_submit_forms).fields[0];
|
||||
EXPECT_EQ(WebString("fname"), will_submit_form_field.name);
|
||||
EXPECT_EQ(WebString("Rick"), will_submit_form_field.value);
|
||||
will_submit_form_field = get<0>(will_submit_forms).fields[1];
|
||||
will_submit_form_field = base::get<0>(will_submit_forms).fields[1];
|
||||
EXPECT_EQ(WebString("lname"), will_submit_form_field.name);
|
||||
EXPECT_EQ(WebString("Deckard"), will_submit_form_field.value);
|
||||
|
||||
if (expect_submitted_message) {
|
||||
Tuple<FormData> submitted_forms;
|
||||
base::Tuple<FormData> submitted_forms;
|
||||
AutofillHostMsg_FormSubmitted::Read(submitted_message, &submitted_forms);
|
||||
ASSERT_EQ(2U, get<0>(submitted_forms).fields.size());
|
||||
ASSERT_EQ(2U, base::get<0>(submitted_forms).fields.size());
|
||||
|
||||
FormFieldData& submitted_field = get<0>(submitted_forms).fields[0];
|
||||
FormFieldData& submitted_field = base::get<0>(submitted_forms).fields[0];
|
||||
EXPECT_EQ(WebString("fname"), submitted_field.name);
|
||||
EXPECT_EQ(WebString("Rick"), submitted_field.value);
|
||||
submitted_field = get<0>(submitted_forms).fields[1];
|
||||
submitted_field = base::get<0>(submitted_forms).fields[1];
|
||||
EXPECT_EQ(WebString("lname"), submitted_field.name);
|
||||
EXPECT_EQ(WebString("Deckard"), submitted_field.value);
|
||||
}
|
||||
|
@ -390,12 +390,13 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
|
||||
render_thread_->sink().GetFirstMessageMatching(
|
||||
AutofillHostMsg_ShowPasswordSuggestions::ID);
|
||||
EXPECT_TRUE(message);
|
||||
Tuple<int, base::i18n::TextDirection, base::string16, int, gfx::RectF>
|
||||
base::Tuple<int, base::i18n::TextDirection, base::string16, int, gfx::RectF>
|
||||
args;
|
||||
AutofillHostMsg_ShowPasswordSuggestions::Read(message, &args);
|
||||
EXPECT_EQ(kPasswordFillFormDataId, get<0>(args));
|
||||
EXPECT_EQ(ASCIIToUTF16(username), get<2>(args));
|
||||
EXPECT_EQ(show_all, static_cast<bool>(get<3>(args) & autofill::SHOW_ALL));
|
||||
EXPECT_EQ(kPasswordFillFormDataId, base::get<0>(args));
|
||||
EXPECT_EQ(ASCIIToUTF16(username), base::get<2>(args));
|
||||
EXPECT_EQ(show_all,
|
||||
static_cast<bool>(base::get<3>(args) & autofill::SHOW_ALL));
|
||||
|
||||
render_thread_->sink().ClearMessages();
|
||||
}
|
||||
@ -408,12 +409,12 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
|
||||
render_thread_->sink().GetFirstMessageMatching(
|
||||
AutofillHostMsg_PasswordFormSubmitted::ID);
|
||||
ASSERT_TRUE(message);
|
||||
Tuple<autofill::PasswordForm> args;
|
||||
base::Tuple<autofill::PasswordForm> args;
|
||||
AutofillHostMsg_PasswordFormSubmitted::Read(message, &args);
|
||||
EXPECT_EQ(ASCIIToUTF16(username_value), get<0>(args).username_value);
|
||||
EXPECT_EQ(ASCIIToUTF16(password_value), get<0>(args).password_value);
|
||||
EXPECT_EQ(ASCIIToUTF16(username_value), base::get<0>(args).username_value);
|
||||
EXPECT_EQ(ASCIIToUTF16(password_value), base::get<0>(args).password_value);
|
||||
EXPECT_EQ(ASCIIToUTF16(new_password_value),
|
||||
get<0>(args).new_password_value);
|
||||
base::get<0>(args).new_password_value);
|
||||
}
|
||||
|
||||
base::string16 username1_;
|
||||
@ -448,7 +449,7 @@ TEST_F(PasswordAutofillAgentTest, InitialAutocomplete) {
|
||||
AutofillHostMsg_PasswordFormsParsed::ID);
|
||||
ASSERT_TRUE(msg != NULL);
|
||||
|
||||
Tuple1<std::vector<PasswordForm> > forms;
|
||||
base::Tuple1<std::vector<PasswordForm> > forms;
|
||||
AutofillHostMsg_PasswordFormsParsed::Read(msg, &forms);
|
||||
ASSERT_EQ(1U, forms.a.size());
|
||||
PasswordForm password_form = forms.a[0];
|
||||
@ -775,9 +776,9 @@ TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest) {
|
||||
const IPC::Message* message = render_thread_->sink()
|
||||
.GetFirstMessageMatching(AutofillHostMsg_PasswordFormsRendered::ID);
|
||||
EXPECT_TRUE(message);
|
||||
Tuple<std::vector<autofill::PasswordForm>, bool> param;
|
||||
base::Tuple<std::vector<autofill::PasswordForm>, bool> param;
|
||||
AutofillHostMsg_PasswordFormsRendered::Read(message, ¶m);
|
||||
EXPECT_TRUE(get<0>(param).size());
|
||||
EXPECT_TRUE(base::get<0>(param).size());
|
||||
|
||||
render_thread_->sink().ClearMessages();
|
||||
LoadHTML(kEmptyFormHTML);
|
||||
@ -785,7 +786,7 @@ TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest) {
|
||||
AutofillHostMsg_PasswordFormsRendered::ID);
|
||||
EXPECT_TRUE(message);
|
||||
AutofillHostMsg_PasswordFormsRendered::Read(message, ¶m);
|
||||
EXPECT_FALSE(get<0>(param).size());
|
||||
EXPECT_FALSE(base::get<0>(param).size());
|
||||
|
||||
render_thread_->sink().ClearMessages();
|
||||
LoadHTML(kNonVisibleFormHTML);
|
||||
@ -793,7 +794,7 @@ TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest) {
|
||||
AutofillHostMsg_PasswordFormsRendered::ID);
|
||||
EXPECT_TRUE(message);
|
||||
AutofillHostMsg_PasswordFormsRendered::Read(message, ¶m);
|
||||
EXPECT_FALSE(get<0>(param).size());
|
||||
EXPECT_FALSE(base::get<0>(param).size());
|
||||
}
|
||||
|
||||
TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_Redirection) {
|
||||
|
@ -23,7 +23,7 @@ void FakeMessageArrival(
|
||||
bool handled = provider->OnMessageReceived(
|
||||
SpellCheckMsg_RespondTextCheck(
|
||||
0,
|
||||
get<1>(parameters),
|
||||
base::get<1>(parameters),
|
||||
fake_result));
|
||||
EXPECT_TRUE(handled);
|
||||
}
|
||||
@ -42,7 +42,7 @@ TEST_F(SpellCheckProviderMacTest, SingleRoundtripSuccess) {
|
||||
bool ok = SpellCheckHostMsg_RequestTextCheck::Read(
|
||||
provider_.messages_[0], &read_parameters1);
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(get<2>(read_parameters1), base::UTF8ToUTF16("hello "));
|
||||
EXPECT_EQ(base::get<2>(read_parameters1), base::UTF8ToUTF16("hello "));
|
||||
|
||||
FakeMessageArrival(&provider_, read_parameters1);
|
||||
EXPECT_EQ(completion.completion_count_, 1U);
|
||||
@ -68,13 +68,13 @@ TEST_F(SpellCheckProviderMacTest, TwoRoundtripSuccess) {
|
||||
bool ok = SpellCheckHostMsg_RequestTextCheck::Read(
|
||||
provider_.messages_[0], &read_parameters1);
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(get<2>(read_parameters1), base::UTF8ToUTF16("hello "));
|
||||
EXPECT_EQ(base::get<2>(read_parameters1), base::UTF8ToUTF16("hello "));
|
||||
|
||||
SpellCheckHostMsg_RequestTextCheck::Param read_parameters2;
|
||||
ok = SpellCheckHostMsg_RequestTextCheck::Read(
|
||||
provider_.messages_[1], &read_parameters2);
|
||||
EXPECT_TRUE(ok);
|
||||
EXPECT_EQ(get<2>(read_parameters2), base::UTF8ToUTF16("bye "));
|
||||
EXPECT_EQ(base::get<2>(read_parameters2), base::UTF8ToUTF16("bye "));
|
||||
|
||||
FakeMessageArrival(&provider_, read_parameters1);
|
||||
EXPECT_EQ(completion1.completion_count_, 1U);
|
||||
|
@ -77,15 +77,15 @@ class TranslateHelperBrowserTest : public ChromeRenderViewTest {
|
||||
GetUniqueMessageMatching(ChromeViewHostMsg_PageTranslated::ID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<std::string, std::string, translate::TranslateErrors::Type>
|
||||
base::Tuple<std::string, std::string, translate::TranslateErrors::Type>
|
||||
translate_param;
|
||||
ChromeViewHostMsg_PageTranslated::Read(message, &translate_param);
|
||||
if (original_lang)
|
||||
*original_lang = get<0>(translate_param);
|
||||
*original_lang = base::get<0>(translate_param);
|
||||
if (target_lang)
|
||||
*target_lang = get<1>(translate_param);
|
||||
*target_lang = base::get<1>(translate_param);
|
||||
if (error)
|
||||
*error = get<2>(translate_param);
|
||||
*error = base::get<2>(translate_param);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ TEST_F(ChromeRenderViewTest, TranslatablePage) {
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_TRUE(get<1>(params)) << "Page should be translatable.";
|
||||
EXPECT_TRUE(base::get<1>(params)) << "Page should be translatable.";
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
// Now the page specifies the META tag to prevent translation.
|
||||
@ -339,7 +339,7 @@ TEST_F(ChromeRenderViewTest, TranslatablePage) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_FALSE(get<1>(params)) << "Page should not be translatable.";
|
||||
EXPECT_FALSE(base::get<1>(params)) << "Page should not be translatable.";
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
// Try the alternate version of the META tag (content instead of value).
|
||||
@ -349,7 +349,7 @@ TEST_F(ChromeRenderViewTest, TranslatablePage) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_FALSE(get<1>(params)) << "Page should not be translatable.";
|
||||
EXPECT_FALSE(base::get<1>(params)) << "Page should not be translatable.";
|
||||
}
|
||||
|
||||
// Tests that the language meta tag takes precedence over the CLD when reporting
|
||||
@ -366,7 +366,7 @@ TEST_F(ChromeRenderViewTest, LanguageMetaTag) {
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("es", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("es", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
// Makes sure we support multiple languages specified.
|
||||
@ -377,7 +377,7 @@ TEST_F(ChromeRenderViewTest, LanguageMetaTag) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("fr", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("fr", base::get<0>(params).adopted_language);
|
||||
}
|
||||
|
||||
// Tests that the language meta tag works even with non-all-lower-case.
|
||||
@ -394,7 +394,7 @@ TEST_F(ChromeRenderViewTest, LanguageMetaTagCase) {
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("es", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("es", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
// Makes sure we support multiple languages specified.
|
||||
@ -405,7 +405,7 @@ TEST_F(ChromeRenderViewTest, LanguageMetaTagCase) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("fr", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("fr", base::get<0>(params).adopted_language);
|
||||
}
|
||||
|
||||
// Tests that the language meta tag is converted to Chrome standard of dashes
|
||||
@ -423,7 +423,7 @@ TEST_F(ChromeRenderViewTest, LanguageCommonMistakesAreCorrected) {
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("en", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("en", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
LoadHTML("<html><head><meta http-equiv='Content-Language' content='ZH_tw'>"
|
||||
@ -432,7 +432,7 @@ TEST_F(ChromeRenderViewTest, LanguageCommonMistakesAreCorrected) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("zh-TW", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("zh-TW", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ TEST_F(ChromeRenderViewTest, BackToTranslatablePage) {
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("zh", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("zh", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
content::PageState back_state = GetCurrentPageState();
|
||||
@ -457,7 +457,7 @@ TEST_F(ChromeRenderViewTest, BackToTranslatablePage) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("fr", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("fr", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
GoBack(back_state);
|
||||
@ -466,6 +466,6 @@ TEST_F(ChromeRenderViewTest, BackToTranslatablePage) {
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::ID);
|
||||
ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
|
||||
ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, ¶ms);
|
||||
EXPECT_EQ("zh", get<0>(params).adopted_language);
|
||||
EXPECT_EQ("zh", base::get<0>(params).adopted_language);
|
||||
render_thread_->sink().ClearMessages();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace base {
|
||||
class FilePath;
|
||||
} // namespace base
|
||||
|
||||
typedef std::vector<Tuple<base::string16, base::string16>>
|
||||
typedef std::vector<base::Tuple<base::string16, base::string16>>
|
||||
GetOpenFileNameFilter;
|
||||
|
||||
struct ChromeUtilityMsg_GetSaveFileName_Params;
|
||||
|
@ -91,13 +91,13 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
|
||||
process()->sink().GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<int, FormData> autofill_param;
|
||||
base::Tuple<int, FormData> autofill_param;
|
||||
if (!AutofillMsg_FillForm::Read(message, &autofill_param))
|
||||
return false;
|
||||
if (page_id)
|
||||
*page_id = get<0>(autofill_param);
|
||||
*page_id = base::get<0>(autofill_param);
|
||||
if (results)
|
||||
*results = get<1>(autofill_param);
|
||||
*results = base::get<1>(autofill_param);
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
}
|
||||
@ -112,13 +112,13 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
|
||||
process()->sink().GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<int, FormData> autofill_param;
|
||||
base::Tuple<int, FormData> autofill_param;
|
||||
if (!AutofillMsg_PreviewForm::Read(message, &autofill_param))
|
||||
return false;
|
||||
if (page_id)
|
||||
*page_id = get<0>(autofill_param);
|
||||
*page_id = base::get<0>(autofill_param);
|
||||
if (results)
|
||||
*results = get<1>(autofill_param);
|
||||
*results = base::get<1>(autofill_param);
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
}
|
||||
@ -135,12 +135,12 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
|
||||
process()->sink().GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<std::vector<FormDataPredictions> > autofill_param;
|
||||
base::Tuple<std::vector<FormDataPredictions> > autofill_param;
|
||||
if (!AutofillMsg_FieldTypePredictionsAvailable::Read(message,
|
||||
&autofill_param))
|
||||
return false;
|
||||
if (predictions)
|
||||
*predictions = get<0>(autofill_param);
|
||||
*predictions = base::get<0>(autofill_param);
|
||||
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
@ -155,7 +155,7 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
|
||||
process()->sink().GetFirstMessageMatching(messageID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<base::string16> autofill_param;
|
||||
base::Tuple<base::string16> autofill_param;
|
||||
switch (messageID) {
|
||||
case AutofillMsg_FillFieldWithValue::ID:
|
||||
if (!AutofillMsg_FillFieldWithValue::Read(message, &autofill_param))
|
||||
@ -174,7 +174,7 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
|
||||
NOTREACHED();
|
||||
}
|
||||
if (value)
|
||||
*value = get<0>(autofill_param);
|
||||
*value = base::get<0>(autofill_param);
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
}
|
||||
|
@ -122,10 +122,10 @@ class RequestAutocompleteManagerTest :
|
||||
process()->sink().GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<blink::WebFormElement::AutocompleteResult, base::string16, FormData>
|
||||
autofill_param;
|
||||
base::Tuple<blink::WebFormElement::AutocompleteResult, base::string16,
|
||||
FormData> autofill_param;
|
||||
AutofillMsg_RequestAutocompleteResult::Read(message, &autofill_param);
|
||||
*result = get<0>(autofill_param);
|
||||
*result = base::get<0>(autofill_param);
|
||||
process()->sink().ClearMessages();
|
||||
return true;
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ class TestLogger : public RendererSavePasswordProgressLogger {
|
||||
const IPC::Message* message = sink_.GetFirstMessageMatching(kMsgID);
|
||||
if (!message)
|
||||
return false;
|
||||
Tuple<std::string> param;
|
||||
base::Tuple<std::string> param;
|
||||
AutofillHostMsg_RecordSavePasswordProgress::Read(message, ¶m);
|
||||
*log = get<0>(param);
|
||||
*log = base::get<0>(param);
|
||||
sink_.ClearMessages();
|
||||
return true;
|
||||
}
|
||||
|
@ -1232,17 +1232,17 @@ void GCMDriverDesktop::GetGCMStatisticsFinished(
|
||||
|
||||
bool GCMDriverDesktop::TokenTupleComparer::operator()(
|
||||
const TokenTuple& a, const TokenTuple& b) const {
|
||||
if (get<0>(a) < get<0>(b))
|
||||
if (base::get<0>(a) < base::get<0>(b))
|
||||
return true;
|
||||
if (get<0>(a) > get<0>(b))
|
||||
if (base::get<0>(a) > base::get<0>(b))
|
||||
return false;
|
||||
|
||||
if (get<1>(a) < get<1>(b))
|
||||
if (base::get<1>(a) < base::get<1>(b))
|
||||
return true;
|
||||
if (get<1>(a) > get<1>(b))
|
||||
if (base::get<1>(a) > base::get<1>(b))
|
||||
return false;
|
||||
|
||||
return get<2>(a) < get<2>(b);
|
||||
return base::get<2>(a) < base::get<2>(b);
|
||||
}
|
||||
|
||||
} // namespace gcm
|
||||
|
@ -125,7 +125,7 @@ class GCMDriverDesktop : public GCMDriver,
|
||||
private:
|
||||
class IOWorker;
|
||||
|
||||
typedef Tuple<std::string, std::string, std::string> TokenTuple;
|
||||
typedef base::Tuple<std::string, std::string, std::string> TokenTuple;
|
||||
struct TokenTupleComparer {
|
||||
bool operator()(const TokenTuple& a, const TokenTuple& b) const;
|
||||
};
|
||||
|
@ -81,7 +81,7 @@ void GuestViewAttachRequest::HandleResponse(const IPC::Message& message) {
|
||||
return;
|
||||
|
||||
content::RenderView* guest_proxy_render_view =
|
||||
content::RenderView::FromRoutingID(get<1>(param));
|
||||
content::RenderView::FromRoutingID(base::get<1>(param));
|
||||
// TODO(fsamuel): Should we be reporting an error to JavaScript or DCHECKing?
|
||||
if (!guest_proxy_render_view)
|
||||
return;
|
||||
|
@ -70,7 +70,7 @@ typename UnwrapConstRef<Arg>::Type ParseArg(const base::ListValue* args) {
|
||||
template <typename... Args, size_t... Ns>
|
||||
inline void DispatchToCallback(const base::Callback<void(Args...)>& callback,
|
||||
const base::ListValue* args,
|
||||
IndexSequence<Ns...> indexes) {
|
||||
base::IndexSequence<Ns...> indexes) {
|
||||
DCHECK(args);
|
||||
DCHECK_EQ(sizeof...(Args), args->GetSize());
|
||||
|
||||
@ -80,7 +80,8 @@ inline void DispatchToCallback(const base::Callback<void(Args...)>& callback,
|
||||
template <typename... Args>
|
||||
void CallbackWrapper(const base::Callback<void(Args...)>& callback,
|
||||
const base::ListValue* args) {
|
||||
DispatchToCallback(callback, args, MakeIndexSequence<sizeof...(Args)>());
|
||||
DispatchToCallback(callback, args,
|
||||
base::MakeIndexSequence<sizeof...(Args)>());
|
||||
}
|
||||
|
||||
|
||||
|
@ -799,7 +799,7 @@ void NaClIPCAdapter::SendMessageOnIOThread(scoped_ptr<IPC::Message> message) {
|
||||
if (!open_resource_cb_.is_null() &&
|
||||
message->type() == PpapiHostMsg_OpenResource::ID &&
|
||||
PpapiHostMsg_OpenResource::ReadSendParam(message.get(), &send_params)) {
|
||||
const std::string key = get<0>(send_params);
|
||||
const std::string key = base::get<0>(send_params);
|
||||
// Both open_resource_cb_ and SaveOpenResourceMessage must be invoked
|
||||
// from the I/O thread.
|
||||
if (open_resource_cb_.Run(
|
||||
|
@ -333,7 +333,7 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
EXPECT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, ¶m);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, base::get<1>(param).type);
|
||||
process()->sink().ClearMessages();
|
||||
}
|
||||
|
||||
@ -361,7 +361,7 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
EXPECT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, ¶m);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, base::get<1>(param).type);
|
||||
process()->sink().ClearMessages();
|
||||
}
|
||||
|
||||
@ -403,7 +403,8 @@ TEST_F(
|
||||
EXPECT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param send_param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, &send_param);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(send_param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY,
|
||||
base::get<1>(send_param).type);
|
||||
}
|
||||
|
||||
TEST_F(CredentialManagerDispatcherTest,
|
||||
@ -425,7 +426,8 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
EXPECT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param send_param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, &send_param);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_LOCAL, get<1>(send_param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_LOCAL,
|
||||
base::get<1>(send_param).type);
|
||||
}
|
||||
|
||||
TEST_F(CredentialManagerDispatcherTest,
|
||||
@ -450,7 +452,8 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
CredentialManagerMsg_SendCredential::Read(message, &send_param);
|
||||
|
||||
// With two items in the password store, we shouldn't get credentials back.
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(send_param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY,
|
||||
base::get<1>(send_param).type);
|
||||
}
|
||||
|
||||
TEST_F(CredentialManagerDispatcherTest,
|
||||
@ -477,10 +480,12 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
|
||||
// We should get |origin_path_form_| back, as |form_| is marked as skipping
|
||||
// zero-click.
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_LOCAL, get<1>(send_param).type);
|
||||
EXPECT_EQ(origin_path_form_.username_value, get<1>(send_param).id);
|
||||
EXPECT_EQ(origin_path_form_.display_name, get<1>(send_param).name);
|
||||
EXPECT_EQ(origin_path_form_.password_value, get<1>(send_param).password);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_LOCAL,
|
||||
base::get<1>(send_param).type);
|
||||
EXPECT_EQ(origin_path_form_.username_value, base::get<1>(send_param).id);
|
||||
EXPECT_EQ(origin_path_form_.display_name, base::get<1>(send_param).name);
|
||||
EXPECT_EQ(origin_path_form_.password_value,
|
||||
base::get<1>(send_param).password);
|
||||
}
|
||||
|
||||
TEST_F(CredentialManagerDispatcherTest,
|
||||
@ -508,7 +513,8 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
|
||||
// We only have cross-origin zero-click credentials; they should not be
|
||||
// returned.
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(send_param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY,
|
||||
base::get<1>(send_param).type);
|
||||
}
|
||||
|
||||
TEST_F(CredentialManagerDispatcherTest,
|
||||
@ -533,7 +539,7 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
CredentialManagerMsg_RejectCredentialRequest::Param reject_param;
|
||||
CredentialManagerMsg_RejectCredentialRequest::Read(message, &reject_param);
|
||||
EXPECT_EQ(blink::WebCredentialManagerError::ErrorTypePendingRequest,
|
||||
get<1>(reject_param));
|
||||
base::get<1>(reject_param));
|
||||
EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _))
|
||||
.Times(testing::Exactly(1));
|
||||
EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0));
|
||||
@ -549,7 +555,8 @@ TEST_F(CredentialManagerDispatcherTest,
|
||||
EXPECT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param send_param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, &send_param);
|
||||
EXPECT_NE(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(send_param).type);
|
||||
EXPECT_NE(CredentialType::CREDENTIAL_TYPE_EMPTY,
|
||||
base::get<1>(send_param).type);
|
||||
process()->sink().ClearMessages();
|
||||
}
|
||||
|
||||
@ -616,7 +623,7 @@ TEST_F(CredentialManagerDispatcherTest, IncognitoZeroClickRequestCredential) {
|
||||
ASSERT_TRUE(message);
|
||||
CredentialManagerMsg_SendCredential::Param param;
|
||||
CredentialManagerMsg_SendCredential::Read(message, ¶m);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, get<1>(param).type);
|
||||
EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, base::get<1>(param).type);
|
||||
}
|
||||
|
||||
} // namespace password_manager
|
||||
|
@ -62,30 +62,30 @@ class MAYBE_CredentialManagerClientTest : public content::RenderViewTest {
|
||||
|
||||
switch (message_id) {
|
||||
case CredentialManagerHostMsg_NotifyFailedSignIn::ID: {
|
||||
Tuple<int, CredentialInfo> param;
|
||||
base::Tuple<int, CredentialInfo> param;
|
||||
CredentialManagerHostMsg_NotifyFailedSignIn::Read(message, ¶m);
|
||||
request_id = get<0>(param);
|
||||
request_id = base::get<0>(param);
|
||||
break;
|
||||
}
|
||||
|
||||
case CredentialManagerHostMsg_NotifySignedIn::ID: {
|
||||
Tuple<int, CredentialInfo> param;
|
||||
base::Tuple<int, CredentialInfo> param;
|
||||
CredentialManagerHostMsg_NotifySignedIn::Read(message, ¶m);
|
||||
request_id = get<0>(param);
|
||||
request_id = base::get<0>(param);
|
||||
break;
|
||||
}
|
||||
|
||||
case CredentialManagerHostMsg_NotifySignedOut::ID: {
|
||||
Tuple<int> param;
|
||||
base::Tuple<int> param;
|
||||
CredentialManagerHostMsg_NotifySignedOut::Read(message, ¶m);
|
||||
request_id = get<0>(param);
|
||||
request_id = base::get<0>(param);
|
||||
break;
|
||||
}
|
||||
|
||||
case CredentialManagerHostMsg_RequestCredential::ID: {
|
||||
Tuple<int, bool, std::vector<GURL>> param;
|
||||
base::Tuple<int, bool, std::vector<GURL>> param;
|
||||
CredentialManagerHostMsg_RequestCredential::Read(message, ¶m);
|
||||
request_id = get<0>(param);
|
||||
request_id = base::get<0>(param);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ class PrintWebViewHelperTestBase : public content::RenderViewTest {
|
||||
PrintHostMsg_DidGetPrintedPagesCount::Param post_page_count_param;
|
||||
PrintHostMsg_DidGetPrintedPagesCount::Read(page_cnt_msg,
|
||||
&post_page_count_param);
|
||||
EXPECT_EQ(count, get<1>(post_page_count_param));
|
||||
EXPECT_EQ(count, base::get<1>(post_page_count_param));
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ class PrintWebViewHelperTestBase : public content::RenderViewTest {
|
||||
PrintHostMsg_DidGetPreviewPageCount::Param post_page_count_param;
|
||||
PrintHostMsg_DidGetPreviewPageCount::Read(page_cnt_msg,
|
||||
&post_page_count_param);
|
||||
EXPECT_EQ(count, get<0>(post_page_count_param).page_count);
|
||||
EXPECT_EQ(count, base::get<0>(post_page_count_param).page_count);
|
||||
}
|
||||
|
||||
// Verifies whether the pages printed or not.
|
||||
@ -206,7 +206,7 @@ class PrintWebViewHelperTestBase : public content::RenderViewTest {
|
||||
if (printed) {
|
||||
PrintHostMsg_DidPrintPage::Param post_did_print_page_param;
|
||||
PrintHostMsg_DidPrintPage::Read(print_msg, &post_did_print_page_param);
|
||||
EXPECT_EQ(0, get<0>(post_did_print_page_param).page_number);
|
||||
EXPECT_EQ(0, base::get<0>(post_did_print_page_param).page_number);
|
||||
}
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
}
|
||||
@ -543,9 +543,9 @@ class MAYBE_PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
|
||||
if (did_get_preview_msg) {
|
||||
PrintHostMsg_MetafileReadyForPrinting::Param preview_param;
|
||||
PrintHostMsg_MetafileReadyForPrinting::Read(preview_msg, &preview_param);
|
||||
EXPECT_NE(0, get<0>(preview_param).document_cookie);
|
||||
EXPECT_NE(0, get<0>(preview_param).expected_pages_count);
|
||||
EXPECT_NE(0U, get<0>(preview_param).data_size);
|
||||
EXPECT_NE(0, base::get<0>(preview_param).document_cookie);
|
||||
EXPECT_NE(0, base::get<0>(preview_param).expected_pages_count);
|
||||
EXPECT_NE(0U, base::get<0>(preview_param).data_size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -571,12 +571,12 @@ class MAYBE_PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
|
||||
if (msg->type() == PrintHostMsg_DidPreviewPage::ID) {
|
||||
PrintHostMsg_DidPreviewPage::Param page_param;
|
||||
PrintHostMsg_DidPreviewPage::Read(msg, &page_param);
|
||||
if (get<0>(page_param).page_number == page_number) {
|
||||
if (base::get<0>(page_param).page_number == page_number) {
|
||||
msg_found = true;
|
||||
if (generate_draft_pages)
|
||||
EXPECT_NE(0U, get<0>(page_param).data_size);
|
||||
EXPECT_NE(0U, base::get<0>(page_param).data_size);
|
||||
else
|
||||
EXPECT_EQ(0U, get<0>(page_param).data_size);
|
||||
EXPECT_EQ(0U, base::get<0>(page_param).data_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -599,13 +599,13 @@ class MAYBE_PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
|
||||
PrintHostMsg_DidGetDefaultPageLayout::Param param;
|
||||
PrintHostMsg_DidGetDefaultPageLayout::Read(default_page_layout_msg,
|
||||
¶m);
|
||||
EXPECT_EQ(content_width, get<0>(param).content_width);
|
||||
EXPECT_EQ(content_height, get<0>(param).content_height);
|
||||
EXPECT_EQ(margin_top, get<0>(param).margin_top);
|
||||
EXPECT_EQ(margin_right, get<0>(param).margin_right);
|
||||
EXPECT_EQ(margin_left, get<0>(param).margin_left);
|
||||
EXPECT_EQ(margin_bottom, get<0>(param).margin_bottom);
|
||||
EXPECT_EQ(page_has_print_css, get<2>(param));
|
||||
EXPECT_EQ(content_width, base::get<0>(param).content_width);
|
||||
EXPECT_EQ(content_height, base::get<0>(param).content_height);
|
||||
EXPECT_EQ(margin_top, base::get<0>(param).margin_top);
|
||||
EXPECT_EQ(margin_right, base::get<0>(param).margin_right);
|
||||
EXPECT_EQ(margin_left, base::get<0>(param).margin_left);
|
||||
EXPECT_EQ(margin_bottom, base::get<0>(param).margin_bottom);
|
||||
EXPECT_EQ(page_has_print_css, base::get<2>(param));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -530,12 +530,12 @@ void RenderFrameDevToolsAgentHost::OnSwapCompositorFrame(
|
||||
if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m))
|
||||
return;
|
||||
if (page_handler_)
|
||||
page_handler_->OnSwapCompositorFrame(get<1>(param).metadata);
|
||||
page_handler_->OnSwapCompositorFrame(base::get<1>(param).metadata);
|
||||
if (input_handler_)
|
||||
input_handler_->OnSwapCompositorFrame(get<1>(param).metadata);
|
||||
input_handler_->OnSwapCompositorFrame(base::get<1>(param).metadata);
|
||||
if (frame_trace_recorder_) {
|
||||
frame_trace_recorder_->OnSwapCompositorFrame(
|
||||
render_frame_host_, get<1>(param).metadata);
|
||||
render_frame_host_, base::get<1>(param).metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,12 +237,12 @@ class NavigationControllerTest
|
||||
return navigation_request->common_params().url;
|
||||
}
|
||||
const IPC::Message* message =
|
||||
process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
|
||||
process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
|
||||
CHECK(message);
|
||||
Tuple<CommonNavigationParams, StartNavigationParams,
|
||||
base::Tuple<CommonNavigationParams, StartNavigationParams,
|
||||
RequestNavigationParams> nav_params;
|
||||
FrameMsg_Navigate::Read(message, &nav_params);
|
||||
return get<0>(nav_params).url;
|
||||
return base::get<0>(nav_params).url;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -80,7 +80,7 @@ WebInputEvent& GetEventWithType(WebInputEvent::Type type) {
|
||||
bool GetIsShortcutFromHandleInputEventMessage(const IPC::Message* msg) {
|
||||
InputMsg_HandleInputEvent::Schema::Param param;
|
||||
InputMsg_HandleInputEvent::Read(msg, ¶m);
|
||||
return get<2>(param);
|
||||
return base::get<2>(param);
|
||||
}
|
||||
|
||||
template<typename MSG_T, typename ARG_T1>
|
||||
@ -88,7 +88,7 @@ void ExpectIPCMessageWithArg1(const IPC::Message* msg, const ARG_T1& arg1) {
|
||||
ASSERT_EQ(MSG_T::ID, msg->type());
|
||||
typename MSG_T::Schema::Param param;
|
||||
ASSERT_TRUE(MSG_T::Read(msg, ¶m));
|
||||
EXPECT_EQ(arg1, get<0>(param));
|
||||
EXPECT_EQ(arg1, base::get<0>(param));
|
||||
}
|
||||
|
||||
template<typename MSG_T, typename ARG_T1, typename ARG_T2>
|
||||
@ -98,8 +98,8 @@ void ExpectIPCMessageWithArg2(const IPC::Message* msg,
|
||||
ASSERT_EQ(MSG_T::ID, msg->type());
|
||||
typename MSG_T::Schema::Param param;
|
||||
ASSERT_TRUE(MSG_T::Read(msg, ¶m));
|
||||
EXPECT_EQ(arg1, get<0>(param));
|
||||
EXPECT_EQ(arg2, get<1>(param));
|
||||
EXPECT_EQ(arg1, base::get<0>(param));
|
||||
EXPECT_EQ(arg2, base::get<1>(param));
|
||||
}
|
||||
|
||||
#if defined(USE_AURA)
|
||||
|
@ -117,8 +117,8 @@ class InputEventMessageFilter : public BrowserMessageFilter {
|
||||
if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) {
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(&message, ¶ms);
|
||||
WebInputEvent::Type type = get<0>(params).type;
|
||||
InputEventAckState ack = get<0>(params).state;
|
||||
WebInputEvent::Type type = base::get<0>(params).type;
|
||||
InputEventAckState ack = base::get<0>(params).state;
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&InputEventMessageFilter::ReceivedEventAck,
|
||||
this, type, ack));
|
||||
|
@ -116,10 +116,10 @@ class WebRTCIdentityServiceHostTest : public ::testing::Test {
|
||||
IPC::Message ipc = host_->GetLastMessage();
|
||||
EXPECT_EQ(ipc.type(), WebRTCIdentityHostMsg_RequestFailed::ID);
|
||||
|
||||
Tuple<int, int> error_in_message;
|
||||
base::Tuple<int, int> error_in_message;
|
||||
WebRTCIdentityHostMsg_RequestFailed::Read(&ipc, &error_in_message);
|
||||
EXPECT_EQ(FAKE_SEQUENCE_NUMBER, get<0>(error_in_message));
|
||||
EXPECT_EQ(error, get<1>(error_in_message));
|
||||
EXPECT_EQ(FAKE_SEQUENCE_NUMBER, base::get<0>(error_in_message));
|
||||
EXPECT_EQ(error, base::get<1>(error_in_message));
|
||||
}
|
||||
|
||||
void VerifyIdentityReadyMessage(const std::string& cert,
|
||||
@ -128,11 +128,11 @@ class WebRTCIdentityServiceHostTest : public ::testing::Test {
|
||||
IPC::Message ipc = host_->GetLastMessage();
|
||||
EXPECT_EQ(ipc.type(), WebRTCIdentityHostMsg_IdentityReady::ID);
|
||||
|
||||
Tuple<int, std::string, std::string> identity_in_message;
|
||||
base::Tuple<int, std::string, std::string> identity_in_message;
|
||||
WebRTCIdentityHostMsg_IdentityReady::Read(&ipc, &identity_in_message);
|
||||
EXPECT_EQ(FAKE_SEQUENCE_NUMBER, get<0>(identity_in_message));
|
||||
EXPECT_EQ(cert, get<1>(identity_in_message));
|
||||
EXPECT_EQ(key, get<2>(identity_in_message));
|
||||
EXPECT_EQ(FAKE_SEQUENCE_NUMBER, base::get<0>(identity_in_message));
|
||||
EXPECT_EQ(cert, base::get<1>(identity_in_message));
|
||||
EXPECT_EQ(key, base::get<2>(identity_in_message));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -106,7 +106,7 @@ MATCHER_P(MatchPacketMessage, packet_content, "") {
|
||||
return false;
|
||||
P2PMsg_OnDataReceived::Param params;
|
||||
P2PMsg_OnDataReceived::Read(arg, ¶ms);
|
||||
return get<2>(params) == packet_content;
|
||||
return base::get<2>(params) == packet_content;
|
||||
}
|
||||
|
||||
MATCHER_P(MatchIncomingSocketMessage, address, "") {
|
||||
@ -115,7 +115,7 @@ MATCHER_P(MatchIncomingSocketMessage, address, "") {
|
||||
P2PMsg_OnIncomingTcpConnection::Param params;
|
||||
P2PMsg_OnIncomingTcpConnection::Read(
|
||||
arg, ¶ms);
|
||||
return get<1>(params) == address;
|
||||
return base::get<1>(params) == address;
|
||||
}
|
||||
|
||||
#endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
|
||||
|
@ -105,7 +105,7 @@ TEST_F(PepperPrintingHostTest, GetDefaultPrintSettings) {
|
||||
reply_msg_param;
|
||||
ASSERT_TRUE(PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply::Read(
|
||||
&reply_msg, &reply_msg_param));
|
||||
PP_PrintSettings_Dev actual_settings = get<0>(reply_msg_param);
|
||||
PP_PrintSettings_Dev actual_settings = base::get<0>(reply_msg_param);
|
||||
|
||||
EXPECT_TRUE(PP_RectEqual(expected_settings.printable_area,
|
||||
actual_settings.printable_area));
|
||||
|
@ -1458,10 +1458,10 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(
|
||||
if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m))
|
||||
return false;
|
||||
scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
|
||||
uint32 output_surface_id = get<0>(param);
|
||||
get<1>(param).AssignTo(frame.get());
|
||||
uint32 output_surface_id = base::get<0>(param);
|
||||
base::get<1>(param).AssignTo(frame.get());
|
||||
std::vector<IPC::Message> messages_to_deliver_with_frame;
|
||||
messages_to_deliver_with_frame.swap(get<2>(param));
|
||||
messages_to_deliver_with_frame.swap(base::get<2>(param));
|
||||
|
||||
latency_tracker_.OnSwapCompositorFrame(&frame->metadata.latency_info);
|
||||
|
||||
|
@ -815,9 +815,9 @@ TEST_F(RenderWidgetHostTest, Background) {
|
||||
process_->sink().GetUniqueMessageMatching(
|
||||
ViewMsg_SetBackgroundOpaque::ID);
|
||||
ASSERT_TRUE(set_background);
|
||||
Tuple<bool> sent_background;
|
||||
base::Tuple<bool> sent_background;
|
||||
ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background);
|
||||
EXPECT_FALSE(get<0>(sent_background));
|
||||
EXPECT_FALSE(base::get<0>(sent_background));
|
||||
|
||||
#if defined(USE_AURA)
|
||||
// See the comment above |InitAsChild(NULL)|.
|
||||
@ -852,9 +852,9 @@ TEST_F(RenderWidgetHostTest, HiddenPaint) {
|
||||
const IPC::Message* restored = process_->sink().GetUniqueMessageMatching(
|
||||
ViewMsg_WasShown::ID);
|
||||
ASSERT_TRUE(restored);
|
||||
Tuple<bool, ui::LatencyInfo> needs_repaint;
|
||||
base::Tuple<bool, ui::LatencyInfo> needs_repaint;
|
||||
ViewMsg_WasShown::Read(restored, &needs_repaint);
|
||||
EXPECT_TRUE(get<0>(needs_repaint));
|
||||
EXPECT_TRUE(base::get<0>(needs_repaint));
|
||||
}
|
||||
|
||||
TEST_F(RenderWidgetHostTest, IgnoreKeyEventsHandledByRenderer) {
|
||||
@ -1094,7 +1094,7 @@ std::string GetInputMessageTypes(RenderWidgetHostProcess* process) {
|
||||
EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type());
|
||||
InputMsg_HandleInputEvent::Param params;
|
||||
EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms));
|
||||
const WebInputEvent* event = get<0>(params);
|
||||
const WebInputEvent* event = base::get<0>(params);
|
||||
if (i != 0)
|
||||
result += " ";
|
||||
result += WebInputEventTraits::GetName(event->type);
|
||||
@ -1420,7 +1420,7 @@ ui::LatencyInfo GetLatencyInfoFromInputEvent(RenderWidgetHostProcess* process) {
|
||||
InputMsg_HandleInputEvent::Param params;
|
||||
EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms));
|
||||
process->sink().ClearMessages();
|
||||
return get<1>(params);
|
||||
return base::get<1>(params);
|
||||
}
|
||||
|
||||
void CheckLatencyInfoComponentInMessage(RenderWidgetHostProcess* process,
|
||||
|
@ -478,10 +478,11 @@ class RenderWidgetHostViewAuraTest : public testing::Test {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WebInputEventTraits::WillReceiveAckFromRenderer(*get<0>(params)))
|
||||
if (!WebInputEventTraits::WillReceiveAckFromRenderer(
|
||||
*base::get<0>(params)))
|
||||
return;
|
||||
|
||||
const blink::WebInputEvent* event = get<0>(params);
|
||||
const blink::WebInputEvent* event = base::get<0>(params);
|
||||
SendTouchEventACK(event->type, ack_result,
|
||||
WebInputEventTraits::GetUniqueTouchEventId(*event));
|
||||
}
|
||||
@ -969,20 +970,21 @@ TEST_F(RenderWidgetHostViewAuraTest, SetCompositionText) {
|
||||
InputMsg_ImeSetComposition::Param params;
|
||||
InputMsg_ImeSetComposition::Read(msg, ¶ms);
|
||||
// composition text
|
||||
EXPECT_EQ(composition_text.text, get<0>(params));
|
||||
EXPECT_EQ(composition_text.text, base::get<0>(params));
|
||||
// underlines
|
||||
ASSERT_EQ(underlines.size(), get<1>(params).size());
|
||||
ASSERT_EQ(underlines.size(), base::get<1>(params).size());
|
||||
for (size_t i = 0; i < underlines.size(); ++i) {
|
||||
EXPECT_EQ(underlines[i].start_offset, get<1>(params)[i].startOffset);
|
||||
EXPECT_EQ(underlines[i].end_offset, get<1>(params)[i].endOffset);
|
||||
EXPECT_EQ(underlines[i].color, get<1>(params)[i].color);
|
||||
EXPECT_EQ(underlines[i].thick, get<1>(params)[i].thick);
|
||||
EXPECT_EQ(underlines[i].start_offset,
|
||||
base::get<1>(params)[i].startOffset);
|
||||
EXPECT_EQ(underlines[i].end_offset, base::get<1>(params)[i].endOffset);
|
||||
EXPECT_EQ(underlines[i].color, base::get<1>(params)[i].color);
|
||||
EXPECT_EQ(underlines[i].thick, base::get<1>(params)[i].thick);
|
||||
EXPECT_EQ(underlines[i].background_color,
|
||||
get<1>(params)[i].backgroundColor);
|
||||
base::get<1>(params)[i].backgroundColor);
|
||||
}
|
||||
// highlighted range
|
||||
EXPECT_EQ(4, get<2>(params)) << "Should be the same to the caret pos";
|
||||
EXPECT_EQ(4, get<3>(params)) << "Should be the same to the caret pos";
|
||||
EXPECT_EQ(4, base::get<2>(params)) << "Should be the same to the caret pos";
|
||||
EXPECT_EQ(4, base::get<3>(params)) << "Should be the same to the caret pos";
|
||||
}
|
||||
|
||||
view_->ImeCancelComposition();
|
||||
@ -1289,9 +1291,9 @@ TEST_F(RenderWidgetHostViewAuraTest, PhysicalBackingSizeWithScale) {
|
||||
EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ("100x100", get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ("100x100", base::get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ("100x100",
|
||||
get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
base::get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
}
|
||||
|
||||
widget_host_->ResetSizeAndRepaintPendingFlags();
|
||||
@ -1306,10 +1308,10 @@ TEST_F(RenderWidgetHostViewAuraTest, PhysicalBackingSizeWithScale) {
|
||||
EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ(2.0f, get<0>(params).screen_info.deviceScaleFactor);
|
||||
EXPECT_EQ("100x100", get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ(2.0f, base::get<0>(params).screen_info.deviceScaleFactor);
|
||||
EXPECT_EQ("100x100", base::get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ("200x200",
|
||||
get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
base::get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
}
|
||||
|
||||
widget_host_->ResetSizeAndRepaintPendingFlags();
|
||||
@ -1324,10 +1326,10 @@ TEST_F(RenderWidgetHostViewAuraTest, PhysicalBackingSizeWithScale) {
|
||||
EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ(1.0f, get<0>(params).screen_info.deviceScaleFactor);
|
||||
EXPECT_EQ("100x100", get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ(1.0f, base::get<0>(params).screen_info.deviceScaleFactor);
|
||||
EXPECT_EQ("100x100", base::get<0>(params).new_size.ToString()); // dip size
|
||||
EXPECT_EQ("100x100",
|
||||
get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
base::get<0>(params).physical_backing_size.ToString()); // backing size
|
||||
}
|
||||
}
|
||||
|
||||
@ -1492,14 +1494,16 @@ TEST_F(RenderWidgetHostViewAuraTest, DISABLED_FullscreenResize) {
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ("0,0 800x600",
|
||||
gfx::Rect(get<0>(params).screen_info.availableRect).ToString());
|
||||
EXPECT_EQ("800x600", get<0>(params).new_size.ToString());
|
||||
gfx::Rect(
|
||||
base::get<0>(params).screen_info.availableRect).ToString());
|
||||
EXPECT_EQ("800x600", base::get<0>(params).new_size.ToString());
|
||||
// Resizes are blocked until we swapped a frame of the correct size, and
|
||||
// we've committed it.
|
||||
view_->OnSwapCompositorFrame(
|
||||
0,
|
||||
MakeDelegatedFrame(
|
||||
1.f, get<0>(params).new_size, gfx::Rect(get<0>(params).new_size)));
|
||||
1.f, base::get<0>(params).new_size,
|
||||
gfx::Rect(base::get<0>(params).new_size)));
|
||||
ui::DrawWaiterForTest::WaitForCommit(
|
||||
root_window->GetHost()->compositor());
|
||||
}
|
||||
@ -1517,12 +1521,14 @@ TEST_F(RenderWidgetHostViewAuraTest, DISABLED_FullscreenResize) {
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ("0,0 1600x1200",
|
||||
gfx::Rect(get<0>(params).screen_info.availableRect).ToString());
|
||||
EXPECT_EQ("1600x1200", get<0>(params).new_size.ToString());
|
||||
gfx::Rect(
|
||||
base::get<0>(params).screen_info.availableRect).ToString());
|
||||
EXPECT_EQ("1600x1200", base::get<0>(params).new_size.ToString());
|
||||
view_->OnSwapCompositorFrame(
|
||||
0,
|
||||
MakeDelegatedFrame(
|
||||
1.f, get<0>(params).new_size, gfx::Rect(get<0>(params).new_size)));
|
||||
1.f, base::get<0>(params).new_size,
|
||||
gfx::Rect(base::get<0>(params).new_size)));
|
||||
ui::DrawWaiterForTest::WaitForCommit(
|
||||
root_window->GetHost()->compositor());
|
||||
}
|
||||
@ -1621,7 +1627,7 @@ TEST_F(RenderWidgetHostViewAuraTest, Resize) {
|
||||
EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ(size2.ToString(), get<0>(params).new_size.ToString());
|
||||
EXPECT_EQ(size2.ToString(), base::get<0>(params).new_size.ToString());
|
||||
}
|
||||
// Send resize ack to observe new Resize messages.
|
||||
update_params.view_size = size2;
|
||||
@ -1676,7 +1682,7 @@ TEST_F(RenderWidgetHostViewAuraTest, Resize) {
|
||||
// to this extra IPC coming in.
|
||||
InputMsg_HandleInputEvent::Param params;
|
||||
InputMsg_HandleInputEvent::Read(msg, ¶ms);
|
||||
const blink::WebInputEvent* event = get<0>(params);
|
||||
const blink::WebInputEvent* event = base::get<0>(params);
|
||||
EXPECT_EQ(blink::WebInputEvent::MouseMove, event->type);
|
||||
break;
|
||||
}
|
||||
@ -1686,7 +1692,7 @@ TEST_F(RenderWidgetHostViewAuraTest, Resize) {
|
||||
EXPECT_FALSE(has_resize);
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(msg, ¶ms);
|
||||
EXPECT_EQ(size3.ToString(), get<0>(params).new_size.ToString());
|
||||
EXPECT_EQ(size3.ToString(), base::get<0>(params).new_size.ToString());
|
||||
has_resize = true;
|
||||
break;
|
||||
}
|
||||
@ -2373,7 +2379,7 @@ TEST_F(RenderWidgetHostViewAuraTest, VisibleViewportTest) {
|
||||
|
||||
ViewMsg_Resize::Param params;
|
||||
ViewMsg_Resize::Read(message, ¶ms);
|
||||
EXPECT_EQ(60, get<0>(params).visible_viewport_size.height());
|
||||
EXPECT_EQ(60, base::get<0>(params).visible_viewport_size.height());
|
||||
}
|
||||
|
||||
// Ensures that touch event positions are never truncated to integers.
|
||||
@ -3500,7 +3506,7 @@ TEST_F(RenderWidgetHostViewAuraTest, SurfaceIdNamespaceInitialized) {
|
||||
view_->SetSize(size);
|
||||
view_->OnSwapCompositorFrame(0,
|
||||
MakeDelegatedFrame(1.f, size, gfx::Rect(size)));
|
||||
EXPECT_EQ(view_->GetSurfaceIdNamespace(), get<0>(params));
|
||||
EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params));
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -847,9 +847,9 @@ TEST_F(RenderWidgetHostViewMacTest, Background) {
|
||||
set_background = process_host->sink().GetUniqueMessageMatching(
|
||||
ViewMsg_SetBackgroundOpaque::ID);
|
||||
ASSERT_TRUE(set_background);
|
||||
Tuple<bool> sent_background;
|
||||
base::Tuple<bool> sent_background;
|
||||
ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background);
|
||||
EXPECT_FALSE(get<0>(sent_background));
|
||||
EXPECT_FALSE(base::get<0>(sent_background));
|
||||
|
||||
// Try setting it back.
|
||||
process_host->sink().ClearMessages();
|
||||
@ -860,7 +860,7 @@ TEST_F(RenderWidgetHostViewMacTest, Background) {
|
||||
ViewMsg_SetBackgroundOpaque::ID);
|
||||
ASSERT_TRUE(set_background);
|
||||
ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background);
|
||||
EXPECT_TRUE(get<0>(sent_background));
|
||||
EXPECT_TRUE(base::get<0>(sent_background));
|
||||
|
||||
host->Shutdown();
|
||||
}
|
||||
@ -885,9 +885,9 @@ class RenderWidgetHostViewMacPinchTest : public RenderWidgetHostViewMacTest {
|
||||
break;
|
||||
}
|
||||
DCHECK(message);
|
||||
Tuple<IPC::WebInputEventPointer, ui::LatencyInfo, bool> data;
|
||||
base::Tuple<IPC::WebInputEventPointer, ui::LatencyInfo, bool> data;
|
||||
InputMsg_HandleInputEvent::Read(message, &data);
|
||||
IPC::WebInputEventPointer ipc_event = get<0>(data);
|
||||
IPC::WebInputEventPointer ipc_event = base::get<0>(data);
|
||||
const blink::WebGestureEvent* gesture_event =
|
||||
static_cast<const blink::WebGestureEvent*>(ipc_event);
|
||||
return gesture_event->data.pinchUpdate.zoomDisabled;
|
||||
|
@ -89,11 +89,12 @@ class ResolveProxyMsgHelperTest : public testing::Test, public IPC::Listener {
|
||||
|
||||
private:
|
||||
bool OnMessageReceived(const IPC::Message& msg) override {
|
||||
TupleTypes<ViewHostMsg_ResolveProxy::ReplyParam>::ValueTuple reply_data;
|
||||
base::TupleTypes<ViewHostMsg_ResolveProxy::ReplyParam>::ValueTuple
|
||||
reply_data;
|
||||
EXPECT_TRUE(ViewHostMsg_ResolveProxy::ReadReplyParam(&msg, &reply_data));
|
||||
DCHECK(!pending_result_.get());
|
||||
pending_result_.reset(
|
||||
new PendingResult(get<0>(reply_data), get<1>(reply_data)));
|
||||
new PendingResult(base::get<0>(reply_data), base::get<1>(reply_data)));
|
||||
test_sink_.ClearMessages();
|
||||
return true;
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ void VerifyStateChangedMessage(int expected_handle_id,
|
||||
ServiceWorkerMsg_ServiceWorkerStateChanged::Param param;
|
||||
ASSERT_TRUE(ServiceWorkerMsg_ServiceWorkerStateChanged::Read(
|
||||
message, ¶m));
|
||||
EXPECT_EQ(expected_handle_id, get<1>(param));
|
||||
EXPECT_EQ(expected_state, get<2>(param));
|
||||
EXPECT_EQ(expected_handle_id, base::get<1>(param));
|
||||
EXPECT_EQ(expected_state, base::get<2>(param));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -294,15 +294,15 @@ base::TimeDelta GetTickDuration(const base::TimeTicks& time) {
|
||||
|
||||
void OnGetWindowClientsFromUI(
|
||||
// The tuple contains process_id, frame_id, client_uuid.
|
||||
const std::vector<Tuple<int, int, std::string>>& clients_info,
|
||||
const std::vector<base::Tuple<int, int, std::string>>& clients_info,
|
||||
const GURL& script_url,
|
||||
const GetClientsCallback& callback) {
|
||||
scoped_ptr<ServiceWorkerClients> clients(new ServiceWorkerClients);
|
||||
|
||||
for (const auto& it : clients_info) {
|
||||
ServiceWorkerClientInfo info =
|
||||
ServiceWorkerProviderHost::GetWindowClientInfoOnUI(get<0>(it),
|
||||
get<1>(it));
|
||||
ServiceWorkerProviderHost::GetWindowClientInfoOnUI(base::get<0>(it),
|
||||
base::get<1>(it));
|
||||
|
||||
// If the request to the provider_host returned an empty
|
||||
// ServiceWorkerClientInfo, that means that it wasn't possible to associate
|
||||
@ -317,7 +317,7 @@ void OnGetWindowClientsFromUI(
|
||||
if (info.url.GetOrigin() != script_url.GetOrigin())
|
||||
continue;
|
||||
|
||||
info.client_uuid = get<2>(it);
|
||||
info.client_uuid = base::get<2>(it);
|
||||
clients->push_back(info);
|
||||
}
|
||||
|
||||
@ -325,12 +325,13 @@ void OnGetWindowClientsFromUI(
|
||||
base::Bind(callback, base::Passed(&clients)));
|
||||
}
|
||||
|
||||
void AddWindowClient(ServiceWorkerProviderHost* host,
|
||||
std::vector<Tuple<int, int, std::string>>* client_info) {
|
||||
void AddWindowClient(
|
||||
ServiceWorkerProviderHost* host,
|
||||
std::vector<base::Tuple<int, int, std::string>>* client_info) {
|
||||
if (host->client_type() != blink::WebServiceWorkerClientTypeWindow)
|
||||
return;
|
||||
client_info->push_back(
|
||||
MakeTuple(host->process_id(), host->frame_id(), host->client_uuid()));
|
||||
client_info->push_back(base::MakeTuple(host->process_id(), host->frame_id(),
|
||||
host->client_uuid()));
|
||||
}
|
||||
|
||||
void AddNonWindowClient(ServiceWorkerProviderHost* host,
|
||||
@ -1729,7 +1730,7 @@ void ServiceWorkerVersion::GetWindowClients(
|
||||
const ServiceWorkerClientQueryOptions& options) {
|
||||
DCHECK(options.client_type == blink::WebServiceWorkerClientTypeWindow ||
|
||||
options.client_type == blink::WebServiceWorkerClientTypeAll);
|
||||
std::vector<Tuple<int, int, std::string>> clients_info;
|
||||
std::vector<base::Tuple<int, int, std::string>> clients_info;
|
||||
if (!options.include_uncontrolled) {
|
||||
for (auto& controllee : controllee_map_)
|
||||
AddWindowClient(controllee.second, &clients_info);
|
||||
|
@ -267,8 +267,8 @@ void SharedWorkerHost::RelayMessage(
|
||||
WorkerMsg_Connect::Param param;
|
||||
if (!WorkerMsg_Connect::Read(&message, ¶m))
|
||||
return;
|
||||
int sent_message_port_id = get<0>(param);
|
||||
int new_routing_id = get<1>(param);
|
||||
int sent_message_port_id = base::get<0>(param);
|
||||
int new_routing_id = base::get<1>(param);
|
||||
|
||||
DCHECK(container_render_filter_);
|
||||
new_routing_id = container_render_filter_->GetNextRoutingID();
|
||||
|
@ -327,12 +327,13 @@ void CheckWorkerProcessMsgCreateWorker(
|
||||
int* route_id) {
|
||||
scoped_ptr<IPC::Message> msg(renderer_host->PopMessage());
|
||||
EXPECT_EQ(WorkerProcessMsg_CreateWorker::ID, msg->type());
|
||||
Tuple<WorkerProcessMsg_CreateWorker_Params> param;
|
||||
base::Tuple<WorkerProcessMsg_CreateWorker_Params> param;
|
||||
EXPECT_TRUE(WorkerProcessMsg_CreateWorker::Read(msg.get(), ¶m));
|
||||
EXPECT_EQ(GURL(expected_url), get<0>(param).url);
|
||||
EXPECT_EQ(base::ASCIIToUTF16(expected_name), get<0>(param).name);
|
||||
EXPECT_EQ(expected_security_policy_type, get<0>(param).security_policy_type);
|
||||
*route_id = get<0>(param).route_id;
|
||||
EXPECT_EQ(GURL(expected_url), base::get<0>(param).url);
|
||||
EXPECT_EQ(base::ASCIIToUTF16(expected_name), base::get<0>(param).name);
|
||||
EXPECT_EQ(expected_security_policy_type,
|
||||
base::get<0>(param).security_policy_type);
|
||||
*route_id = base::get<0>(param).route_id;
|
||||
}
|
||||
|
||||
void CheckViewMsgWorkerCreated(MockRendererProcessHost* renderer_host,
|
||||
@ -358,8 +359,8 @@ void CheckWorkerMsgConnect(MockRendererProcessHost* renderer_host,
|
||||
EXPECT_EQ(expected_msg_route_id, msg->routing_id());
|
||||
WorkerMsg_Connect::Param params;
|
||||
EXPECT_TRUE(WorkerMsg_Connect::Read(msg.get(), ¶ms));
|
||||
int port_id = get<0>(params);
|
||||
*routing_id = get<1>(params);
|
||||
int port_id = base::get<0>(params);
|
||||
*routing_id = base::get<1>(params);
|
||||
EXPECT_EQ(expected_sent_message_port_id, port_id);
|
||||
}
|
||||
|
||||
@ -371,7 +372,7 @@ void CheckMessagePortMsgMessage(MockRendererProcessHost* renderer_host,
|
||||
EXPECT_EQ(expected_msg_route_id, msg->routing_id());
|
||||
MessagePortMsg_Message::Param params;
|
||||
EXPECT_TRUE(MessagePortMsg_Message::Read(msg.get(), ¶ms));
|
||||
base::string16 data = get<0>(params).message_as_string;
|
||||
base::string16 data = base::get<0>(params).message_as_string;
|
||||
EXPECT_EQ(base::ASCIIToUTF16(expected_data), data);
|
||||
}
|
||||
|
||||
|
@ -214,8 +214,8 @@ class InputEventMessageFilterWaitsForAcks : public BrowserMessageFilter {
|
||||
if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) {
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(&message, ¶ms);
|
||||
blink::WebInputEvent::Type type = get<0>(params).type;
|
||||
InputEventAckState ack = get<0>(params).state;
|
||||
blink::WebInputEvent::Type type = base::get<0>(params).type;
|
||||
InputEventAckState ack = base::get<0>(params).state;
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&InputEventMessageFilterWaitsForAcks::ReceivedEventAck,
|
||||
this, type, ack));
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "third_party/WebKit/public/web/WebHeap.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
using base::MakeTuple;
|
||||
using blink::WebFileInfo;
|
||||
using blink::WebFileSystemCallbacks;
|
||||
using blink::WebFileSystemEntry;
|
||||
|
@ -186,60 +186,60 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
|
||||
ADD_FAILURE() << "Expected ResourceHostMsg_RequestResource message";
|
||||
return -1;
|
||||
}
|
||||
ResourceHostMsg_Request request = get<2>(params);
|
||||
ResourceHostMsg_Request request = base::get<2>(params);
|
||||
EXPECT_EQ(kTestPageUrl, request.url.spec());
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
return get<1>(params);
|
||||
return base::get<1>(params);
|
||||
}
|
||||
|
||||
void ConsumeFollowRedirect(int expected_request_id) {
|
||||
ASSERT_FALSE(message_queue_.empty());
|
||||
Tuple<int> args;
|
||||
base::Tuple<int> args;
|
||||
ASSERT_EQ(ResourceHostMsg_FollowRedirect::ID, message_queue_[0].type());
|
||||
ASSERT_TRUE(ResourceHostMsg_FollowRedirect::Read(
|
||||
&message_queue_[0], &args));
|
||||
EXPECT_EQ(expected_request_id, get<0>(args));
|
||||
EXPECT_EQ(expected_request_id, base::get<0>(args));
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
}
|
||||
|
||||
void ConsumeDataReceived_ACK(int expected_request_id) {
|
||||
ASSERT_FALSE(message_queue_.empty());
|
||||
Tuple<int> args;
|
||||
base::Tuple<int> args;
|
||||
ASSERT_EQ(ResourceHostMsg_DataReceived_ACK::ID, message_queue_[0].type());
|
||||
ASSERT_TRUE(ResourceHostMsg_DataReceived_ACK::Read(
|
||||
&message_queue_[0], &args));
|
||||
EXPECT_EQ(expected_request_id, get<0>(args));
|
||||
EXPECT_EQ(expected_request_id, base::get<0>(args));
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
}
|
||||
|
||||
void ConsumeDataDownloaded_ACK(int expected_request_id) {
|
||||
ASSERT_FALSE(message_queue_.empty());
|
||||
Tuple<int> args;
|
||||
base::Tuple<int> args;
|
||||
ASSERT_EQ(ResourceHostMsg_DataDownloaded_ACK::ID, message_queue_[0].type());
|
||||
ASSERT_TRUE(ResourceHostMsg_DataDownloaded_ACK::Read(
|
||||
&message_queue_[0], &args));
|
||||
EXPECT_EQ(expected_request_id, get<0>(args));
|
||||
EXPECT_EQ(expected_request_id, base::get<0>(args));
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
}
|
||||
|
||||
void ConsumeReleaseDownloadedFile(int expected_request_id) {
|
||||
ASSERT_FALSE(message_queue_.empty());
|
||||
Tuple<int> args;
|
||||
base::Tuple<int> args;
|
||||
ASSERT_EQ(ResourceHostMsg_ReleaseDownloadedFile::ID,
|
||||
message_queue_[0].type());
|
||||
ASSERT_TRUE(ResourceHostMsg_ReleaseDownloadedFile::Read(
|
||||
&message_queue_[0], &args));
|
||||
EXPECT_EQ(expected_request_id, get<0>(args));
|
||||
EXPECT_EQ(expected_request_id, base::get<0>(args));
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
}
|
||||
|
||||
void ConsumeCancelRequest(int expected_request_id) {
|
||||
ASSERT_FALSE(message_queue_.empty());
|
||||
Tuple<int> args;
|
||||
base::Tuple<int> args;
|
||||
ASSERT_EQ(ResourceHostMsg_CancelRequest::ID, message_queue_[0].type());
|
||||
ASSERT_TRUE(ResourceHostMsg_CancelRequest::Read(
|
||||
&message_queue_[0], &args));
|
||||
EXPECT_EQ(expected_request_id, get<0>(args));
|
||||
EXPECT_EQ(expected_request_id, base::get<0>(args));
|
||||
message_queue_.erase(message_queue_.begin());
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,8 @@ bool DataProviderMessageFilter::OnMessageReceived(
|
||||
if (request_id == request_id_) {
|
||||
ResourceMsg_DataReceived::Schema::Param arg;
|
||||
if (ResourceMsg_DataReceived::Read(&message, &arg)) {
|
||||
OnReceivedData(get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg));
|
||||
OnReceivedData(base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg), base::get<3>(arg));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ class GpuChannelMessageFilter : public IPC::MessageFilter {
|
||||
}
|
||||
|
||||
if (message.type() == GpuCommandBufferMsg_InsertSyncPoint::ID) {
|
||||
Tuple<bool> retire;
|
||||
base::Tuple<bool> retire;
|
||||
IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message);
|
||||
if (!GpuCommandBufferMsg_InsertSyncPoint::ReadSendParam(&message,
|
||||
&retire)) {
|
||||
@ -120,7 +120,7 @@ class GpuChannelMessageFilter : public IPC::MessageFilter {
|
||||
Send(reply);
|
||||
return true;
|
||||
}
|
||||
if (!future_sync_points_ && !get<0>(retire)) {
|
||||
if (!future_sync_points_ && !base::get<0>(retire)) {
|
||||
LOG(ERROR) << "Untrusted contexts can't create future sync points";
|
||||
reply->set_reply_error();
|
||||
Send(reply);
|
||||
@ -133,7 +133,7 @@ class GpuChannelMessageFilter : public IPC::MessageFilter {
|
||||
FROM_HERE,
|
||||
base::Bind(&GpuChannelMessageFilter::InsertSyncPointOnMainThread,
|
||||
gpu_channel_, sync_point_manager_, message.routing_id(),
|
||||
get<0>(retire), sync_point));
|
||||
base::get<0>(retire), sync_point));
|
||||
handled = true;
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,8 @@ void AndroidVideoEncodeAccelerator::Encode(
|
||||
"Non-packed frame, or visible_rect != coded_size",
|
||||
kInvalidArgumentError);
|
||||
|
||||
pending_frames_.push(MakeTuple(frame, force_keyframe, base::Time::Now()));
|
||||
pending_frames_.push(
|
||||
base::MakeTuple(frame, force_keyframe, base::Time::Now()));
|
||||
DoIOTask();
|
||||
}
|
||||
|
||||
@ -320,7 +321,7 @@ void AndroidVideoEncodeAccelerator::QueueInput() {
|
||||
}
|
||||
|
||||
const PendingFrames::value_type& input = pending_frames_.front();
|
||||
bool is_key_frame = get<1>(input);
|
||||
bool is_key_frame = base::get<1>(input);
|
||||
if (is_key_frame) {
|
||||
// Ideally MediaCodec would honor BUFFER_FLAG_SYNC_FRAME so we could
|
||||
// indicate this in the QueueInputBuffer() call below and guarantee _this_
|
||||
@ -328,7 +329,7 @@ void AndroidVideoEncodeAccelerator::QueueInput() {
|
||||
// Instead, we request a key frame "soon".
|
||||
media_codec_->RequestKeyFrameSoon();
|
||||
}
|
||||
scoped_refptr<VideoFrame> frame = get<0>(input);
|
||||
scoped_refptr<VideoFrame> frame = base::get<0>(input);
|
||||
|
||||
uint8* buffer = NULL;
|
||||
size_t capacity = 0;
|
||||
@ -365,7 +366,7 @@ void AndroidVideoEncodeAccelerator::QueueInput() {
|
||||
status = media_codec_->QueueInputBuffer(
|
||||
input_buf_index, NULL, queued_size, fake_input_timestamp_);
|
||||
UMA_HISTOGRAM_TIMES("Media.AVEA.InputQueueTime",
|
||||
base::Time::Now() - get<2>(input));
|
||||
base::Time::Now() - base::get<2>(input));
|
||||
RETURN_ON_FAILURE(status == media::MEDIA_CODEC_OK,
|
||||
"Failed to QueueInputBuffer: " << status,
|
||||
kPlatformFailureError);
|
||||
|
@ -85,7 +85,7 @@ class CONTENT_EXPORT AndroidVideoEncodeAccelerator
|
||||
// Frames waiting to be passed to the codec, queued until an input buffer is
|
||||
// available. Each element is a tuple of <Frame, key_frame, enqueue_time>.
|
||||
typedef std::queue<
|
||||
Tuple<scoped_refptr<media::VideoFrame>, bool, base::Time>>
|
||||
base::Tuple<scoped_refptr<media::VideoFrame>, bool, base::Time>>
|
||||
PendingFrames;
|
||||
PendingFrames pending_frames_;
|
||||
|
||||
|
@ -82,6 +82,8 @@ using media::VideoDecodeAccelerator;
|
||||
namespace content {
|
||||
namespace {
|
||||
|
||||
using base::MakeTuple;
|
||||
|
||||
// Values optionally filled in from flags; see main() below.
|
||||
// The syntax of multiple test videos is:
|
||||
// test-video1;test-video2;test-video3
|
||||
@ -1177,17 +1179,18 @@ void VideoDecodeAcceleratorTest::OutputLogFile(
|
||||
class VideoDecodeAcceleratorParamTest
|
||||
: public VideoDecodeAcceleratorTest,
|
||||
public ::testing::WithParamInterface<
|
||||
Tuple<int, int, int, ResetPoint, ClientState, bool, bool> > {
|
||||
base::Tuple<int, int, int, ResetPoint, ClientState, bool, bool> > {
|
||||
};
|
||||
|
||||
// Helper so that gtest failures emit a more readable version of the tuple than
|
||||
// its byte representation.
|
||||
::std::ostream& operator<<(
|
||||
::std::ostream& os,
|
||||
const Tuple<int, int, int, ResetPoint, ClientState, bool, bool>& t) {
|
||||
return os << get<0>(t) << ", " << get<1>(t) << ", " << get<2>(t) << ", "
|
||||
<< get<3>(t) << ", " << get<4>(t) << ", " << get<5>(t) << ", "
|
||||
<< get<6>(t);
|
||||
const base::Tuple<int, int, int, ResetPoint, ClientState, bool, bool>& t) {
|
||||
return os << base::get<0>(t) << ", " << base::get<1>(t) << ", "
|
||||
<< base::get<2>(t) << ", " << base::get<3>(t) << ", "
|
||||
<< base::get<4>(t) << ", " << base::get<5>(t) << ", "
|
||||
<< base::get<6>(t);
|
||||
}
|
||||
|
||||
// Wait for |note| to report a state and if it's not |expected_state| then
|
||||
@ -1211,13 +1214,13 @@ enum { kMinSupportedNumConcurrentDecoders = 3 };
|
||||
// Test the most straightforward case possible: data is decoded from a single
|
||||
// chunk and rendered to the screen.
|
||||
TEST_P(VideoDecodeAcceleratorParamTest, TestSimpleDecode) {
|
||||
size_t num_concurrent_decoders = get<0>(GetParam());
|
||||
const size_t num_in_flight_decodes = get<1>(GetParam());
|
||||
int num_play_throughs = get<2>(GetParam());
|
||||
const int reset_point = get<3>(GetParam());
|
||||
const int delete_decoder_state = get<4>(GetParam());
|
||||
bool test_reuse_delay = get<5>(GetParam());
|
||||
const bool render_as_thumbnails = get<6>(GetParam());
|
||||
size_t num_concurrent_decoders = base::get<0>(GetParam());
|
||||
const size_t num_in_flight_decodes = base::get<1>(GetParam());
|
||||
int num_play_throughs = base::get<2>(GetParam());
|
||||
const int reset_point = base::get<3>(GetParam());
|
||||
const int delete_decoder_state = base::get<4>(GetParam());
|
||||
bool test_reuse_delay = base::get<5>(GetParam());
|
||||
const bool render_as_thumbnails = base::get<6>(GetParam());
|
||||
|
||||
if (test_video_files_.size() > 1)
|
||||
num_concurrent_decoders = test_video_files_.size();
|
||||
|
@ -1326,16 +1326,16 @@ void VEAClient::WriteIvfFrameHeader(int frame_index, size_t frame_size) {
|
||||
// - If true, switch framerate mid-stream.
|
||||
class VideoEncodeAcceleratorTest
|
||||
: public ::testing::TestWithParam<
|
||||
Tuple<int, bool, int, bool, bool, bool, bool>> {};
|
||||
base::Tuple<int, bool, int, bool, bool, bool, bool>> {};
|
||||
|
||||
TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
|
||||
size_t num_concurrent_encoders = get<0>(GetParam());
|
||||
const bool save_to_file = get<1>(GetParam());
|
||||
const unsigned int keyframe_period = get<2>(GetParam());
|
||||
const bool force_bitrate = get<3>(GetParam());
|
||||
const bool test_perf = get<4>(GetParam());
|
||||
const bool mid_stream_bitrate_switch = get<5>(GetParam());
|
||||
const bool mid_stream_framerate_switch = get<6>(GetParam());
|
||||
size_t num_concurrent_encoders = base::get<0>(GetParam());
|
||||
const bool save_to_file = base::get<1>(GetParam());
|
||||
const unsigned int keyframe_period = base::get<2>(GetParam());
|
||||
const bool force_bitrate = base::get<3>(GetParam());
|
||||
const bool test_perf = base::get<4>(GetParam());
|
||||
const bool mid_stream_bitrate_switch = base::get<5>(GetParam());
|
||||
const bool mid_stream_framerate_switch = base::get<6>(GetParam());
|
||||
|
||||
ScopedVector<ClientStateNotification<ClientState> > notes;
|
||||
ScopedVector<VEAClient> clients;
|
||||
@ -1393,39 +1393,40 @@ TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SimpleEncode,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, true, 0, false, false, false, false)));
|
||||
::testing::Values(base::MakeTuple(1, true, 0, false, false, false, false)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
EncoderPerf,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, false, 0, false, true, false, false)));
|
||||
::testing::Values(base::MakeTuple(1, false, 0, false, true, false, false)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
ForceKeyframes,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, false, 10, false, false, false, false)));
|
||||
::testing::Values(base::MakeTuple(1, false, 10, false, false, false,
|
||||
false)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
ForceBitrate,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, false, 0, true, false, false, false)));
|
||||
::testing::Values(base::MakeTuple(1, false, 0, true, false, false, false)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MidStreamParamSwitchBitrate,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, false, 0, true, false, true, false)));
|
||||
::testing::Values(base::MakeTuple(1, false, 0, true, false, true, false)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MidStreamParamSwitchFPS,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(1, false, 0, true, false, false, true)));
|
||||
::testing::Values(base::MakeTuple(1, false, 0, true, false, false, true)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MultipleEncoders,
|
||||
VideoEncodeAcceleratorTest,
|
||||
::testing::Values(MakeTuple(3, false, 0, false, false, false, false),
|
||||
MakeTuple(3, false, 0, true, false, false, true),
|
||||
MakeTuple(3, false, 0, true, false, true, false)));
|
||||
::testing::Values(base::MakeTuple(3, false, 0, false, false, false, false),
|
||||
base::MakeTuple(3, false, 0, true, false, false, true),
|
||||
base::MakeTuple(3, false, 0, true, false, true, false)));
|
||||
|
||||
// TODO(posciak): more tests:
|
||||
// - async FeedEncoderWithOutput
|
||||
|
@ -59,10 +59,10 @@ class RendererAccessibilityTest : public RenderViewTest {
|
||||
const IPC::Message* message =
|
||||
sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID);
|
||||
ASSERT_TRUE(message);
|
||||
Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param;
|
||||
base::Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param;
|
||||
AccessibilityHostMsg_Events::Read(message, ¶m);
|
||||
ASSERT_GE(get<0>(param).size(), 1U);
|
||||
*params = get<0>(param)[0];
|
||||
ASSERT_GE(base::get<0>(param).size(), 1U);
|
||||
*params = base::get<0>(param)[0];
|
||||
}
|
||||
|
||||
int CountAccessibilityNodesSentToBrowser() {
|
||||
@ -404,9 +404,9 @@ TEST_F(RendererAccessibilityTest, EventOnObjectNotInTree) {
|
||||
const IPC::Message* message =
|
||||
sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID);
|
||||
ASSERT_TRUE(message);
|
||||
Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param;
|
||||
base::Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param;
|
||||
AccessibilityHostMsg_Events::Read(message, ¶m);
|
||||
ASSERT_EQ(0U, get<0>(param).size());
|
||||
ASSERT_EQ(0U, base::get<0>(param).size());
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -182,15 +182,15 @@ void BrowserPlugin::OnCompositorFrameSwapped(const IPC::Message& message) {
|
||||
guest_crashed_ = false;
|
||||
|
||||
scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
|
||||
get<1>(param).frame.AssignTo(frame.get());
|
||||
base::get<1>(param).frame.AssignTo(frame.get());
|
||||
|
||||
EnableCompositing(true);
|
||||
compositing_helper_->OnCompositorFrameSwapped(
|
||||
frame.Pass(),
|
||||
get<1>(param).producing_route_id,
|
||||
get<1>(param).output_surface_id,
|
||||
get<1>(param).producing_host_id,
|
||||
get<1>(param).shared_memory_handle);
|
||||
base::get<1>(param).producing_route_id,
|
||||
base::get<1>(param).output_surface_id,
|
||||
base::get<1>(param).producing_host_id,
|
||||
base::get<1>(param).shared_memory_handle);
|
||||
}
|
||||
|
||||
void BrowserPlugin::OnGuestGone(int browser_plugin_instance_id) {
|
||||
|
@ -124,11 +124,11 @@ void BrowserPluginManager::OnCompositorFrameSwappedPluginUnavailable(
|
||||
return;
|
||||
|
||||
FrameHostMsg_CompositorFrameSwappedACK_Params params;
|
||||
params.producing_host_id = get<1>(param).producing_host_id;
|
||||
params.producing_route_id = get<1>(param).producing_route_id;
|
||||
params.output_surface_id = get<1>(param).output_surface_id;
|
||||
params.producing_host_id = base::get<1>(param).producing_host_id;
|
||||
params.producing_route_id = base::get<1>(param).producing_route_id;
|
||||
params.output_surface_id = base::get<1>(param).output_surface_id;
|
||||
Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK(
|
||||
get<0>(param), params));
|
||||
base::get<0>(param), params));
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -86,10 +86,10 @@ TEST_F(ExternalPopupMenuTest, NormalCase) {
|
||||
const IPC::Message* message =
|
||||
sink.GetUniqueMessageMatching(FrameHostMsg_ShowPopup::ID);
|
||||
ASSERT_TRUE(message != NULL);
|
||||
Tuple<FrameHostMsg_ShowPopup_Params> param;
|
||||
base::Tuple<FrameHostMsg_ShowPopup_Params> param;
|
||||
FrameHostMsg_ShowPopup::Read(message, ¶m);
|
||||
ASSERT_EQ(3U, get<0>(param).popup_items.size());
|
||||
EXPECT_EQ(1, get<0>(param).selected_item);
|
||||
ASSERT_EQ(3U, base::get<0>(param).popup_items.size());
|
||||
EXPECT_EQ(1, base::get<0>(param).selected_item);
|
||||
|
||||
// Simulate the user canceling the popup; the index should not have changed.
|
||||
frame()->OnSelectPopupMenuItem(-1);
|
||||
@ -106,8 +106,8 @@ TEST_F(ExternalPopupMenuTest, NormalCase) {
|
||||
message = sink.GetUniqueMessageMatching(FrameHostMsg_ShowPopup::ID);
|
||||
ASSERT_TRUE(message != NULL);
|
||||
FrameHostMsg_ShowPopup::Read(message, ¶m);
|
||||
ASSERT_EQ(3U, get<0>(param).popup_items.size());
|
||||
EXPECT_EQ(0, get<0>(param).selected_item);
|
||||
ASSERT_EQ(3U, base::get<0>(param).popup_items.size());
|
||||
EXPECT_EQ(0, base::get<0>(param).selected_item);
|
||||
}
|
||||
|
||||
// Page shows popup, then navigates away while popup showing, then select.
|
||||
@ -189,11 +189,11 @@ TEST_F(ExternalPopupMenuDisplayNoneTest, SelectItem) {
|
||||
const IPC::Message* message =
|
||||
sink.GetUniqueMessageMatching(FrameHostMsg_ShowPopup::ID);
|
||||
ASSERT_TRUE(message != NULL);
|
||||
Tuple<FrameHostMsg_ShowPopup_Params> param;
|
||||
base::Tuple<FrameHostMsg_ShowPopup_Params> param;
|
||||
FrameHostMsg_ShowPopup::Read(message, ¶m);
|
||||
// Number of items should match item count minus the number
|
||||
// of "display: none" items.
|
||||
ASSERT_EQ(5U, get<0>(param).popup_items.size());
|
||||
ASSERT_EQ(5U, base::get<0>(param).popup_items.size());
|
||||
|
||||
// Select index 1 item. This should select item with index 2,
|
||||
// skipping the item with 'display: none'
|
||||
|
@ -145,9 +145,9 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
|
||||
InputMsg_HandleInputEvent::Param params;
|
||||
if (!InputMsg_HandleInputEvent::Read(&message, ¶ms))
|
||||
return;
|
||||
const WebInputEvent* event = get<0>(params);
|
||||
ui::LatencyInfo latency_info = get<1>(params);
|
||||
bool is_keyboard_shortcut = get<2>(params);
|
||||
const WebInputEvent* event = base::get<0>(params);
|
||||
ui::LatencyInfo latency_info = base::get<1>(params);
|
||||
bool is_keyboard_shortcut = base::get<2>(params);
|
||||
DCHECK(event);
|
||||
|
||||
const bool send_ack = WebInputEventTraits::WillReceiveAckFromRenderer(*event);
|
||||
|
@ -179,8 +179,8 @@ TEST_F(InputEventFilterTest, Basic) {
|
||||
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms));
|
||||
WebInputEvent::Type event_type = get<0>(params).type;
|
||||
InputEventAckState ack_result = get<0>(params).state;
|
||||
WebInputEvent::Type event_type = base::get<0>(params).type;
|
||||
InputEventAckState ack_result = base::get<0>(params).state;
|
||||
|
||||
EXPECT_EQ(kEvents[i].type, event_type);
|
||||
EXPECT_EQ(ack_result, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
|
||||
@ -205,7 +205,7 @@ TEST_F(InputEventFilterTest, Basic) {
|
||||
ASSERT_EQ(InputMsg_HandleInputEvent::ID, message.type());
|
||||
InputMsg_HandleInputEvent::Param params;
|
||||
EXPECT_TRUE(InputMsg_HandleInputEvent::Read(&message, ¶ms));
|
||||
const WebInputEvent* event = get<0>(params);
|
||||
const WebInputEvent* event = base::get<0>(params);
|
||||
|
||||
EXPECT_EQ(kEvents[i].size, event->size);
|
||||
EXPECT_TRUE(memcmp(&kEvents[i], event, event->size) == 0);
|
||||
@ -231,8 +231,8 @@ TEST_F(InputEventFilterTest, Basic) {
|
||||
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
EXPECT_TRUE(InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms));
|
||||
WebInputEvent::Type event_type = get<0>(params).type;
|
||||
InputEventAckState ack_result = get<0>(params).state;
|
||||
WebInputEvent::Type event_type = base::get<0>(params).type;
|
||||
InputEventAckState ack_result = base::get<0>(params).state;
|
||||
EXPECT_EQ(kEvents[i].type, event_type);
|
||||
EXPECT_EQ(ack_result, INPUT_EVENT_ACK_STATE_CONSUMED);
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ class RenderMediaLogTest : public testing::Test {
|
||||
return std::vector<media::MediaLogEvent>();
|
||||
}
|
||||
|
||||
Tuple<std::vector<media::MediaLogEvent>> events;
|
||||
base::Tuple<std::vector<media::MediaLogEvent>> events;
|
||||
ViewHostMsg_MediaLogEvents::Read(msg, &events);
|
||||
return get<0>(events);
|
||||
return base::get<0>(events);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -92,7 +92,7 @@ TEST_F(PepperFileChooserHostTest, Show) {
|
||||
ASSERT_TRUE(msg);
|
||||
ViewHostMsg_RunFileChooser::Schema::Param call_msg_param;
|
||||
ASSERT_TRUE(ViewHostMsg_RunFileChooser::Read(msg, &call_msg_param));
|
||||
const FileChooserParams& chooser_params = get<0>(call_msg_param);
|
||||
const FileChooserParams& chooser_params = base::get<0>(call_msg_param);
|
||||
|
||||
// Basic validation of request.
|
||||
EXPECT_EQ(FileChooserParams::Open, chooser_params.mode);
|
||||
@ -124,7 +124,7 @@ TEST_F(PepperFileChooserHostTest, Show) {
|
||||
ASSERT_TRUE(
|
||||
PpapiPluginMsg_FileChooser_ShowReply::Read(&reply_msg, &reply_msg_param));
|
||||
const std::vector<ppapi::FileRefCreateInfo>& chooser_results =
|
||||
get<0>(reply_msg_param);
|
||||
base::get<0>(reply_msg_param);
|
||||
ASSERT_EQ(1u, chooser_results.size());
|
||||
EXPECT_EQ(FilePathToUTF8(selected_info.display_name),
|
||||
chooser_results[0].display_name);
|
||||
|
@ -129,7 +129,7 @@ TEST_F(PluginPowerSaverHelperTest, TemporaryOriginWhitelist) {
|
||||
EXPECT_EQ(FrameHostMsg_PluginContentOriginAllowed::ID, msg->type());
|
||||
FrameHostMsg_PluginContentOriginAllowed::Param params;
|
||||
FrameHostMsg_PluginContentOriginAllowed::Read(msg, ¶ms);
|
||||
EXPECT_EQ(GURL("http://b.com"), get<0>(params));
|
||||
EXPECT_EQ(GURL("http://b.com"), base::get<0>(params));
|
||||
}
|
||||
|
||||
TEST_F(PluginPowerSaverHelperTest, UnthrottleOnExPostFactoWhitelist) {
|
||||
|
@ -246,7 +246,7 @@ void RenderFrameProxy::OnCompositorFrameSwapped(const IPC::Message& message) {
|
||||
return;
|
||||
|
||||
scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
|
||||
get<0>(param).frame.AssignTo(frame.get());
|
||||
base::get<0>(param).frame.AssignTo(frame.get());
|
||||
|
||||
if (!compositing_helper_.get()) {
|
||||
compositing_helper_ =
|
||||
@ -255,10 +255,10 @@ void RenderFrameProxy::OnCompositorFrameSwapped(const IPC::Message& message) {
|
||||
}
|
||||
compositing_helper_->OnCompositorFrameSwapped(
|
||||
frame.Pass(),
|
||||
get<0>(param).producing_route_id,
|
||||
get<0>(param).output_surface_id,
|
||||
get<0>(param).producing_host_id,
|
||||
get<0>(param).shared_memory_handle);
|
||||
base::get<0>(param).producing_route_id,
|
||||
base::get<0>(param).output_surface_id,
|
||||
base::get<0>(param).producing_host_id,
|
||||
base::get<0>(param).shared_memory_handle);
|
||||
}
|
||||
|
||||
void RenderFrameProxy::OnDisownOpener() {
|
||||
|
@ -406,8 +406,8 @@ TEST_F(RenderViewImplTest, SaveImageFromDataURL) {
|
||||
|
||||
ViewHostMsg_SaveImageFromDataURL::Param param1;
|
||||
ViewHostMsg_SaveImageFromDataURL::Read(msg2, ¶m1);
|
||||
EXPECT_EQ(get<1>(param1).length(), image_data_url.length());
|
||||
EXPECT_EQ(get<1>(param1), image_data_url);
|
||||
EXPECT_EQ(base::get<1>(param1).length(), image_data_url.length());
|
||||
EXPECT_EQ(base::get<1>(param1), image_data_url);
|
||||
|
||||
ProcessPendingMessages();
|
||||
render_thread_->sink().ClearMessages();
|
||||
@ -422,8 +422,8 @@ TEST_F(RenderViewImplTest, SaveImageFromDataURL) {
|
||||
|
||||
ViewHostMsg_SaveImageFromDataURL::Param param2;
|
||||
ViewHostMsg_SaveImageFromDataURL::Read(msg3, ¶m2);
|
||||
EXPECT_EQ(get<1>(param2).length(), large_data_url.length());
|
||||
EXPECT_EQ(get<1>(param2), large_data_url);
|
||||
EXPECT_EQ(base::get<1>(param2).length(), large_data_url.length());
|
||||
EXPECT_EQ(base::get<1>(param2), large_data_url);
|
||||
|
||||
ProcessPendingMessages();
|
||||
render_thread_->sink().ClearMessages();
|
||||
@ -488,12 +488,12 @@ TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
|
||||
FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params;
|
||||
FrameHostMsg_DidCommitProvisionalLoad::Read(frame_navigate_msg,
|
||||
&host_nav_params);
|
||||
EXPECT_TRUE(get<0>(host_nav_params).is_post);
|
||||
EXPECT_TRUE(base::get<0>(host_nav_params).is_post);
|
||||
|
||||
// Check post data sent to browser matches
|
||||
EXPECT_TRUE(get<0>(host_nav_params).page_state.IsValid());
|
||||
EXPECT_TRUE(base::get<0>(host_nav_params).page_state.IsValid());
|
||||
scoped_ptr<HistoryEntry> entry =
|
||||
PageStateToHistoryEntry(get<0>(host_nav_params).page_state);
|
||||
PageStateToHistoryEntry(base::get<0>(host_nav_params).page_state);
|
||||
blink::WebHTTPBody body = entry->root().httpBody();
|
||||
blink::WebHTTPBody::Element element;
|
||||
bool successful = body.elementAt(0, element);
|
||||
@ -699,8 +699,8 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
|
||||
ASSERT_TRUE(msg_A);
|
||||
ViewHostMsg_UpdateState::Param params;
|
||||
ViewHostMsg_UpdateState::Read(msg_A, ¶ms);
|
||||
int page_id_A = get<0>(params);
|
||||
PageState state_A = get<1>(params);
|
||||
int page_id_A = base::get<0>(params);
|
||||
PageState state_A = base::get<1>(params);
|
||||
EXPECT_EQ(1, page_id_A);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
@ -758,7 +758,7 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
|
||||
FrameHostMsg_DidCommitProvisionalLoad::Param commit_load_params;
|
||||
FrameHostMsg_DidCommitProvisionalLoad::Read(frame_navigate_msg,
|
||||
&commit_load_params);
|
||||
EXPECT_NE(GURL("swappedout://"), get<0>(commit_load_params).url);
|
||||
EXPECT_NE(GURL("swappedout://"), base::get<0>(commit_load_params).url);
|
||||
}
|
||||
|
||||
// Verify that security origins are replicated properly to RenderFrameProxies
|
||||
@ -818,8 +818,8 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
|
||||
ASSERT_TRUE(msg_A);
|
||||
ViewHostMsg_UpdateState::Param param;
|
||||
ViewHostMsg_UpdateState::Read(msg_A, ¶m);
|
||||
int page_id_A = get<0>(param);
|
||||
PageState state_A = get<1>(param);
|
||||
int page_id_A = base::get<0>(param);
|
||||
PageState state_A = base::get<1>(param);
|
||||
EXPECT_EQ(1, page_id_A);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
@ -832,8 +832,8 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
|
||||
ViewHostMsg_UpdateState::ID);
|
||||
ASSERT_TRUE(msg_B);
|
||||
ViewHostMsg_UpdateState::Read(msg_B, ¶m);
|
||||
int page_id_B = get<0>(param);
|
||||
PageState state_B = get<1>(param);
|
||||
int page_id_B = base::get<0>(param);
|
||||
PageState state_B = base::get<1>(param);
|
||||
EXPECT_EQ(2, page_id_B);
|
||||
EXPECT_NE(state_A, state_B);
|
||||
render_thread_->sink().ClearMessages();
|
||||
@ -847,8 +847,8 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
|
||||
ViewHostMsg_UpdateState::ID);
|
||||
ASSERT_TRUE(msg_C);
|
||||
ViewHostMsg_UpdateState::Read(msg_C, ¶m);
|
||||
int page_id_C = get<0>(param);
|
||||
PageState state_C = get<1>(param);
|
||||
int page_id_C = base::get<0>(param);
|
||||
PageState state_C = base::get<1>(param);
|
||||
EXPECT_EQ(3, page_id_C);
|
||||
EXPECT_NE(state_B, state_C);
|
||||
render_thread_->sink().ClearMessages();
|
||||
@ -902,8 +902,8 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
|
||||
ViewHostMsg_UpdateState::ID);
|
||||
ASSERT_TRUE(msg);
|
||||
ViewHostMsg_UpdateState::Read(msg, ¶m);
|
||||
int page_id = get<0>(param);
|
||||
PageState state = get<1>(param);
|
||||
int page_id = base::get<0>(param);
|
||||
PageState state = base::get<1>(param);
|
||||
EXPECT_EQ(page_id_C, page_id);
|
||||
EXPECT_NE(state_A, state);
|
||||
EXPECT_NE(state_B, state);
|
||||
@ -930,8 +930,8 @@ TEST_F(RenderViewImplTest, StaleNavigationsIgnored) {
|
||||
ASSERT_TRUE(msg_A);
|
||||
ViewHostMsg_UpdateState::Param param;
|
||||
ViewHostMsg_UpdateState::Read(msg_A, ¶m);
|
||||
int page_id_A = get<0>(param);
|
||||
PageState state_A = get<1>(param);
|
||||
int page_id_A = base::get<0>(param);
|
||||
PageState state_A = base::get<1>(param);
|
||||
EXPECT_EQ(1, page_id_A);
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
@ -1060,9 +1060,9 @@ TEST_F(RenderViewImplTest, OnImeTypeChanged) {
|
||||
EXPECT_EQ(ViewHostMsg_TextInputTypeChanged::ID, msg->type());
|
||||
ViewHostMsg_TextInputTypeChanged::Param params;
|
||||
ViewHostMsg_TextInputTypeChanged::Read(msg, ¶ms);
|
||||
ui::TextInputType type = get<0>(params);
|
||||
ui::TextInputMode input_mode = get<1>(params);
|
||||
bool can_compose_inline = get<2>(params);
|
||||
ui::TextInputType type = base::get<0>(params);
|
||||
ui::TextInputMode input_mode = base::get<1>(params);
|
||||
bool can_compose_inline = base::get<2>(params);
|
||||
EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, type);
|
||||
EXPECT_EQ(true, can_compose_inline);
|
||||
|
||||
@ -1079,8 +1079,8 @@ TEST_F(RenderViewImplTest, OnImeTypeChanged) {
|
||||
EXPECT_TRUE(msg != NULL);
|
||||
EXPECT_EQ(ViewHostMsg_TextInputTypeChanged::ID, msg->type());
|
||||
ViewHostMsg_TextInputTypeChanged::Read(msg, & params);
|
||||
type = get<0>(params);
|
||||
input_mode = get<1>(params);
|
||||
type = base::get<0>(params);
|
||||
input_mode = base::get<1>(params);
|
||||
EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, type);
|
||||
|
||||
for (size_t i = 0; i < arraysize(kInputModeTestCases); i++) {
|
||||
@ -1101,8 +1101,8 @@ TEST_F(RenderViewImplTest, OnImeTypeChanged) {
|
||||
EXPECT_TRUE(msg != NULL);
|
||||
EXPECT_EQ(ViewHostMsg_TextInputTypeChanged::ID, msg->type());
|
||||
ViewHostMsg_TextInputTypeChanged::Read(msg, & params);
|
||||
type = get<0>(params);
|
||||
input_mode = get<1>(params);
|
||||
type = base::get<0>(params);
|
||||
input_mode = base::get<1>(params);
|
||||
EXPECT_EQ(test_case->expected_mode, input_mode);
|
||||
}
|
||||
}
|
||||
@ -2227,7 +2227,7 @@ TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) {
|
||||
|
||||
ViewHostMsg_FocusedNodeChanged::Param params;
|
||||
ViewHostMsg_FocusedNodeChanged::Read(msg1, ¶ms);
|
||||
EXPECT_TRUE(get<0>(params));
|
||||
EXPECT_TRUE(base::get<0>(params));
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
ExecuteJavaScript("document.getElementById('test2').focus();");
|
||||
@ -2235,7 +2235,7 @@ TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) {
|
||||
ViewHostMsg_FocusedNodeChanged::ID);
|
||||
EXPECT_TRUE(msg2);
|
||||
ViewHostMsg_FocusedNodeChanged::Read(msg2, ¶ms);
|
||||
EXPECT_TRUE(get<0>(params));
|
||||
EXPECT_TRUE(base::get<0>(params));
|
||||
render_thread_->sink().ClearMessages();
|
||||
|
||||
view()->webview()->clearFocusedElement();
|
||||
@ -2243,7 +2243,7 @@ TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) {
|
||||
ViewHostMsg_FocusedNodeChanged::ID);
|
||||
EXPECT_TRUE(msg3);
|
||||
ViewHostMsg_FocusedNodeChanged::Read(msg3, ¶ms);
|
||||
EXPECT_FALSE(get<0>(params));
|
||||
EXPECT_FALSE(base::get<0>(params));
|
||||
render_thread_->sink().ClearMessages();
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ TEST_F(RenderWidgetUnittest, TouchHitTestSinglePoint) {
|
||||
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms);
|
||||
InputEventAckState ack_state = get<0>(params).state;
|
||||
InputEventAckState ack_state = base::get<0>(params).state;
|
||||
EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, ack_state);
|
||||
widget->sink()->ClearMessages();
|
||||
|
||||
@ -103,7 +103,7 @@ TEST_F(RenderWidgetUnittest, TouchHitTestSinglePoint) {
|
||||
message = widget->sink()->GetMessageAt(0);
|
||||
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms);
|
||||
ack_state = get<0>(params).state;
|
||||
ack_state = base::get<0>(params).state;
|
||||
EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, ack_state);
|
||||
widget->sink()->ClearMessages();
|
||||
}
|
||||
@ -127,7 +127,7 @@ TEST_F(RenderWidgetUnittest, TouchHitTestMultiplePoints) {
|
||||
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
|
||||
InputHostMsg_HandleInputEvent_ACK::Param params;
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms);
|
||||
InputEventAckState ack_state = get<0>(params).state;
|
||||
InputEventAckState ack_state = base::get<0>(params).state;
|
||||
EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, ack_state);
|
||||
widget->sink()->ClearMessages();
|
||||
|
||||
@ -138,7 +138,7 @@ TEST_F(RenderWidgetUnittest, TouchHitTestMultiplePoints) {
|
||||
message = widget->sink()->GetMessageAt(0);
|
||||
EXPECT_EQ(InputHostMsg_HandleInputEvent_ACK::ID, message->type());
|
||||
InputHostMsg_HandleInputEvent_ACK::Read(message, ¶ms);
|
||||
ack_state = get<0>(params).state;
|
||||
ack_state = base::get<0>(params).state;
|
||||
EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, ack_state);
|
||||
widget->sink()->ClearMessages();
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ class ScreenOrientationDispatcherTest : public testing::Test {
|
||||
ScreenOrientationHostMsg_LockRequest::ID);
|
||||
EXPECT_TRUE(msg != NULL);
|
||||
|
||||
Tuple<blink::WebScreenOrientationLockType,int> params;
|
||||
base::Tuple<blink::WebScreenOrientationLockType, int> params;
|
||||
ScreenOrientationHostMsg_LockRequest::Read(msg, ¶ms);
|
||||
return get<1>(params);
|
||||
return base::get<1>(params);
|
||||
}
|
||||
|
||||
IPC::TestSink& sink() {
|
||||
|
@ -297,8 +297,8 @@ TEST_F(ExtensionAlarmsTest, CreateDelayBelowMinimum) {
|
||||
ASSERT_TRUE(warning);
|
||||
ExtensionMsg_AddMessageToConsole::Param params;
|
||||
ExtensionMsg_AddMessageToConsole::Read(warning, ¶ms);
|
||||
content::ConsoleMessageLevel level = get<0>(params);
|
||||
std::string message = get<1>(params);
|
||||
content::ConsoleMessageLevel level = base::get<0>(params);
|
||||
std::string message = base::get<1>(params);
|
||||
EXPECT_EQ(content::CONSOLE_MESSAGE_LEVEL_WARNING, level);
|
||||
EXPECT_THAT(message, testing::HasSubstr("delay is less than minimum of 1"));
|
||||
}
|
||||
|
@ -742,8 +742,8 @@ bool SandboxedUnpacker::RewriteImageFiles(SkBitmap* install_icon) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const SkBitmap& image = get<0>(images[i]);
|
||||
base::FilePath path_suffix = get<1>(images[i]);
|
||||
const SkBitmap& image = base::get<0>(images[i]);
|
||||
base::FilePath path_suffix = base::get<1>(images[i]);
|
||||
if (path_suffix.MaybeAsASCII() == install_icon_path)
|
||||
*install_icon = image;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_
|
||||
#define EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_
|
||||
|
||||
typedef std::vector<Tuple<SkBitmap, base::FilePath>> DecodedImages;
|
||||
typedef std::vector<base::Tuple<SkBitmap, base::FilePath>> DecodedImages;
|
||||
|
||||
#endif // EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_
|
||||
|
||||
|
@ -264,7 +264,7 @@ bool Unpacker::AddDecodedImage(const base::FilePath& path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
internal_data_->decoded_images.push_back(MakeTuple(image_bitmap, path));
|
||||
internal_data_->decoded_images.push_back(base::MakeTuple(image_bitmap, path));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@
|
||||
void (T::*func)(P*, TA)) { \
|
||||
Schema::Param p; \
|
||||
if (Read(msg, &p)) { \
|
||||
(obj->*func)(parameter, get<0>(p)); \
|
||||
(obj->*func)(parameter, base::get<0>(p)); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
@ -469,7 +469,7 @@
|
||||
void (T::*func)(P*, TA, TB)) { \
|
||||
Schema::Param p; \
|
||||
if (Read(msg, &p)) { \
|
||||
(obj->*func)(parameter, get<0>(p), get<1>(p)); \
|
||||
(obj->*func)(parameter, base::get<0>(p), base::get<1>(p)); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
@ -481,7 +481,8 @@
|
||||
void (T::*func)(P*, TA, TB, TC)) { \
|
||||
Schema::Param p; \
|
||||
if (Read(msg, &p)) { \
|
||||
(obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p)); \
|
||||
(obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \
|
||||
base::get<2>(p)); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
@ -494,7 +495,8 @@
|
||||
void (T::*func)(P*, TA, TB, TC, TD)) { \
|
||||
Schema::Param p; \
|
||||
if (Read(msg, &p)) { \
|
||||
(obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p)); \
|
||||
(obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \
|
||||
base::get<2>(p), base::get<3>(p)); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
@ -507,8 +509,8 @@
|
||||
void (T::*func)(P*, TA, TB, TC, TD, TE)) { \
|
||||
Schema::Param p; \
|
||||
if (Read(msg, &p)) { \
|
||||
(obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p), \
|
||||
get<4>(p)); \
|
||||
(obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \
|
||||
base::get<2>(p), base::get<3>(p), base::get<4>(p)); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
@ -636,7 +638,7 @@
|
||||
static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \
|
||||
static bool ReadReplyParam( \
|
||||
const Message* msg, \
|
||||
TupleTypes<ReplyParam>::ValueTuple* p); \
|
||||
base::TupleTypes<ReplyParam>::ValueTuple* p); \
|
||||
static void Log(std::string* name, const Message* msg, std::string* l); \
|
||||
IPC_SYNC_MESSAGE_METHODS_##out_cnt \
|
||||
};
|
||||
@ -658,7 +660,7 @@
|
||||
static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \
|
||||
static bool ReadReplyParam( \
|
||||
const Message* msg, \
|
||||
TupleTypes<ReplyParam>::ValueTuple* p); \
|
||||
base::TupleTypes<ReplyParam>::ValueTuple* p); \
|
||||
static void Log(std::string* name, const Message* msg, std::string* l); \
|
||||
IPC_SYNC_MESSAGE_METHODS_##out_cnt \
|
||||
};
|
||||
@ -711,8 +713,9 @@
|
||||
bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \
|
||||
return Schema::ReadSendParam(msg, p); \
|
||||
} \
|
||||
bool msg_class::ReadReplyParam(const Message* msg, \
|
||||
TupleTypes<ReplyParam>::ValueTuple* p) { \
|
||||
bool msg_class::ReadReplyParam( \
|
||||
const Message* msg, \
|
||||
base::TupleTypes<ReplyParam>::ValueTuple* p) { \
|
||||
return Schema::ReadReplyParam(msg, p); \
|
||||
}
|
||||
|
||||
@ -731,8 +734,9 @@
|
||||
bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \
|
||||
return Schema::ReadSendParam(msg, p); \
|
||||
} \
|
||||
bool msg_class::ReadReplyParam(const Message* msg, \
|
||||
TupleTypes<ReplyParam>::ValueTuple* p) { \
|
||||
bool msg_class::ReadReplyParam( \
|
||||
const Message* msg, \
|
||||
base::TupleTypes<ReplyParam>::ValueTuple* p) { \
|
||||
return Schema::ReadReplyParam(msg, p); \
|
||||
}
|
||||
|
||||
@ -766,12 +770,12 @@
|
||||
if (!msg || !l) \
|
||||
return; \
|
||||
if (msg->is_sync()) { \
|
||||
TupleTypes<Schema::SendParam>::ValueTuple p; \
|
||||
base::TupleTypes<Schema::SendParam>::ValueTuple p; \
|
||||
if (Schema::ReadSendParam(msg, &p)) \
|
||||
IPC::LogParam(p, l); \
|
||||
AddOutputParamsToLog(msg, l); \
|
||||
} else { \
|
||||
TupleTypes<Schema::ReplyParam>::ValueTuple p; \
|
||||
base::TupleTypes<Schema::ReplyParam>::ValueTuple p; \
|
||||
if (Schema::ReadReplyParam(msg, &p)) \
|
||||
IPC::LogParam(p, l); \
|
||||
} \
|
||||
@ -816,33 +820,38 @@
|
||||
#define IPC_TYPE_OUT_1(t1) t1* arg6
|
||||
#define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7
|
||||
#define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8
|
||||
#define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* arg9
|
||||
#define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, \
|
||||
t4* arg9
|
||||
|
||||
#define IPC_TUPLE_IN_0() Tuple<>
|
||||
#define IPC_TUPLE_IN_1(t1) Tuple<t1>
|
||||
#define IPC_TUPLE_IN_2(t1, t2) Tuple<t1, t2>
|
||||
#define IPC_TUPLE_IN_3(t1, t2, t3) Tuple<t1, t2, t3>
|
||||
#define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple<t1, t2, t3, t4>
|
||||
#define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple<t1, t2, t3, t4, t5>
|
||||
#define IPC_TUPLE_IN_0() base::Tuple<>
|
||||
#define IPC_TUPLE_IN_1(t1) base::Tuple<t1>
|
||||
#define IPC_TUPLE_IN_2(t1, t2) base::Tuple<t1, t2>
|
||||
#define IPC_TUPLE_IN_3(t1, t2, t3) base::Tuple<t1, t2, t3>
|
||||
#define IPC_TUPLE_IN_4(t1, t2, t3, t4) base::Tuple<t1, t2, t3, t4>
|
||||
#define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) base::Tuple<t1, t2, t3, t4, t5>
|
||||
|
||||
#define IPC_TUPLE_OUT_0() Tuple<>
|
||||
#define IPC_TUPLE_OUT_1(t1) Tuple<t1&>
|
||||
#define IPC_TUPLE_OUT_2(t1, t2) Tuple<t1&, t2&>
|
||||
#define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple<t1&, t2&, t3&>
|
||||
#define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple<t1&, t2&, t3&, t4&>
|
||||
#define IPC_TUPLE_OUT_0() base::Tuple<>
|
||||
#define IPC_TUPLE_OUT_1(t1) base::Tuple<t1&>
|
||||
#define IPC_TUPLE_OUT_2(t1, t2) base::Tuple<t1&, t2&>
|
||||
#define IPC_TUPLE_OUT_3(t1, t2, t3) base::Tuple<t1&, t2&, t3&>
|
||||
#define IPC_TUPLE_OUT_4(t1, t2, t3, t4) base::Tuple<t1&, t2&, t3&, t4&>
|
||||
|
||||
#define IPC_NAME_IN_0() MakeTuple()
|
||||
#define IPC_NAME_IN_1(t1) MakeRefTuple(arg1)
|
||||
#define IPC_NAME_IN_2(t1, t2) MakeRefTuple(arg1, arg2)
|
||||
#define IPC_NAME_IN_3(t1, t2, t3) MakeRefTuple(arg1, arg2, arg3)
|
||||
#define IPC_NAME_IN_4(t1, t2, t3, t4) MakeRefTuple(arg1, arg2, arg3, arg4)
|
||||
#define IPC_NAME_IN_5(t1, t2, t3, t4, t5) MakeRefTuple(arg1, arg2, arg3, arg4, arg5)
|
||||
#define IPC_NAME_IN_0() base::MakeTuple()
|
||||
#define IPC_NAME_IN_1(t1) base::MakeRefTuple(arg1)
|
||||
#define IPC_NAME_IN_2(t1, t2) base::MakeRefTuple(arg1, arg2)
|
||||
#define IPC_NAME_IN_3(t1, t2, t3) base::MakeRefTuple(arg1, arg2, arg3)
|
||||
#define IPC_NAME_IN_4(t1, t2, t3, t4) base::MakeRefTuple(arg1, arg2, \
|
||||
arg3, arg4)
|
||||
#define IPC_NAME_IN_5(t1, t2, t3, t4, t5) base::MakeRefTuple(arg1, arg2, \
|
||||
arg3, arg4, arg5)
|
||||
|
||||
#define IPC_NAME_OUT_0() MakeTuple()
|
||||
#define IPC_NAME_OUT_1(t1) MakeRefTuple(*arg6)
|
||||
#define IPC_NAME_OUT_2(t1, t2) MakeRefTuple(*arg6, *arg7)
|
||||
#define IPC_NAME_OUT_3(t1, t2, t3) MakeRefTuple(*arg6, *arg7, *arg8)
|
||||
#define IPC_NAME_OUT_4(t1, t2, t3, t4) MakeRefTuple(*arg6, *arg7, *arg8, *arg9)
|
||||
#define IPC_NAME_OUT_0() base::MakeTuple()
|
||||
#define IPC_NAME_OUT_1(t1) base::MakeRefTuple(*arg6)
|
||||
#define IPC_NAME_OUT_2(t1, t2) base::MakeRefTuple(*arg6, *arg7)
|
||||
#define IPC_NAME_OUT_3(t1, t2, t3) base::MakeRefTuple(*arg6, *arg7, \
|
||||
*arg8)
|
||||
#define IPC_NAME_OUT_4(t1, t2, t3, t4) base::MakeRefTuple(*arg6, *arg7, \
|
||||
*arg8, *arg9)
|
||||
|
||||
// There are places where the syntax requires a comma if there are input args,
|
||||
// if there are input args and output args, or if there are input args or
|
||||
|
@ -503,8 +503,8 @@ struct IPC_EXPORT ParamTraits<base::TimeTicks> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<Tuple<>> {
|
||||
typedef Tuple<> param_type;
|
||||
struct ParamTraits<base::Tuple<>> {
|
||||
typedef base::Tuple<> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
@ -515,112 +515,112 @@ struct ParamTraits<Tuple<>> {
|
||||
};
|
||||
|
||||
template <class A>
|
||||
struct ParamTraits<Tuple<A>> {
|
||||
typedef Tuple<A> param_type;
|
||||
struct ParamTraits<base::Tuple<A>> {
|
||||
typedef base::Tuple<A> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, get<0>(p));
|
||||
WriteParam(m, base::get<0>(p));
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
return ReadParam(m, iter, &get<0>(*r));
|
||||
return ReadParam(m, iter, &base::get<0>(*r));
|
||||
}
|
||||
static void Log(const param_type& p, std::string* l) {
|
||||
LogParam(get<0>(p), l);
|
||||
LogParam(base::get<0>(p), l);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B>
|
||||
struct ParamTraits< Tuple<A, B> > {
|
||||
typedef Tuple<A, B> param_type;
|
||||
struct ParamTraits<base::Tuple<A, B>> {
|
||||
typedef base::Tuple<A, B> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, get<0>(p));
|
||||
WriteParam(m, get<1>(p));
|
||||
WriteParam(m, base::get<0>(p));
|
||||
WriteParam(m, base::get<1>(p));
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
return (ReadParam(m, iter, &get<0>(*r)) &&
|
||||
ReadParam(m, iter, &get<1>(*r)));
|
||||
return (ReadParam(m, iter, &base::get<0>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<1>(*r)));
|
||||
}
|
||||
static void Log(const param_type& p, std::string* l) {
|
||||
LogParam(get<0>(p), l);
|
||||
LogParam(base::get<0>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<1>(p), l);
|
||||
LogParam(base::get<1>(p), l);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C>
|
||||
struct ParamTraits< Tuple<A, B, C> > {
|
||||
typedef Tuple<A, B, C> param_type;
|
||||
struct ParamTraits<base::Tuple<A, B, C>> {
|
||||
typedef base::Tuple<A, B, C> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, get<0>(p));
|
||||
WriteParam(m, get<1>(p));
|
||||
WriteParam(m, get<2>(p));
|
||||
WriteParam(m, base::get<0>(p));
|
||||
WriteParam(m, base::get<1>(p));
|
||||
WriteParam(m, base::get<2>(p));
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
return (ReadParam(m, iter, &get<0>(*r)) &&
|
||||
ReadParam(m, iter, &get<1>(*r)) &&
|
||||
ReadParam(m, iter, &get<2>(*r)));
|
||||
return (ReadParam(m, iter, &base::get<0>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<1>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<2>(*r)));
|
||||
}
|
||||
static void Log(const param_type& p, std::string* l) {
|
||||
LogParam(get<0>(p), l);
|
||||
LogParam(base::get<0>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<1>(p), l);
|
||||
LogParam(base::get<1>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<2>(p), l);
|
||||
LogParam(base::get<2>(p), l);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C, class D>
|
||||
struct ParamTraits< Tuple<A, B, C, D> > {
|
||||
typedef Tuple<A, B, C, D> param_type;
|
||||
struct ParamTraits<base::Tuple<A, B, C, D>> {
|
||||
typedef base::Tuple<A, B, C, D> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, get<0>(p));
|
||||
WriteParam(m, get<1>(p));
|
||||
WriteParam(m, get<2>(p));
|
||||
WriteParam(m, get<3>(p));
|
||||
WriteParam(m, base::get<0>(p));
|
||||
WriteParam(m, base::get<1>(p));
|
||||
WriteParam(m, base::get<2>(p));
|
||||
WriteParam(m, base::get<3>(p));
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
return (ReadParam(m, iter, &get<0>(*r)) &&
|
||||
ReadParam(m, iter, &get<1>(*r)) &&
|
||||
ReadParam(m, iter, &get<2>(*r)) &&
|
||||
ReadParam(m, iter, &get<3>(*r)));
|
||||
return (ReadParam(m, iter, &base::get<0>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<1>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<2>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<3>(*r)));
|
||||
}
|
||||
static void Log(const param_type& p, std::string* l) {
|
||||
LogParam(get<0>(p), l);
|
||||
LogParam(base::get<0>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<1>(p), l);
|
||||
LogParam(base::get<1>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<2>(p), l);
|
||||
LogParam(base::get<2>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<3>(p), l);
|
||||
LogParam(base::get<3>(p), l);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C, class D, class E>
|
||||
struct ParamTraits< Tuple<A, B, C, D, E> > {
|
||||
typedef Tuple<A, B, C, D, E> param_type;
|
||||
struct ParamTraits<base::Tuple<A, B, C, D, E>> {
|
||||
typedef base::Tuple<A, B, C, D, E> param_type;
|
||||
static void Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, get<0>(p));
|
||||
WriteParam(m, get<1>(p));
|
||||
WriteParam(m, get<2>(p));
|
||||
WriteParam(m, get<3>(p));
|
||||
WriteParam(m, get<4>(p));
|
||||
WriteParam(m, base::get<0>(p));
|
||||
WriteParam(m, base::get<1>(p));
|
||||
WriteParam(m, base::get<2>(p));
|
||||
WriteParam(m, base::get<3>(p));
|
||||
WriteParam(m, base::get<4>(p));
|
||||
}
|
||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
||||
return (ReadParam(m, iter, &get<0>(*r)) &&
|
||||
ReadParam(m, iter, &get<1>(*r)) &&
|
||||
ReadParam(m, iter, &get<2>(*r)) &&
|
||||
ReadParam(m, iter, &get<3>(*r)) &&
|
||||
ReadParam(m, iter, &get<4>(*r)));
|
||||
return (ReadParam(m, iter, &base::get<0>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<1>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<2>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<3>(*r)) &&
|
||||
ReadParam(m, iter, &base::get<4>(*r)));
|
||||
}
|
||||
static void Log(const param_type& p, std::string* l) {
|
||||
LogParam(get<0>(p), l);
|
||||
LogParam(base::get<0>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<1>(p), l);
|
||||
LogParam(base::get<1>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<2>(p), l);
|
||||
LogParam(base::get<2>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<3>(p), l);
|
||||
LogParam(base::get<3>(p), l);
|
||||
l->append(", ");
|
||||
LogParam(get<4>(p), l);
|
||||
LogParam(base::get<4>(p), l);
|
||||
}
|
||||
};
|
||||
|
||||
@ -788,7 +788,7 @@ template <class ParamType>
|
||||
class MessageSchema {
|
||||
public:
|
||||
typedef ParamType Param;
|
||||
typedef typename TupleTypes<ParamType>::ParamTuple RefParam;
|
||||
typedef typename base::TupleTypes<ParamType>::ParamTuple RefParam;
|
||||
|
||||
static void Write(Message* msg, const RefParam& p) IPC_MSG_NOINLINE;
|
||||
static bool Read(const Message* msg, Param* p) IPC_MSG_NOINLINE;
|
||||
@ -861,14 +861,14 @@ template <class SendParamType, class ReplyParamType>
|
||||
class SyncMessageSchema {
|
||||
public:
|
||||
typedef SendParamType SendParam;
|
||||
typedef typename TupleTypes<SendParam>::ParamTuple RefSendParam;
|
||||
typedef typename base::TupleTypes<SendParam>::ParamTuple RefSendParam;
|
||||
typedef ReplyParamType ReplyParam;
|
||||
|
||||
static void Write(Message* msg, const RefSendParam& send) IPC_MSG_NOINLINE;
|
||||
static bool ReadSendParam(const Message* msg, SendParam* p) IPC_MSG_NOINLINE;
|
||||
static bool ReadReplyParam(
|
||||
const Message* msg,
|
||||
typename TupleTypes<ReplyParam>::ValueTuple* p) IPC_MSG_NOINLINE;
|
||||
typename base::TupleTypes<ReplyParam>::ValueTuple* p) IPC_MSG_NOINLINE;
|
||||
|
||||
template<class T, class S, class Method>
|
||||
static bool DispatchWithSendParams(bool ok, const SendParam& send_params,
|
||||
@ -876,7 +876,7 @@ class SyncMessageSchema {
|
||||
Method func) {
|
||||
Message* reply = SyncMessage::GenerateReply(msg);
|
||||
if (ok) {
|
||||
typename TupleTypes<ReplyParam>::ValueTuple reply_params;
|
||||
typename base::TupleTypes<ReplyParam>::ValueTuple reply_params;
|
||||
DispatchToMethod(obj, func, send_params, &reply_params);
|
||||
WriteParam(reply, reply_params);
|
||||
LogReplyParamsToMessage(reply_params, msg);
|
||||
@ -895,7 +895,7 @@ class SyncMessageSchema {
|
||||
Method func) {
|
||||
Message* reply = SyncMessage::GenerateReply(msg);
|
||||
if (ok) {
|
||||
Tuple<Message&> t = MakeRefTuple(*reply);
|
||||
base::Tuple<Message&> t = base::MakeRefTuple(*reply);
|
||||
ConnectMessageAndReply(msg, reply);
|
||||
DispatchToMethod(obj, func, send_params, &t);
|
||||
} else {
|
||||
|
@ -41,7 +41,7 @@ bool SyncMessageSchema<SendParamType, ReplyParamType>::ReadSendParam(
|
||||
|
||||
template <class SendParamType, class ReplyParamType>
|
||||
bool SyncMessageSchema<SendParamType, ReplyParamType>::ReadReplyParam(
|
||||
const Message* msg, typename TupleTypes<ReplyParam>::ValueTuple* p) {
|
||||
const Message* msg, typename base::TupleTypes<ReplyParam>::ValueTuple* p) {
|
||||
PickleIterator iter = SyncMessage::GetDataIterator(msg);
|
||||
return ReadParam(msg, &iter, p);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class Message;
|
||||
//
|
||||
// IPC::Message* msg = test_sink.GetUniqueMessageMatching(IPC_REPLY_ID);
|
||||
// ASSERT_TRUE(msg);
|
||||
// TupleTypes<ViewHostMsg_Foo::ReplyParam>::ValueTuple reply_data;
|
||||
// base::TupleTypes<ViewHostMsg_Foo::ReplyParam>::ValueTuple reply_data;
|
||||
// EXPECT_TRUE(ViewHostMsg_Foo::ReadReplyParam(msg, &reply_data));
|
||||
//
|
||||
// You can also register to be notified when messages are posted to the sink.
|
||||
|
@ -383,13 +383,13 @@ TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) {
|
||||
EXPECT_CALL(*send_algorithm, GetCongestionWindow())
|
||||
.WillRepeatedly(Return(kMaxPacketSize * 10));
|
||||
EXPECT_CALL(*stream2, OnCanWrite())
|
||||
.WillOnce(IgnoreResult(Invoke(CreateFunctor(
|
||||
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
|
||||
&session_, &TestSession::SendStreamData, stream2->id()))));
|
||||
EXPECT_CALL(*stream4, OnCanWrite())
|
||||
.WillOnce(IgnoreResult(Invoke(CreateFunctor(
|
||||
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
|
||||
&session_, &TestSession::SendStreamData, stream4->id()))));
|
||||
EXPECT_CALL(*stream6, OnCanWrite())
|
||||
.WillOnce(IgnoreResult(Invoke(CreateFunctor(
|
||||
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
|
||||
&session_, &TestSession::SendStreamData, stream6->id()))));
|
||||
|
||||
// Expect that we only send one packet, the writes from different streams
|
||||
|
@ -22,45 +22,47 @@ struct HostMessageContext;
|
||||
template <class ObjT, class Method>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<>& arg) {
|
||||
base::Tuple<>& arg) {
|
||||
return (obj->*method)(context);
|
||||
}
|
||||
|
||||
template <class ObjT, class Method, class A>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<A>& arg) {
|
||||
return (obj->*method)(context, get<0>(arg));
|
||||
base::Tuple<A>& arg) {
|
||||
return (obj->*method)(context, base::get<0>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<A, B>& arg) {
|
||||
return (obj->*method)(context, get<0>(arg), get<1>(arg));
|
||||
base::Tuple<A, B>& arg) {
|
||||
return (obj->*method)(context, base::get<0>(arg), base::get<1>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<A, B, C>& arg) {
|
||||
return (obj->*method)(context, get<0>(arg), get<1>(arg), get<2>(arg));
|
||||
base::Tuple<A, B, C>& arg) {
|
||||
return (obj->*method)(context, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C, class D>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<A, B, C, D>& arg) {
|
||||
return (obj->*method)(context, get<0>(arg), get<1>(arg), get<2>(arg),
|
||||
get<3>(arg));
|
||||
base::Tuple<A, B, C, D>& arg) {
|
||||
return (obj->*method)(context, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg), base::get<3>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C, class D, class E>
|
||||
inline int32_t DispatchResourceCall(ObjT* obj, Method method,
|
||||
HostMessageContext* context,
|
||||
Tuple<A, B, C, D, E>& arg) {
|
||||
return (obj->*method)(context, get<0>(arg), get<1>(arg), get<2>(arg),
|
||||
get<3>(arg), get<4>(arg));
|
||||
base::Tuple<A, B, C, D, E>& arg) {
|
||||
return (obj->*method)(context, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg), base::get<3>(arg),
|
||||
base::get<4>(arg));
|
||||
}
|
||||
|
||||
// Note that this only works for message with 1 or more parameters. For
|
||||
|
@ -22,44 +22,46 @@ class ResourceMessageReplyParams;
|
||||
template <class ObjT, class Method>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<>& arg) {
|
||||
const base::Tuple<>& arg) {
|
||||
(obj->*method)(params);
|
||||
}
|
||||
|
||||
template <class ObjT, class Method, class A>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<A>& arg) {
|
||||
(obj->*method)(params, get<0>(arg));
|
||||
const base::Tuple<A>& arg) {
|
||||
(obj->*method)(params, base::get<0>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<A, B>& arg) {
|
||||
(obj->*method)(params, get<0>(arg), get<1>(arg));
|
||||
const base::Tuple<A, B>& arg) {
|
||||
(obj->*method)(params, base::get<0>(arg), base::get<1>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<A, B, C>& arg) {
|
||||
(obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg));
|
||||
const base::Tuple<A, B, C>& arg) {
|
||||
(obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C, class D>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<A, B, C, D>& arg) {
|
||||
(obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg));
|
||||
const base::Tuple<A, B, C, D>& arg) {
|
||||
(obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg), base::get<3>(arg));
|
||||
}
|
||||
|
||||
template<class ObjT, class Method, class A, class B, class C, class D, class E>
|
||||
inline void DispatchResourceReply(ObjT* obj, Method method,
|
||||
const ResourceMessageReplyParams& params,
|
||||
const Tuple<A, B, C, D, E>& arg) {
|
||||
(obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg),
|
||||
get<4>(arg));
|
||||
const base::Tuple<A, B, C, D, E>& arg) {
|
||||
(obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
|
||||
base::get<2>(arg), base::get<3>(arg), base::get<4>(arg));
|
||||
}
|
||||
|
||||
// Used to dispatch resource replies. In most cases, you should not call this
|
||||
|
@ -149,26 +149,26 @@ void ScanParam(const T& param, ScanningResults* results) {
|
||||
// The idea is to scan elements in the tuple which require special handling,
|
||||
// and write them into the |results| struct.
|
||||
template <class A>
|
||||
void ScanTuple(const Tuple<A>& t1, ScanningResults* results) {
|
||||
ScanParam(get<0>(t1), results);
|
||||
void ScanTuple(const base::Tuple<A>& t1, ScanningResults* results) {
|
||||
ScanParam(base::get<0>(t1), results);
|
||||
}
|
||||
template <class A, class B>
|
||||
void ScanTuple(const Tuple<A, B>& t1, ScanningResults* results) {
|
||||
ScanParam(get<0>(t1), results);
|
||||
ScanParam(get<1>(t1), results);
|
||||
void ScanTuple(const base::Tuple<A, B>& t1, ScanningResults* results) {
|
||||
ScanParam(base::get<0>(t1), results);
|
||||
ScanParam(base::get<1>(t1), results);
|
||||
}
|
||||
template <class A, class B, class C>
|
||||
void ScanTuple(const Tuple<A, B, C>& t1, ScanningResults* results) {
|
||||
ScanParam(get<0>(t1), results);
|
||||
ScanParam(get<1>(t1), results);
|
||||
ScanParam(get<2>(t1), results);
|
||||
void ScanTuple(const base::Tuple<A, B, C>& t1, ScanningResults* results) {
|
||||
ScanParam(base::get<0>(t1), results);
|
||||
ScanParam(base::get<1>(t1), results);
|
||||
ScanParam(base::get<2>(t1), results);
|
||||
}
|
||||
template <class A, class B, class C, class D>
|
||||
void ScanTuple(const Tuple<A, B, C, D>& t1, ScanningResults* results) {
|
||||
ScanParam(get<0>(t1), results);
|
||||
ScanParam(get<1>(t1), results);
|
||||
ScanParam(get<2>(t1), results);
|
||||
ScanParam(get<3>(t1), results);
|
||||
void ScanTuple(const base::Tuple<A, B, C, D>& t1, ScanningResults* results) {
|
||||
ScanParam(base::get<0>(t1), results);
|
||||
ScanParam(base::get<1>(t1), results);
|
||||
ScanParam(base::get<2>(t1), results);
|
||||
ScanParam(base::get<3>(t1), results);
|
||||
}
|
||||
|
||||
template <class MessageType>
|
||||
@ -178,7 +178,8 @@ class MessageScannerImpl {
|
||||
: msg_(static_cast<const MessageType*>(msg)) {
|
||||
}
|
||||
bool ScanMessage(ScanningResults* results) {
|
||||
typename TupleTypes<typename MessageType::Schema::Param>::ValueTuple params;
|
||||
typename base::TupleTypes<typename MessageType::Schema::Param>::ValueTuple
|
||||
params;
|
||||
if (!MessageType::Read(msg_, ¶ms))
|
||||
return false;
|
||||
ScanTuple(params, results);
|
||||
@ -186,8 +187,8 @@ class MessageScannerImpl {
|
||||
}
|
||||
|
||||
bool ScanReply(ScanningResults* results) {
|
||||
typename TupleTypes<typename MessageType::Schema::ReplyParam>::ValueTuple
|
||||
params;
|
||||
typename base::TupleTypes<typename MessageType::Schema::ReplyParam>
|
||||
::ValueTuple params;
|
||||
if (!MessageType::ReadReplyParam(msg_, ¶ms))
|
||||
return false;
|
||||
// If we need to rewrite the message, write the message id first.
|
||||
|
@ -56,9 +56,9 @@ class PluginVarTrackerTest : public PluginProxyTest {
|
||||
if (!release_msg)
|
||||
return -1;
|
||||
|
||||
Tuple<int64> id;
|
||||
base::Tuple<int64> id;
|
||||
PpapiHostMsg_PPBVar_ReleaseObject::Read(release_msg, &id);
|
||||
return get<0>(id);
|
||||
return base::get<0>(id);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,7 @@ struct TupleTypeMatch1 {
|
||||
static const bool kValue = false;
|
||||
};
|
||||
template <class A>
|
||||
struct TupleTypeMatch1<Tuple<A>, A> {
|
||||
struct TupleTypeMatch1<base::Tuple<A>, A> {
|
||||
static const bool kValue = true;
|
||||
};
|
||||
|
||||
@ -32,7 +32,7 @@ struct TupleTypeMatch2 {
|
||||
static const bool kValue = false;
|
||||
};
|
||||
template <class A, class B>
|
||||
struct TupleTypeMatch2<Tuple<A, B>, A, B> {
|
||||
struct TupleTypeMatch2<base::Tuple<A, B>, A, B> {
|
||||
static const bool kValue = true;
|
||||
};
|
||||
|
||||
@ -41,7 +41,7 @@ struct TupleTypeMatch3 {
|
||||
static const bool kValue = false;
|
||||
};
|
||||
template <class A, class B, class C>
|
||||
struct TupleTypeMatch3<Tuple<A, B, C>, A, B, C> {
|
||||
struct TupleTypeMatch3<base::Tuple<A, B, C>, A, B, C> {
|
||||
static const bool kValue = true;
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ struct TupleTypeMatch4 {
|
||||
static const bool kValue = false;
|
||||
};
|
||||
template <class A, class B, class C, class D>
|
||||
struct TupleTypeMatch4<Tuple<A, B, C, D>, A, B, C, D> {
|
||||
struct TupleTypeMatch4<base::Tuple<A, B, C, D>, A, B, C, D> {
|
||||
static const bool kValue = true;
|
||||
};
|
||||
|
||||
@ -59,7 +59,7 @@ struct TupleTypeMatch5 {
|
||||
static const bool kValue = false;
|
||||
};
|
||||
template <class A, class B, class C, class D, class E>
|
||||
struct TupleTypeMatch5<Tuple<A, B, C, D, E>, A, B, C, D, E> {
|
||||
struct TupleTypeMatch5<base::Tuple<A, B, C, D, E>, A, B, C, D, E> {
|
||||
static const bool kValue = true;
|
||||
};
|
||||
|
||||
|
@ -135,12 +135,13 @@ bool ProxyTestHarnessBase::SupportsInterface(const char* name) {
|
||||
if (!reply_msg)
|
||||
return false;
|
||||
|
||||
TupleTypes<PpapiMsg_SupportsInterface::ReplyParam>::ValueTuple reply_data;
|
||||
base::TupleTypes<PpapiMsg_SupportsInterface::ReplyParam>::ValueTuple
|
||||
reply_data;
|
||||
EXPECT_TRUE(PpapiMsg_SupportsInterface::ReadReplyParam(
|
||||
reply_msg, &reply_data));
|
||||
|
||||
sink().ClearMessages();
|
||||
return get<0>(reply_data);
|
||||
return base::get<0>(reply_data);
|
||||
}
|
||||
|
||||
// PluginProxyTestHarness ------------------------------------------------------
|
||||
|
@ -24,8 +24,8 @@ GetAllResourceMessagesMatching(const ResourceMessageTestSink& sink,
|
||||
if (msg->type() == WrapperMessage::ID) {
|
||||
typename WrapperMessage::Param params;
|
||||
WrapperMessage::Read(msg, ¶ms);
|
||||
Params cur_params = get<0>(params);
|
||||
IPC::Message cur_msg = get<1>(params);
|
||||
Params cur_params = base::get<0>(params);
|
||||
IPC::Message cur_msg = base::get<1>(params);
|
||||
if (cur_msg.type() == id) {
|
||||
result.push_back(std::make_pair(cur_params, cur_msg));
|
||||
}
|
||||
@ -130,8 +130,8 @@ bool ResourceSyncCallHandler::OnMessageReceived(const IPC::Message& msg) {
|
||||
bool success = PpapiHostMsg_ResourceSyncCall::ReadSendParam(
|
||||
&msg, &send_params);
|
||||
DCHECK(success);
|
||||
ResourceMessageCallParams call_params = get<0>(send_params);
|
||||
IPC::Message call_msg = get<1>(send_params);
|
||||
ResourceMessageCallParams call_params = base::get<0>(send_params);
|
||||
IPC::Message call_msg = base::get<1>(send_params);
|
||||
if (call_msg.type() != incoming_type_)
|
||||
return false;
|
||||
IPC::Message* wrapper_reply_msg = IPC::SyncMessage::GenerateReply(&msg);
|
||||
|
@ -78,9 +78,9 @@ TEST_F(WebSocketResourceTest, Connect) {
|
||||
PpapiHostMsg_WebSocket_Connect::ID, ¶ms, &msg));
|
||||
PpapiHostMsg_WebSocket_Connect::Schema::Param p;
|
||||
PpapiHostMsg_WebSocket_Connect::Read(&msg, &p);
|
||||
EXPECT_EQ(url, get<0>(p));
|
||||
EXPECT_EQ(protocol0, get<1>(p)[0]);
|
||||
EXPECT_EQ(protocol1, get<1>(p)[1]);
|
||||
EXPECT_EQ(url, base::get<0>(p));
|
||||
EXPECT_EQ(protocol0, base::get<1>(p)[0]);
|
||||
EXPECT_EQ(protocol1, base::get<1>(p)[1]);
|
||||
|
||||
// Synthesize a response.
|
||||
ResourceMessageReplyParams reply_params(params.pp_resource(),
|
||||
|
@ -16,7 +16,7 @@ namespace printing {
|
||||
// gfx::Rect - render area
|
||||
// int - render dpi
|
||||
// bool - autorotate pages to fit paper
|
||||
typedef Tuple<gfx::Rect, int, bool> PdfRenderSettingsBase;
|
||||
typedef base::Tuple<gfx::Rect, int, bool> PdfRenderSettingsBase;
|
||||
|
||||
class PdfRenderSettings : public PdfRenderSettingsBase {
|
||||
public:
|
||||
@ -25,9 +25,9 @@ class PdfRenderSettings : public PdfRenderSettingsBase {
|
||||
: PdfRenderSettingsBase(area, dpi, autorotate) {}
|
||||
~PdfRenderSettings() {}
|
||||
|
||||
const gfx::Rect& area() const { return ::get<0>(*this); }
|
||||
int dpi() const { return ::get<1>(*this); }
|
||||
bool autorotate() const { return ::get<2>(*this); }
|
||||
const gfx::Rect& area() const { return base::get<0>(*this); }
|
||||
int dpi() const { return base::get<1>(*this); }
|
||||
bool autorotate() const { return base::get<2>(*this); }
|
||||
};
|
||||
|
||||
} // namespace printing
|
||||
|
@ -145,14 +145,14 @@ size_t CodeGen::Offset(Node target) const {
|
||||
// TODO(mdempsky): Move into a general base::Tuple helper library.
|
||||
bool CodeGen::MemoKeyLess::operator()(const MemoKey& lhs,
|
||||
const MemoKey& rhs) const {
|
||||
if (get<0>(lhs) != get<0>(rhs))
|
||||
return get<0>(lhs) < get<0>(rhs);
|
||||
if (get<1>(lhs) != get<1>(rhs))
|
||||
return get<1>(lhs) < get<1>(rhs);
|
||||
if (get<2>(lhs) != get<2>(rhs))
|
||||
return get<2>(lhs) < get<2>(rhs);
|
||||
if (get<3>(lhs) != get<3>(rhs))
|
||||
return get<3>(lhs) < get<3>(rhs);
|
||||
if (base::get<0>(lhs) != base::get<0>(rhs))
|
||||
return base::get<0>(lhs) < base::get<0>(rhs);
|
||||
if (base::get<1>(lhs) != base::get<1>(rhs))
|
||||
return base::get<1>(lhs) < base::get<1>(rhs);
|
||||
if (base::get<2>(lhs) != base::get<2>(rhs))
|
||||
return base::get<2>(lhs) < base::get<2>(rhs);
|
||||
if (base::get<3>(lhs) != base::get<3>(rhs))
|
||||
return base::get<3>(lhs) < base::get<3>(rhs);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ class SANDBOX_EXPORT CodeGen {
|
||||
void Compile(Node head, Program* program);
|
||||
|
||||
private:
|
||||
using MemoKey = Tuple<uint16_t, uint32_t, Node, Node>;
|
||||
using MemoKey = base::Tuple<uint16_t, uint32_t, Node, Node>;
|
||||
struct MemoKeyLess {
|
||||
bool operator()(const MemoKey& lhs, const MemoKey& rhs) const;
|
||||
};
|
||||
|
@ -406,21 +406,21 @@ class StreamCopyOrMoveImpl
|
||||
void NotifyOnStartUpdate(const FileSystemURL& url) {
|
||||
if (file_system_context_->GetUpdateObservers(url.type())) {
|
||||
file_system_context_->GetUpdateObservers(url.type())
|
||||
->Notify(&FileUpdateObserver::OnStartUpdate, MakeTuple(url));
|
||||
->Notify(&FileUpdateObserver::OnStartUpdate, base::MakeTuple(url));
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyOnModifyFile(const FileSystemURL& url) {
|
||||
if (file_system_context_->GetChangeObservers(url.type())) {
|
||||
file_system_context_->GetChangeObservers(url.type())
|
||||
->Notify(&FileChangeObserver::OnModifyFile, MakeTuple(url));
|
||||
->Notify(&FileChangeObserver::OnModifyFile, base::MakeTuple(url));
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyOnEndUpdate(const FileSystemURL& url) {
|
||||
if (file_system_context_->GetUpdateObservers(url.type())) {
|
||||
file_system_context_->GetUpdateObservers(url.type())
|
||||
->Notify(&FileUpdateObserver::OnEndUpdate, MakeTuple(url));
|
||||
->Notify(&FileUpdateObserver::OnEndUpdate, base::MakeTuple(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ void FileSystemOperationImpl::DidWrite(
|
||||
if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) {
|
||||
DCHECK(operation_context_);
|
||||
operation_context_->change_observers()->Notify(
|
||||
&FileChangeObserver::OnModifyFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnModifyFile, base::MakeTuple(url));
|
||||
}
|
||||
|
||||
StatusCallback cancel_callback = cancel_callback_;
|
||||
|
@ -632,7 +632,7 @@ void FileSystemOperationRunner::PrepareForWrite(OperationID id,
|
||||
const FileSystemURL& url) {
|
||||
if (file_system_context_->GetUpdateObservers(url.type())) {
|
||||
file_system_context_->GetUpdateObservers(url.type())->Notify(
|
||||
&FileUpdateObserver::OnStartUpdate, MakeTuple(url));
|
||||
&FileUpdateObserver::OnStartUpdate, base::MakeTuple(url));
|
||||
}
|
||||
write_target_urls_[id].insert(url);
|
||||
}
|
||||
@ -641,7 +641,7 @@ void FileSystemOperationRunner::PrepareForRead(OperationID id,
|
||||
const FileSystemURL& url) {
|
||||
if (file_system_context_->GetAccessObservers(url.type())) {
|
||||
file_system_context_->GetAccessObservers(url.type())->Notify(
|
||||
&FileAccessObserver::OnAccess, MakeTuple(url));
|
||||
&FileAccessObserver::OnAccess, base::MakeTuple(url));
|
||||
}
|
||||
}
|
||||
|
||||
@ -663,7 +663,7 @@ void FileSystemOperationRunner::FinishOperation(OperationID id) {
|
||||
iter != urls.end(); ++iter) {
|
||||
if (file_system_context_->GetUpdateObservers(iter->type())) {
|
||||
file_system_context_->GetUpdateObservers(iter->type())->Notify(
|
||||
&FileUpdateObserver::OnEndUpdate, MakeTuple(*iter));
|
||||
&FileUpdateObserver::OnEndUpdate, base::MakeTuple(*iter));
|
||||
}
|
||||
}
|
||||
write_target_urls_.erase(found);
|
||||
|
@ -88,7 +88,7 @@ void UpdateUsage(
|
||||
const FileSystemURL& url,
|
||||
int64 growth) {
|
||||
context->update_observers()->Notify(
|
||||
&FileUpdateObserver::OnUpdate, MakeTuple(url, growth));
|
||||
&FileUpdateObserver::OnUpdate, base::MakeTuple(url, growth));
|
||||
}
|
||||
|
||||
void TouchDirectory(SandboxDirectoryDatabase* db, FileId dir_id) {
|
||||
@ -319,7 +319,7 @@ base::File::Error ObfuscatedFileUtil::EnsureFileExists(
|
||||
*created = true;
|
||||
UpdateUsage(context, url, growth);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnCreateFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnCreateFile, base::MakeTuple(url));
|
||||
}
|
||||
return error;
|
||||
}
|
||||
@ -378,7 +378,7 @@ base::File::Error ObfuscatedFileUtil::CreateDirectory(
|
||||
return error;
|
||||
UpdateUsage(context, url, growth);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnCreateDirectory, MakeTuple(url));
|
||||
&FileChangeObserver::OnCreateDirectory, base::MakeTuple(url));
|
||||
if (first) {
|
||||
first = false;
|
||||
TouchDirectory(db, file_info.parent_id);
|
||||
@ -479,7 +479,7 @@ base::File::Error ObfuscatedFileUtil::Truncate(
|
||||
if (error == base::File::FILE_OK) {
|
||||
UpdateUsage(context, url, growth);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnModifyFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnModifyFile, base::MakeTuple(url));
|
||||
}
|
||||
return error;
|
||||
}
|
||||
@ -606,16 +606,16 @@ base::File::Error ObfuscatedFileUtil::CopyOrMoveFile(
|
||||
if (overwrite) {
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnModifyFile,
|
||||
MakeTuple(dest_url));
|
||||
base::MakeTuple(dest_url));
|
||||
} else {
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnCreateFileFrom,
|
||||
MakeTuple(dest_url, src_url));
|
||||
base::MakeTuple(dest_url, src_url));
|
||||
}
|
||||
|
||||
if (!copy) {
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnRemoveFile, MakeTuple(src_url));
|
||||
&FileChangeObserver::OnRemoveFile, base::MakeTuple(src_url));
|
||||
TouchDirectory(db, src_file_info.parent_id);
|
||||
}
|
||||
|
||||
@ -694,10 +694,10 @@ base::File::Error ObfuscatedFileUtil::CopyInForeignFile(
|
||||
|
||||
if (overwrite) {
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnModifyFile, MakeTuple(dest_url));
|
||||
&FileChangeObserver::OnModifyFile, base::MakeTuple(dest_url));
|
||||
} else {
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnCreateFile, MakeTuple(dest_url));
|
||||
&FileChangeObserver::OnCreateFile, base::MakeTuple(dest_url));
|
||||
}
|
||||
|
||||
UpdateUsage(context, dest_url, growth);
|
||||
@ -737,7 +737,7 @@ base::File::Error ObfuscatedFileUtil::DeleteFile(
|
||||
TouchDirectory(db, file_info.parent_id);
|
||||
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnRemoveFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnRemoveFile, base::MakeTuple(url));
|
||||
|
||||
if (error == base::File::FILE_ERROR_NOT_FOUND)
|
||||
return base::File::FILE_OK;
|
||||
@ -772,7 +772,7 @@ base::File::Error ObfuscatedFileUtil::DeleteDirectory(
|
||||
UpdateUsage(context, url, growth);
|
||||
TouchDirectory(db, file_info.parent_id);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnRemoveDirectory, MakeTuple(url));
|
||||
&FileChangeObserver::OnRemoveDirectory, base::MakeTuple(url));
|
||||
return base::File::FILE_OK;
|
||||
}
|
||||
|
||||
@ -1366,7 +1366,7 @@ base::File ObfuscatedFileUtil::CreateOrOpenInternal(
|
||||
if (file.IsValid()) {
|
||||
UpdateUsage(context, url, growth);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnCreateFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnCreateFile, base::MakeTuple(url));
|
||||
}
|
||||
return file.Pass();
|
||||
}
|
||||
@ -1409,7 +1409,7 @@ base::File ObfuscatedFileUtil::CreateOrOpenInternal(
|
||||
if (delta) {
|
||||
UpdateUsage(context, url, delta);
|
||||
context->change_observers()->Notify(
|
||||
&FileChangeObserver::OnModifyFile, MakeTuple(url));
|
||||
&FileChangeObserver::OnModifyFile, base::MakeTuple(url));
|
||||
}
|
||||
return file.Pass();
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ void SandboxFileStreamWriter::DidWrite(
|
||||
if (overlapped < 0)
|
||||
overlapped = 0;
|
||||
observers_.Notify(&FileUpdateObserver::OnUpdate,
|
||||
MakeTuple(url_, write_response - overlapped));
|
||||
base::MakeTuple(url_, write_response - overlapped));
|
||||
}
|
||||
total_bytes_written_ += write_response;
|
||||
|
||||
|
@ -113,7 +113,7 @@ HEADER = """\
|
||||
//
|
||||
|
||||
#include "base/memory/linked_ptr.h"
|
||||
#include "base/tuple.h" // for Tuple
|
||||
#include "base/tuple.h"
|
||||
|
||||
namespace testing {"""
|
||||
|
||||
@ -202,7 +202,7 @@ struct MutantFunctor {
|
||||
}
|
||||
|
||||
inline R operator()() {
|
||||
return impl_->RunWithParams(Tuple<>());
|
||||
return impl_->RunWithParams(base::Tuple<>());
|
||||
}
|
||||
|
||||
template <typename Arg1>
|
||||
@ -276,7 +276,7 @@ CreateFunctor(T* obj, R (U::*method)(%(params)s), %(args)s) {
|
||||
MutantRunner<R, %(calltime)s>* t =
|
||||
new Mutant<R, T, R (U::*)(%(params)s),
|
||||
%(prebound)s, %(calltime)s>
|
||||
(obj, method, MakeTuple(%(call_args)s));
|
||||
(obj, method, base::MakeTuple(%(call_args)s));
|
||||
return MutantFunctor<R, %(calltime)s>(t);
|
||||
}
|
||||
"""
|
||||
@ -288,14 +288,14 @@ CreateFunctor(R (*function)(%(params)s), %(args)s) {
|
||||
MutantRunner<R, %(calltime)s>* t =
|
||||
new MutantFunction<R, R (*)(%(params)s),
|
||||
%(prebound)s, %(calltime)s>
|
||||
(function, MakeTuple(%(call_args)s));
|
||||
(function, base::MakeTuple(%(call_args)s));
|
||||
return MutantFunctor<R, %(calltime)s>(t);
|
||||
}
|
||||
"""
|
||||
|
||||
def SplitLine(line, width):
|
||||
"""Splits a single line at comma, at most |width| characters long."""
|
||||
if len(line) < width:
|
||||
if len(line) <= width:
|
||||
return (line, None)
|
||||
n = 1 + line[:width].rfind(",")
|
||||
if n == 0: # If comma cannot be found give up and return the entire line.
|
||||
@ -352,14 +352,18 @@ def Merge(a):
|
||||
|
||||
|
||||
def GenTuple(pattern, n):
|
||||
return Clean("Tuple<%s>" % (Gen(pattern, n, 1)))
|
||||
return Clean("base::Tuple<%s>" % (Gen(pattern, n, 1)))
|
||||
|
||||
|
||||
def FixCode(s):
|
||||
lines = Clean(s).splitlines()
|
||||
# Wrap sometimes very long 1st and 3rd line at 80th column.
|
||||
# Wrap sometimes very long 1st line to be inside the "template <"
|
||||
lines[0] = Wrap(lines[0], 80, 10)
|
||||
lines[2] = Wrap(lines[2], 80, 4)
|
||||
|
||||
# Wrap all subsequent lines to 6 spaces arbitrarily. This is a 2-space line
|
||||
# indent, plus a 4 space continuation indent.
|
||||
for line in xrange(1, len(lines)):
|
||||
lines[line] = Wrap(lines[line], 80, 6)
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
@ -370,8 +374,8 @@ def GenerateDispatch(prebound, calltime):
|
||||
Gen("typename C%", calltime, 1)]),
|
||||
"prebound": GenTuple("P%", prebound),
|
||||
"calltime": GenTuple("C%", calltime),
|
||||
"args": Merge([Gen("get<%>(p)", prebound, 0),
|
||||
Gen("get<%>(c)", calltime, 0)]),
|
||||
"args": Merge([Gen("base::get<%>(p)", prebound, 0),
|
||||
Gen("base::get<%>(c)", calltime, 0)]),
|
||||
}
|
||||
|
||||
print FixCode(DISPATCH_TO_METHOD_TEMPLATE % args)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -209,58 +209,58 @@ struct FuzzTraits<base::string16> {
|
||||
|
||||
// Specializations for tuples.
|
||||
template <>
|
||||
struct FuzzTraits<Tuple<>> {
|
||||
static bool Fuzz(Tuple<>* p, Fuzzer* fuzzer) {
|
||||
struct FuzzTraits<base::Tuple<>> {
|
||||
static bool Fuzz(base::Tuple<>* p, Fuzzer* fuzzer) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <class A>
|
||||
struct FuzzTraits<Tuple<A>> {
|
||||
static bool Fuzz(Tuple<A>* p, Fuzzer* fuzzer) {
|
||||
return FuzzParam(&get<0>(*p), fuzzer);
|
||||
struct FuzzTraits<base::Tuple<A>> {
|
||||
static bool Fuzz(base::Tuple<A>* p, Fuzzer* fuzzer) {
|
||||
return FuzzParam(&base::get<0>(*p), fuzzer);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B>
|
||||
struct FuzzTraits<Tuple<A, B>> {
|
||||
static bool Fuzz(Tuple<A, B>* p, Fuzzer* fuzzer) {
|
||||
struct FuzzTraits<base::Tuple<A, B>> {
|
||||
static bool Fuzz(base::Tuple<A, B>* p, Fuzzer* fuzzer) {
|
||||
return
|
||||
FuzzParam(&get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&get<1>(*p), fuzzer);
|
||||
FuzzParam(&base::get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<1>(*p), fuzzer);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C>
|
||||
struct FuzzTraits<Tuple<A, B, C>> {
|
||||
static bool Fuzz(Tuple<A, B, C>* p, Fuzzer* fuzzer) {
|
||||
struct FuzzTraits<base::Tuple<A, B, C>> {
|
||||
static bool Fuzz(base::Tuple<A, B, C>* p, Fuzzer* fuzzer) {
|
||||
return
|
||||
FuzzParam(&get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&get<2>(*p), fuzzer);
|
||||
FuzzParam(&base::get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<2>(*p), fuzzer);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C, class D>
|
||||
struct FuzzTraits<Tuple<A, B, C, D>> {
|
||||
static bool Fuzz(Tuple<A, B, C, D>* p, Fuzzer* fuzzer) {
|
||||
struct FuzzTraits<base::Tuple<A, B, C, D>> {
|
||||
static bool Fuzz(base::Tuple<A, B, C, D>* p, Fuzzer* fuzzer) {
|
||||
return
|
||||
FuzzParam(&get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&get<2>(*p), fuzzer) &&
|
||||
FuzzParam(&get<3>(*p), fuzzer);
|
||||
FuzzParam(&base::get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<2>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<3>(*p), fuzzer);
|
||||
}
|
||||
};
|
||||
|
||||
template <class A, class B, class C, class D, class E>
|
||||
struct FuzzTraits<Tuple<A, B, C, D, E>> {
|
||||
static bool Fuzz(Tuple<A, B, C, D, E>* p, Fuzzer* fuzzer) {
|
||||
struct FuzzTraits<base::Tuple<A, B, C, D, E>> {
|
||||
static bool Fuzz(base::Tuple<A, B, C, D, E>* p, Fuzzer* fuzzer) {
|
||||
return
|
||||
FuzzParam(&get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&get<2>(*p), fuzzer) &&
|
||||
FuzzParam(&get<3>(*p), fuzzer) &&
|
||||
FuzzParam(&get<4>(*p), fuzzer);
|
||||
FuzzParam(&base::get<0>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<1>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<2>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<3>(*p), fuzzer) &&
|
||||
FuzzParam(&base::get<4>(*p), fuzzer);
|
||||
}
|
||||
};
|
||||
|
||||
@ -2053,12 +2053,13 @@ struct FuzzTraits<webrtc::MouseCursor> {
|
||||
#define MAX_FAKE_ROUTING_ID 15
|
||||
|
||||
#define IPC_MEMBERS_IN_0(p)
|
||||
#define IPC_MEMBERS_IN_1(p) get<0>(p)
|
||||
#define IPC_MEMBERS_IN_2(p) get<0>(p), get<1>(p)
|
||||
#define IPC_MEMBERS_IN_3(p) get<0>(p), get<1>(p), get<2>(p)
|
||||
#define IPC_MEMBERS_IN_4(p) get<0>(p), get<1>(p), get<2>(p), get<3>(p)
|
||||
#define IPC_MEMBERS_IN_5(p) get<0>(p), get<1>(p), get<2>(p), get<3>(p), \
|
||||
get<4>(p)
|
||||
#define IPC_MEMBERS_IN_1(p) base::get<0>(p)
|
||||
#define IPC_MEMBERS_IN_2(p) base::get<0>(p), base::get<1>(p)
|
||||
#define IPC_MEMBERS_IN_3(p) base::get<0>(p), base::get<1>(p), base::get<2>(p)
|
||||
#define IPC_MEMBERS_IN_4(p) base::get<0>(p), base::get<1>(p), base::get<2>(p), \
|
||||
base::get<3>(p)
|
||||
#define IPC_MEMBERS_IN_5(p) base::get<0>(p), base::get<1>(p), base::get<2>(p), \
|
||||
base::get<3>(p), base::get<4>(p)
|
||||
|
||||
#define IPC_MEMBERS_OUT_0()
|
||||
#define IPC_MEMBERS_OUT_1() NULL
|
||||
|
@ -85,15 +85,15 @@ OpenFileName::~OpenFileName() {
|
||||
}
|
||||
|
||||
void OpenFileName::SetFilters(
|
||||
const std::vector<Tuple<base::string16, base::string16>>& filters) {
|
||||
const std::vector<base::Tuple<base::string16, base::string16>>& filters) {
|
||||
openfilename_.lpstrFilter = NULL;
|
||||
filter_buffer_.clear();
|
||||
if (filters.empty())
|
||||
return;
|
||||
for (const auto& filter : filters) {
|
||||
filter_buffer_.append(get<0>(filter));
|
||||
filter_buffer_.append(base::get<0>(filter));
|
||||
filter_buffer_.push_back(0);
|
||||
filter_buffer_.append(get<1>(filter));
|
||||
filter_buffer_.append(base::get<1>(filter));
|
||||
filter_buffer_.push_back(0);
|
||||
}
|
||||
filter_buffer_.push_back(0);
|
||||
@ -202,9 +202,9 @@ void OpenFileName::SetResult(const base::FilePath& directory,
|
||||
}
|
||||
|
||||
// static
|
||||
std::vector<Tuple<base::string16, base::string16>>
|
||||
std::vector<base::Tuple<base::string16, base::string16>>
|
||||
OpenFileName::GetFilters(const OPENFILENAME* openfilename) {
|
||||
std::vector<Tuple<base::string16, base::string16>> filters;
|
||||
std::vector<base::Tuple<base::string16, base::string16>> filters;
|
||||
|
||||
const base::char16* display_string = openfilename->lpstrFilter;
|
||||
if (!display_string)
|
||||
@ -219,7 +219,7 @@ OpenFileName::GetFilters(const OPENFILENAME* openfilename) {
|
||||
while (*pattern_end)
|
||||
++pattern_end;
|
||||
filters.push_back(
|
||||
MakeTuple(base::string16(display_string, display_string_end),
|
||||
base::MakeTuple(base::string16(display_string, display_string_end),
|
||||
base::string16(pattern, pattern_end)));
|
||||
display_string = pattern_end + 1;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class UI_BASE_EXPORT OpenFileName {
|
||||
|
||||
// Initializes |lpstrFilter| from the label/pattern pairs in |filters|.
|
||||
void SetFilters(
|
||||
const std::vector<Tuple<base::string16, base::string16>>& filters);
|
||||
const std::vector<base::Tuple<base::string16, base::string16>>& filters);
|
||||
|
||||
// Sets |lpstrInitialDir| and |lpstrFile|.
|
||||
void SetInitialSelection(const base::FilePath& initial_directory,
|
||||
@ -68,7 +68,7 @@ class UI_BASE_EXPORT OpenFileName {
|
||||
|
||||
// Returns a vector of label/pattern pairs built from
|
||||
// |openfilename->lpstrFilter|.
|
||||
static std::vector<Tuple<base::string16, base::string16>> GetFilters(
|
||||
static std::vector<base::Tuple<base::string16, base::string16>> GetFilters(
|
||||
const OPENFILENAME* openfilename);
|
||||
|
||||
private:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user