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

Side by Side Diff: win8/metro_driver/winrt_utils.cc

Issue 11884021: size_t -> uint32 for building on win x64 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: e_invalidarg -> e_unexpected Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « win8/metro_driver/file_picker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "stdafx.h" 5 #include "stdafx.h"
6 #include "winrt_utils.h" 6 #include "winrt_utils.h"
7 7
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/win/scoped_com_initializer.h" 12 #include "base/win/scoped_com_initializer.h"
13 #include "base/win/scoped_comptr.h" 13 #include "base/win/scoped_comptr.h"
14 14
15 void CheckHR(HRESULT hr, const char* message) { 15 void CheckHR(HRESULT hr, const char* message) {
16 if (FAILED(hr)) { 16 if (FAILED(hr)) {
17 if (message) 17 if (message)
18 PLOG(DFATAL) << message << ", hr = " << std::hex << hr; 18 PLOG(DFATAL) << message << ", hr = " << std::hex << hr;
19 else 19 else
20 PLOG(DFATAL) << "COM ERROR" << ", hr = " << std::hex << hr; 20 PLOG(DFATAL) << "COM ERROR" << ", hr = " << std::hex << hr;
21 } 21 }
22 } 22 }
23 23
24 HSTRING MakeHString(const string16& str) { 24 HSTRING MakeHString(const string16& str) {
25 HSTRING hstr; 25 HSTRING hstr;
26 if (FAILED(::WindowsCreateString(str.c_str(), str.size(), &hstr))) { 26 if (FAILED(::WindowsCreateString(str.c_str(), static_cast<UINT32>(str.size()),
27 &hstr))) {
27 PLOG(DFATAL) << "Hstring creation failed"; 28 PLOG(DFATAL) << "Hstring creation failed";
28 } 29 }
29 return hstr; 30 return hstr;
30 } 31 }
31 32
32 string16 MakeStdWString(HSTRING hstring) { 33 string16 MakeStdWString(HSTRING hstring) {
33 const wchar_t* str; 34 const wchar_t* str;
34 UINT32 size = 0; 35 UINT32 size = 0;
35 str = ::WindowsGetStringRawBuffer(hstring, &size); 36 str = ::WindowsGetStringRawBuffer(hstring, &size);
36 if (!size) 37 if (!size)
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 HWND FindCoreWindow(DWORD thread_id, int wait_ms) { 239 HWND FindCoreWindow(DWORD thread_id, int wait_ms) {
239 HWND window = NULL; 240 HWND window = NULL;
240 do { 241 do {
241 ::Sleep(wait_ms); 242 ::Sleep(wait_ms);
242 ::EnumThreadWindows(thread_id, &CoreWindowFinder, LPARAM(&window)); 243 ::EnumThreadWindows(thread_id, &CoreWindowFinder, LPARAM(&window));
243 } while (window == NULL); 244 } while (window == NULL);
244 return window; 245 return window;
245 } 246 }
246 247
247 } // namespace winrt_utils 248 } // namespace winrt_utils
OLDNEW
« no previous file with comments | « win8/metro_driver/file_picker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698