diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 19:34:39 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 19:34:39 +0000 |
commit | ecd9aa34054396f135981f369105af51dec02793 (patch) | |
tree | 4285b404d242c0eaede0c2794e9028d5c69cab27 /chrome_frame | |
parent | bbf2e8ddf65510e08b2a85a0cd4d64d7be357238 (diff) | |
download | chromium_src-ecd9aa34054396f135981f369105af51dec02793.zip chromium_src-ecd9aa34054396f135981f369105af51dec02793.tar.gz chromium_src-ecd9aa34054396f135981f369105af51dec02793.tar.bz2 |
Adding a little utility function to make logging guids easier
and a dlog to see when we decide that a request is a subframe request.
TEST=Unit test is provided.
BUG=none
Review URL: http://codereview.chromium.org/660289
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/util_unittests.cc | 13 | ||||
-rw-r--r-- | chrome_frame/utils.cc | 6 | ||||
-rw-r--r-- | chrome_frame/utils.h | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/chrome_frame/test/util_unittests.cc b/chrome_frame/test/util_unittests.cc index 9c0be26..6e066a1 100644 --- a/chrome_frame/test/util_unittests.cc +++ b/chrome_frame/test/util_unittests.cc @@ -91,3 +91,16 @@ TEST(UtilTests, IsValidUrlScheme) { EXPECT_EQ(test.expected, IsValidUrlScheme(test.url, test.is_privileged)); } } + +TEST(UtilTests, GuidToString) { + // {3C5E2125-35BA-48df-A841-5F669B9D69FC} + const GUID test_guid = { 0x3c5e2125, 0x35ba, 0x48df, + { 0xa8, 0x41, 0x5f, 0x66, 0x9b, 0x9d, 0x69, 0xfc } }; + + wchar_t compare[64] = {0}; + ::StringFromGUID2(test_guid, compare, arraysize(compare)); + + std::wstring str_guid(GuidToString(test_guid)); + EXPECT_EQ(0, str_guid.compare(compare)); + EXPECT_EQ(static_cast<size_t>(lstrlenW(compare)), str_guid.length()); +} diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index bd803bf..04bac77 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -828,6 +828,7 @@ bool IsSubFrameRequest(IUnknown* service_provider) { } } } else { + DLOG(INFO) << "IsSubFrameRequest - no IWebBrowser2"; is_sub_frame_request = true; } @@ -866,3 +867,8 @@ bool IsTopLevelWindow(HWND window) { return !parent || (parent == GetDesktopWindow()); } +std::wstring GuidToString(const GUID& guid) { + std::wstring ret; + ::StringFromGUID2(guid, WriteInto(&ret, 39), 39); + return ret; +} diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index 440c1b0..16fa836 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -335,6 +335,8 @@ class STAThread : public base::Thread { } }; +std::wstring GuidToString(const GUID& guid); + // The urls retrieved from the IMoniker interface don't contain the anchor // portion of the actual url navigated to. This function checks whether the // url passed in the bho_url parameter contains an anchor and if yes checks |